Scheduling work on a FIFO queue has many advantages. First, it is intuitive: if you push a set of work-item to an executor in a certain order, you expect it to carry it out in that order. Second, it is fair: new tasks cannot prevent old tasks from ever being scheduled.
However, from the point of view of CPU cache locality and in the presence of recursive parallelism (see #27 ), stacks may be more appropriate, as they ensure that new tasks directly follow from old ones. In order to optimize your CPU cache usage, you probably want to finish a parallel quicksort before you move on to the other tasks that were spawned after that.
Thus, we may want to move to double-ended queues for task scheduling, and carefully study the implications of pushing jobs in one direction or another.
Scheduling work on a FIFO queue has many advantages. First, it is intuitive: if you push a set of work-item to an executor in a certain order, you expect it to carry it out in that order. Second, it is fair: new tasks cannot prevent old tasks from ever being scheduled.
However, from the point of view of CPU cache locality and in the presence of recursive parallelism (see #27 ), stacks may be more appropriate, as they ensure that new tasks directly follow from old ones. In order to optimize your CPU cache usage, you probably want to finish a parallel quicksort before you move on to the other tasks that were spawned after that.
Thus, we may want to move to double-ended queues for task scheduling, and carefully study the implications of pushing jobs in one direction or another.