Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use binary_semaphore instead of condition_variable for synchronizing in sync_wait #1206

Merged
merged 1 commit into from
Jul 26, 2024

Conversation

msimberg
Copy link
Contributor

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.

@msimberg msimberg added this to the 0.27.0 milestone Jul 24, 2024
@msimberg msimberg self-assigned this Jul 24, 2024
Copy link

codacy-production bot commented Jul 24, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-0.10% (target: -1.00%) 0.00% (target: 90.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (c799a97) 18376 13737 74.76%
Head commit (e5ff06a) 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: <coverage of head commit> - <coverage of common ancestor commit>

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: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences


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

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

@msimberg msimberg force-pushed the sync-wait-binary-semaphore branch 2 times, most recently from 393ba06 to b2f81fd Compare July 25, 2024 07:32
@msimberg msimberg force-pushed the sync-wait-binary-semaphore branch from b2f81fd to e5ff06a Compare July 26, 2024 07:39
@msimberg msimberg enabled auto-merge July 26, 2024 07:39
@msimberg msimberg added this pull request to the merge queue Jul 26, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 26, 2024
@msimberg msimberg merged commit 6668cdf into pika-org:main Jul 26, 2024
36 of 39 checks passed
@msimberg msimberg deleted the sync-wait-binary-semaphore branch July 26, 2024 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Archive
Development

Successfully merging this pull request may close these issues.

2 participants