-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Unify id-based thread parking implementations #105903
Conversation
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
9c5d1f9
to
e66142a
Compare
☔ The latest upstream changes (presumably #100539) made this pull request unmergeable. Please resolve the merge conflicts. |
e66142a
to
3076f4e
Compare
@rustbot ready |
…::new` constructor for SGX
@rustbot ready |
Thanks! @bors r+ |
⌛ Testing commit 898302e with merge 3183781d4ab598fabeca6e7bf03ccf4bd5d0e9d2... |
💔 Test failed - checks-actions |
The job Click to see the possible cause of the failure (guessed by this bot)
|
⌛ Testing commit 898302e with merge e119b8e065f0f3f34090daa1c27db2d2793cde8a... |
Yield to rollup @bors retry |
…mpiler-errors Rollup of 9 pull requests Successful merges: - rust-lang#105903 (Unify id-based thread parking implementations) - rust-lang#106232 (CFI: Monomorphize transparent ADTs before typeid) - rust-lang#106248 (Revert "Implement allow-by-default `multiple_supertrait_upcastable` lint") - rust-lang#106286 (Make tidy errors red) - rust-lang#106295 (Extend scraped examples layout GUI test for position of buttons) - rust-lang#106305 ( bootstrap: Get rid of tail_args in stream_cargo) - rust-lang#106310 (Dont use `--merge-base` during bootstrap formatting subcommand) - rust-lang#106314 (Fix panic on `x build --help`) - rust-lang#106317 (Only deduplicate stack traces for good path bugs) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Multiple platforms currently use thread-id-based parking implementations (NetBSD and SGX1). Even though the strategy does not differ, these are duplicated for each platform, as the id is encoded into an atomic thread variable in different ways for each platform.
Since
park
is only called by one thread, it is possible to move the thread id into a separate field. By ensuring that the field is only written to once, before any other threads access it, these accesses can be unsynchronized, removing any restrictions on the size and niches of the thread id.This PR also renames the internal
thread_parker
modules tothread_parking
, as that name now better reflects their contents. I hope this does not add too much reviewing noise.r? @m-ou-se
@rustbot label +T-libs
Footnotes
SOLID supports this as well, I will switch it over in a follow-up PR. ↩