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
The problem is as followed, as part of decoding work we spawn a bunch of tasks. These tasks must communicate their results back when collected but crucially, tasks do not complete in a lexical manner but as separate groups where sometimes their results must be utilized for further work—with this decision depending on data that is only available after such tasks are being spawned and thus this work happens as a separate task.
This implies it is not feasible to wrap the entire thing in a scope to perform that waiting. The only guaranteed synchronization point is after the lexcial end of the scope. The current situation is that this leads to deadlock: The work coordination happens in the main thread but it can never pick-up any work itself. None of scope, scope_fifo, spawn can be utilized for this as they either (a) do not wait on the tasks that had been spawn non-lexically or (b) can't 'block' to return a value to the scope.
What I'd like to have is an API similar to Scope, except I can pre-emptively consume the scope to perform an in-place wait Avoiding a deadlock because the current thread can always be used as a fallback to perform the tasks.
The text was updated successfully, but these errors were encountered:
Separated from: image-rs/jpeg-decoder#227
The problem is as followed, as part of decoding work we spawn a bunch of tasks. These tasks must communicate their results back when collected but crucially, tasks do not complete in a lexical manner but as separate groups where sometimes their results must be utilized for further work—with this decision depending on data that is only available after such tasks are being spawned and thus this work happens as a separate task.
This implies it is not feasible to wrap the entire thing in a scope to perform that waiting. The only guaranteed synchronization point is after the lexcial end of the scope. The current situation is that this leads to deadlock: The work coordination happens in the main thread but it can never pick-up any work itself. None of
scope
,scope_fifo
,spawn
can be utilized for this as they either (a) do not wait on the tasks that had been spawn non-lexically or (b) can't 'block' to return a value to the scope.What I'd like to have is an API similar to
Scope
, except I can pre-emptively consume the scope to perform an in-place wait Avoiding a deadlock because the current thread can always be used as a fallback to perform the tasks.The text was updated successfully, but these errors were encountered: