work_stealing_deque::push_bottom() currently calls abort() when the local deque reaches its fixed capacity.
This means sufficiently deep nested parallelism can terminate the whole program even though execution could safely fall back to sequential execution.
One possible fix is:
- Change
push_bottom() to return an additional success flag(pair<bool, bool>), which is false when the scheduler queue overflows.
- Propagate this flag through
scheduler::spawn.
- In
pardo(), if spawning the right task fails, execute left and then execute right directly on the current worker, and return.
work_stealing_deque::push_bottom()currently callsabort()when the local deque reaches its fixed capacity.This means sufficiently deep nested parallelism can terminate the whole program even though execution could safely fall back to sequential execution.
One possible fix is:
push_bottom()to return an additional success flag(pair<bool, bool>), which is false when the scheduler queue overflows.scheduler::spawn.pardo(), if spawning the right task fails, execute left and then execute right directly on the current worker, and return.