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

Synchronize with all calls to unpark in id-based thread parker #114591

Merged
merged 1 commit into from
Aug 18, 2023

Conversation

joboet
Copy link
Contributor

@joboet joboet commented Aug 7, 2023

The documentation for thread::park guarantees that "park synchronizes-with all prior unpark operations". In the id-based thread parking implementation, this is not implemented correctly, as the state variable is reset with a simple store, so there will not be a synchronizes-with edge if an unpark happens just before the reset. This PR corrects this, replacing the load-check-reset sequence with a single compare_exchange.

@rustbot
Copy link
Collaborator

rustbot commented Aug 7, 2023

r? @thomcc

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Aug 7, 2023
@thomcc
Copy link
Member

thomcc commented Aug 18, 2023

@bors r+

@bors
Copy link
Contributor

bors commented Aug 18, 2023

📌 Commit fd9fcc5 has been approved by thomcc

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 18, 2023
@bors
Copy link
Contributor

bors commented Aug 18, 2023

⌛ Testing commit fd9fcc5 with merge d06ca0f...

@bors
Copy link
Contributor

bors commented Aug 18, 2023

☀️ Test successful - checks-actions
Approved by: thomcc
Pushing d06ca0f to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 18, 2023
@bors bors merged commit d06ca0f into rust-lang:master Aug 18, 2023
12 checks passed
@rustbot rustbot added this to the 1.73.0 milestone Aug 18, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d06ca0f): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.9% [2.9%, 4.5%] 3
Regressions ❌
(secondary)
3.3% [2.0%, 5.2%] 3
Improvements ✅
(primary)
-4.3% [-4.3%, -4.3%] 1
Improvements ✅
(secondary)
-1.2% [-1.2%, -1.2%] 1
All ❌✅ (primary) 1.9% [-4.3%, 4.5%] 4

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 632.907s -> 633.508s (0.09%)
Artifact size: 347.12 MiB -> 347.19 MiB (0.02%)

@joboet joboet deleted the thread_parking_ordering_fix branch November 30, 2023 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants