mirror of
https://github.com/The-OpenROAD-Project/OpenSTA.git
synced 2026-05-30 00:24:12 +08:00
Change DispatchQueue::dispatch to use notify_one. (#308)
This prevents the thundering herd problem and should increase the
scalability of the DispatchQueue significantly.
Additionally the code the DispatchQueue was taken from made this
improvement five years ago:
79ad8a539d
Signed-off-by: Drew Lewis <cannada@google.com>
This commit is contained in:
@@ -66,7 +66,7 @@ DispatchQueue::dispatch(const fp_t& op)
|
||||
// Manual unlocking is done before notifying, to avoid waking up
|
||||
// the waiting thread only to block again (see notify_one for details)
|
||||
lock.unlock();
|
||||
cv_.notify_all();
|
||||
cv_.notify_one();
|
||||
}
|
||||
|
||||
void
|
||||
@@ -79,7 +79,7 @@ DispatchQueue::dispatch(fp_t&& op)
|
||||
// Manual unlocking is done before notifying, to avoid waking up
|
||||
// the waiting thread only to block again (see notify_one for details)
|
||||
lock.unlock();
|
||||
cv_.notify_all();
|
||||
cv_.notify_one();
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user