Open fogti opened 4 months ago
concurrent-queue
is ill-suited for this purpose. My plan was to use a dedicated work-stealing queue like crossbeam-deque
.
I just attempted this and crossbeam-deque requires an additional function on their Worker or Stealer that supports checking if they're pointing to the same underlying queue (like Arc::ptr_eq) or we risk having a worker steal from itself or failing to remove stealers when dropping a Runner.
It appears that a large amount of time in
async-executor
is spent shuffling around tasks between different queues. It would be interesting if there are ways to make such stealing of half of a queue faster, perhaps by making such a function part of this crate and utilize knowledge about internals to make such "mass-moves" faster.