A parallel task scheduling system in a multi-threaded computing
environment includes a plurality of parallel task queues. Each task queue
is associated with a respective worker thread from a plurality of worker
threads. Each new task is assigned to one of the task queues. That
assignment process including selecting a random queue and, from that
starting point, locating an empty queue (if one exists). The task is then
placed on that empty queue for processing.Typically, the worker thread
associated with the identified task queue will process the queued task.
If the worker thread is busy processing another task, the queued task may
be stolen by a free thread. A waiting task, can thus be processed in an
efficient manner.