You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I started using OhMyThreads and I have to say I like it a lot so far, but indeed I use this for speeding up long running simulations and I'd like to be able to interrupt the execution (while also interrupting the execution of the various tasks spawned by @tasks to avoid hogging CPU for an interrupted simulation till the end of the original @tasks iteration).
At the moment i resort to throwing an error within the body of @tasks for stopping early like so:
mutable struct AbortController
@atomic stop::BoolendAbortController() =AbortController(false)
controller =AbortController()
try@tasksfor i in1:100if@atomic(controller.stop)
error("Aborted")
endsleep(2) # expensive computation@info i
endfinally@atomic controller.stop =trueend
E.g.
break
within@tasks
as mentioned in #95 (comment)The text was updated successfully, but these errors were encountered: