Commit Graph

8 Commits

Author SHA1 Message Date
Drew Lewis b3458485ba
Dont spin main for queue (#443)
* Use DynamicLatch in DispatchQueue to avoid main thread spinning

Replace the busy-yielding pending_task_count_ loop in DispatchQueue::finishTasks
with a blocking DynamicLatch. This avoids having the main thread consume CPU
cycles while waiting for dispatched tasks to complete.

The DynamicLatch implementation uses C++20 std::atomic::wait/notify_all for
efficient blocking and wakeup, with proper release-acquire semantics to ensure
task results are visible to the waiting thread.

* Reformat DynamicLatch to match DispatchQueue style

* Update attribution headers in DispatchQueue files to note modifications
2026-06-06 16:45:46 -07:00
James Cherry 63efee64bf tidy round1 2026-04-13 14:59:05 -07:00
Ethan Mahintorabi 7ac4a47db1
util: Add method to get thread count from dispatch queue (#324)
I'm looking to try to have unified thread pool with OpenSTA and OpenROAD
and having this method would make it easier to understand how much
parallelism is available in the pool.

Signed-off-by: Ethan Mahintorabi <ethanmoon@google.com>
2025-12-12 15:49:22 -08:00
Drew Lewis daeea4ab7e
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>
2025-10-12 14:11:21 -07:00
James Cherry 3c2e7951f3 set_thread_count
Signed-off-by: James Cherry <cherry@parallaxsw.com>
2024-06-20 13:08:29 -07:00
James Cherry ee326f165c public headers in include/sta 2020-04-05 14:53:44 -07:00
James Cherry 804953e317 mv public headers to include/sta 2020-04-05 11:35:51 -07:00
James Cherry e647ed391d dispatch queue for thread support 2019-11-11 08:48:27 -07:00