Skip to content

Conversation

beepster4096
Copy link
Contributor

@beepster4096 beepster4096 commented Jun 13, 2022

This PR adds support for threads on Windows.

@beepster4096 beepster4096 force-pushed the winfred branch 2 times, most recently from a8f777b to ecdcbd0 Compare June 13, 2022 05:20
@beepster4096
Copy link
Contributor Author

Whoops, I messed up the rebase at first.

Copy link
Contributor

@oli-obk oli-obk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to run ./miri bless, too, in order to update the .stderr files. You may have to run this for multiple targets to make sure they're all in sync in their behaviour

@ChrisDenton
Copy link
Member

Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Jun 14, 2022
…hrisDenton

Fix compat_fn option method on miri

This change is required to make `WaitOnAddress` work with rust-lang/miri#2231
@beepster4096
Copy link
Contributor Author

I've rewritten the handle implementation based on what is actually guaranteed by the windows docs

Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Jun 14, 2022
…hrisDenton

Fix compat_fn option method on miri

This change is required to make `WaitOnAddress` work with rust-lang/miri#2231
@RalfJung
Copy link
Member

If it helps, here are some public resources on HANDLEs:

To the extent that these are relevant for this new code in Miri, please add links to them in comments in the code. :)

@bors
Copy link
Contributor

bors commented Jun 16, 2022

☔ The latest upstream changes (presumably #2236) made this pull request unmergeable. Please resolve the merge conflicts.

@RalfJung
Copy link
Member

Thanks for the PR! Looks like Windows is starting to catch up with our Linux support. :)

I am working on a review, but in the future it'd be helpful to break PRs into smaller chunks. For example, I think this could have started with just thread spawning and joining, without all the concurrency primitives. Smaller PRs are a lot easier to review so any effort you can put into splitting a change into chunks is much appreciated.

Copy link
Member

@RalfJung RalfJung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great overall, very nice!

I hope all the new code you added is actually covered by tests. For thread spawning and the synchronization primitives, I would think the existing sync tests are enough, though I do not know if the stdlib actually uses these primitives.

I did not see a test that would join on a thread with a timeout, so that will have to be added (or the code for that be removed again). Also there are no new failing tests, which is a bit of a concern given that the pthreads primitives have a lot of failing tests to ensure that misuse of the pthread APIs is detected.

@bors
Copy link
Contributor

bors commented Jul 8, 2022

☔ The latest upstream changes (presumably #2332) made this pull request unmergeable. Please resolve the merge conflicts.

@RalfJung
Copy link
Member

RalfJung commented Jul 9, 2022

Looking at your commits, I see "basic threading" and "condvar, parking and yielding" are separate commits. If you could split those into separate PRs, that would help a lot with reviewing.

Basically the first PR just needs to get concurrency/{simple,thread_local,tls*}.rs to work. That should be possible without new synchronization code I hope?

@RalfJung
Copy link
Member

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: Waiting for the PR author to address review comments and removed S-waiting-on-review Status: Waiting for a review to complete labels Aug 14, 2022
@beepster4096 beepster4096 force-pushed the winfred branch 2 times, most recently from 8a6c1f8 to f010307 Compare August 14, 2022 04:32
@beepster4096
Copy link
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Waiting for a review to complete and removed S-waiting-on-author Status: Waiting for the PR author to address review comments labels Aug 14, 2022
@RalfJung
Copy link
Member

Just two more comment nits, then we are good to go. :) Since review is done, please squash the commits together a bit.

@RalfJung
Copy link
Member

@rustbot author

@bors
Copy link
Contributor

bors commented Aug 18, 2022

☔ The latest upstream changes (presumably #2492) made this pull request unmergeable. Please resolve the merge conflicts.

@beepster4096
Copy link
Contributor Author

@rustbot ready

@RalfJung
Copy link
Member

Awesome, thanks a ton for all your work and patience. :)

@bors r+

@bors
Copy link
Contributor

bors commented Aug 18, 2022

📌 Commit c466ac0 has been approved by RalfJung

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Aug 18, 2022

⌛ Testing commit c466ac0 with merge 46da748...

@bors
Copy link
Contributor

bors commented Aug 18, 2022

☀️ Test successful - checks-actions
Approved by: RalfJung
Pushing 46da748 to master...

@bors bors merged commit 46da748 into rust-lang:master Aug 18, 2022
workingjubilee pushed a commit to tcdi/postgrestd that referenced this pull request Sep 15, 2022
Fix compat_fn option method on miri

This change is required to make `WaitOnAddress` work with rust-lang/miri#2231
bors added a commit that referenced this pull request Nov 6, 2022
Implement condvars for Windows

Adds 3 shims for Windows: `SleepConditionVariableSRW`, `WakeConditionVariable`, `WakeAllConditionVariable` to add support for condvars (which fixes #2628).

Salvaged from what was removed from #2231
RalfJung pushed a commit to RalfJung/miri that referenced this pull request Nov 15, 2022
Implement condvars for Windows

Adds 3 shims for Windows: `SleepConditionVariableSRW`, `WakeConditionVariable`, `WakeAllConditionVariable` to add support for condvars (which fixes rust-lang#2628).

Salvaged from what was removed from rust-lang#2231
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Waiting for a review to complete
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants