Fix stack overflow bug in the task system (#1583)
* Turn each task queue in the task system into a finite set of queues of increasing priority. The number of queues is a compile-time constant, currently two.
* When a task of priority higher than that of the highest priority queue is scheduled, execute it synchronously.
* When scheduling tasks in a task group, use a priority one higher than that of the calling task; when waiting on the task group, work only on tasks with this priority or higher. This is sufficient to avoid the deep recursion issue seen in issue #1570.
Fixes #1570.
Co-authored-by:
Sam Yates <yates@cscs.ch>
Showing
- arbor/threading/threading.cpp 100 additions, 44 deletionsarbor/threading/threading.cpp
- arbor/threading/threading.hpp 211 additions, 42 deletionsarbor/threading/threading.hpp
- test/ubench/task_system.cpp 24 additions, 4 deletionstest/ubench/task_system.cpp
- test/unit/test_thread.cpp 274 additions, 84 deletionstest/unit/test_thread.cpp
Please register or sign in to comment