pika
pika copied to clipboard
Attempt to add a faster path for getting the next thread from unstaged queue
Currently, if the queue of pending threads is empty on a worker thread, get_next_thread
returns, the scheduler goes to add new threads from the staged to pending threads, and then calls get_next_thread
again, knowing that it know (with very high probability) has a pending thread to return. This roundtrip probably adds latency. Try to make get_next_thread
directly move a thread from staged to pending when it runs out of pending threads and measure the difference.