pika-org / pika

pika builds on C++ std::execution with fiber, CUDA, HIP, and MPI support.
https://pikacpp.org
Boost Software License 1.0
62 stars 10 forks source link

Use `binary_semaphore` instead of `condition_variable` for synchronizing in `sync_wait` #1206

Closed msimberg closed 1 month ago

msimberg commented 1 month ago

Using a binary semaphore removes the need for keeping a mutex and atomic boolean alongside the condition variable. The lock and boolean are effectively moved inside the binary semaphore. As sync_wait is called rarely this is unlikely to actually improve performance, but if nothing else the version with a binary semaphore is noticeably simpler.

codacy-production[bot] commented 1 month ago

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
:white_check_mark: -0.10% (target: -1.00%) :x: 0.00% (target: 90.00%)
Coverage variation details | | Coverable lines | Covered lines | Coverage | | ------------- | ------------- | ------------- | ------------- | | Common ancestor commit (c799a97de0f6e444955d6d48615e7c60baf941e0) | 18376 | 13737 | 74.76% | | | Head commit (e5ff06a573d882033e4276969ea0e28ad0e70e2b) | 18376 (+0) | 13719 (-18) | 74.66% (**-0.10%**) | **Coverage variation** is the difference between the coverage for the head and common ancestor commits of the pull request branch: ` - `
Diff coverage details | | Coverable lines | Covered lines | Diff coverage | | ------------- | ------------- | ------------- | ------------- | | Pull request (#1206) | 1 | 0 | **0.00%** | **Diff coverage** is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: `/ * 100%`

See your quality gate settings    Change summary preferences


:rocket: Don’t miss a bit, follow what’s new on Codacy.

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more