ThreadPool: Synchronize Queue and Workers
Currently there is a race conditions dead lock in the thread pool as described in #226 (closed). This MR attempts to solve this. Please test carefully and extensively.
This fixes #226 (closed)
Edited by Simon Spannagel
Merge request reports
Activity
Filter activity
added bug technical depth labels
- Resolved by Simon Spannagel
- Resolved by Simon Spannagel
added 1 commit
- 656adc07 - ThreadPool: add lock for condition variable run_condition_
added 1 commit
- 9ac9fd72 - ThreadPool: Only notify_all when run_cnt is zero (atomic decrement-and-compare)
added 1 commit
- c28e430d - Replace lock_guard with scoped_lock from C++17
added 98 commits
-
9ac9fd72...0c424937 - 94 commits from branch
master
- 8248d827 - ThreadPool: synchronize queue and thread poll using run_mutex_ and run_cnt_
- a5b5fdbf - ThreadPool: add lock for condition variable run_condition_
- 50a82605 - ThreadPool: Only notify_all when run_cnt is zero (atomic decrement-and-compare)
- 9507c8df - ThreadPool: unlock run_condition_ also when done_ == true (destroying pool)
Toggle commit list-
9ac9fd72...0c424937 - 94 commits from branch
- Resolved by Simon Spannagel
added 1 commit
- cc3096fe - ThreadPool: unlock run_condition_ also when done_ == true (destroying pool)
added 1 commit
- 91915d3d - ModuleManager: no need to set global config twice; adjust log levels
- Resolved by Paul Jean Schutze
I tried to battle-test this and for me it works nicely now. @kwolters any comments on my last addition, and maybe a sign-off?
😇
added 1 commit
- b5fd9f03 - ThreadPool: also lock run mutex before invalidating queue
mentioned in commit ddbb6244
Please register or sign in to reply