-
Notifications
You must be signed in to change notification settings - Fork 349
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
Implement basic support for concurrency (Linux/macos only) #1284
Conversation
Thanks a lot, the high-level picture sounds great. :D It may be a week or two until I get around to review this, though. In particular, #1157 is ahead of this in the queue, so I expect you will have to rebase across it. And it sounds relevant; indeed this PR has to do something reasonable with the synchronization primitives on all platforms that can now spawn threads (and it should add suitable assertions to other platforms to make sure we don't accidentally spawn threads but then fail to correctly implement the locks). |
Another shim that might need adjustment is the one that returns the stack base address. I suppose it would be weird if all threads have the same base... |
I forgot to mention that this PR also depends on rust-lang/rust#70597. Without that PR, Miri complains about an aliasing violation. |
☔ The latest upstream changes (presumably #1299) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #1157) made this pull request unmergeable. Please resolve the merge conflicts. |
I am probably missing some feature of git: is there a way to rebase the PR without using |
I don't think so -- I guess I was saying "please don't rebase". Let's wait until reviews is done before resolving conflicts. |
These are the last things, that I just noticed when randomly looking at a few changed files again. Once these are fixed, I'll r+. :-) |
All right, no point in turning around every line of code 5 times. Let's land this. @vakaras thank you so much for contributing this and working with us through the review process. This is probably the biggest single addition to Miri ever, and certainly the biggest first-time contribution. :D @bors r+ |
📌 Commit 48da0cf has been approved by |
☀️ Test successful - checks-travis, status-appveyor |
Perfect. ☺ I will go and rebase #1362 so that it is ready for review. Should be ready for review by tomorrow. |
I'm so wildly excited for this! Can't wait to enable it on things like |
Changes (most new code is in
src/threads.rs
andsrc/shims/foreign_items/posix.rs
):Machine
to a newly createdThread
struct.ThreadSet
struct that manages the threads.canonical_alloc_id
to create a unique allocation id for each thread local and thread (the responsible struct isThreadLocalStorage
)This pull request depends on these changes to the compiler.