Skip to content
Snippets Groups Projects

ThreadPool: Synchronize Queue and Workers

Merged Simon Spannagel requested to merge fix_threadpool into master

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

Pipeline #3790217 passed

Pipeline passed for b5fd9f03 on fix_threadpool

Test coverage 65.00% (0.00%) from 1 job

Merged by Paul Jean SchutzePaul Jean Schutze 2 years ago (Apr 1, 2022 8:47am UTC)

Loading

Pipeline #3791025 passed

Pipeline passed for ddbb6244 on master

Test coverage 65.00% (0.00%) from 1 job

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • added 1 commit

    • 656adc07 - ThreadPool: add lock for condition variable run_condition_

    Compare with previous version

  • added 1 commit

    • 9ac9fd72 - ThreadPool: Only notify_all when run_cnt is zero (atomic decrement-and-compare)

    Compare with previous version

  • added 1 commit

    • c28e430d - Replace lock_guard with scoped_lock from C++17

    Compare with previous version

  • Simon Spannagel resolved all threads

    resolved all threads

  • Simon Spannagel added 98 commits

    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)

    Compare with previous version

  • added 1 commit

    • cc3096fe - ThreadPool: unlock run_condition_ also when done_ == true (destroying pool)

    Compare with previous version

  • Simon Spannagel changed the description

    changed the description

  • added 1 commit

    • 91915d3d - ModuleManager: no need to set global config twice; adjust log levels

    Compare with previous version

  • Koen Wolters approved this merge request

    approved this merge request

  • added 1 commit

    • b5fd9f03 - ThreadPool: also lock run mutex before invalidating queue

    Compare with previous version

  • Simon Spannagel resolved all threads

    resolved all threads

  • Paul Jean Schutze resolved all threads

    resolved all threads

  • Paul Jean Schutze approved this merge request

    approved this merge request

  • mentioned in commit ddbb6244

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading