-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* BarrierSemaphore failed to handle spurious wakeups correctly. In particular, a spurious wakeup in BarrierSemaphore::down() could result in an early termination from requestWork() since one thread could decrease the semaphore's counter multiple times thereby activating the barrier condition although not all threads are blocked. * Drop unecessary BarrierSemaphore in favor of two specific wait ops on a shared condition variable and a wait counter. On sync reqeusts, waitSync() is used to wait until the sync flag is no longer set. When a thread needs work, it calls waitWork() waiting until the work queue becomes non-empty. In either case, the wait fails if the caller is the last non-waiting thread. Since all waits are now coupled to a specific condition, spurious wakeups are benign.
- Loading branch information
Benjamin Kaufmann
committed
Jul 24, 2022
1 parent
b0b2e0c
commit febd72e
Showing
1 changed file
with
76 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters