-
Notifications
You must be signed in to change notification settings - Fork 8
Consider providing an option to steal more than one item #4
Comments
For reference, here's the batched steal function in Go's scheduler: I'm unsure whether Go uses the Chase-Lev deque (there's no mention of "Chase-Lev"), but the code looks very similar. There was previously some discussion on steal-half in crossbeam-rs/crossbeam#148 @jeehoonkang Are we still facing any unsolved challenges with regards to correctness of steal-half? What's the current of your |
Go's scheduler is using bounded circular buffer for fairness. Actually, In the mean time, my colleague @hans89 is reviewing and significantly improving the proof for (original) Chase-Lev deque. I hope we can merge the RFC soon. The proof for half-stealing deque is not that different from that for original deque. It can be useful for Rayon, which doesn't care the fairness of jobs. |
Would it be difficult to add a I'd be willing to help if you're busy. Except I don't know how to do steal-half correctly yet... (we've hit a roadblack last time in crossbeam-rs/crossbeam#148) :) |
If |
I just added @carllerche I think |
@jeehoonkang Ooops, I just saw this comment. I can try soon. Also, feel free to ping me on IRC / Gitter if I don't respond in a timely fashion. |
@jeehoonkang I'm working on a large change to the thread pool (see here: tokio-rs/tokio#317). Once I am done with that, I will try out the circlebuf. I'm really interested in using it because it is more suited and because there are no fences and it will make tsan happier :) |
In cases like Tokio (and Go), it is ideal to be able to steal more than one item at a time. I believe that ideally, the Tokio thread pool would like to steal half of a deque at a time. This is also what Go's scheduler does.
The text was updated successfully, but these errors were encountered: