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
Suppose we join task A (fast) and task B (slow) in thread 1, and thread 2 steals task B. After thread 1 finishes task A, it cannot find another job to run, then it waits for task B to be done.
Here's the problem. If new tasks are pushed, thread 1 won't be awakened to steal and execute them. The pool just lost one spare thread util task B finishes.
In the worst case, thread 1 is waiting for a task on thread 2, which is waiting for a task on thread 3.... Eventually all threads are blocked by a slow task and cannot execute new tasks.
It seems like rayon can overcome this issue by some complicated sleep mechanism. rayon-rs/rfcs#5
The text was updated successfully, but these errors were encountered:
Suppose we join task A (fast) and task B (slow) in thread 1, and thread 2 steals task B. After thread 1 finishes task A, it cannot find another job to run, then it waits for task B to be done.
Here's the problem. If new tasks are pushed, thread 1 won't be awakened to steal and execute them. The pool just lost one spare thread util task B finishes.
In the worst case, thread 1 is waiting for a task on thread 2, which is waiting for a task on thread 3.... Eventually all threads are blocked by a slow task and cannot execute new tasks.
It seems like rayon can overcome this issue by some complicated sleep mechanism. rayon-rs/rfcs#5
The text was updated successfully, but these errors were encountered: