ext-pmmpthread
ext-pmmpthread copied to clipboard
Worker::unstack() removes tasks from the wrong end of the queue
Contrary to intuitively expected behaviour, unstack() actually removes tasks from the front of the queue, rather than the back.
This is a problem for task executions that expect to have state set up by tasks that preceded them, because the earlier tasks might not have actually executed due to the tasks being dequeued and not executed.
Side note: The entire terminology for Worker is wrong. Stacks are a FILO data structure, which implies that tasks stack()ed will be executed before any other tasks on the queue. This is completely wrong. The correct terminology would be enqueue() and dequeue().