-
Notifications
You must be signed in to change notification settings - Fork 177
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
First draft at concurrency chapter #49
Conversation
This is high quality content. Hats off! I am wondering about one point: The mutex-inside-critical-section example confuses me a bit. In a single-core scenario, it doesn't make much sense, because a critical section is already enough to keep the only contender for the shared data away? In a multi-core example, we could still get weird behavior if one core currently holds the lock when the other core in an ISR tries to lock it. Maybe I am missing something here? |
Thanks! In the single-core case, the mutex is really only ensuring you are in fact inside a critical section - it doesn't have its own state or concept of being locked or any other overhead. Really all it's doing is only letting you borrow its contents if you can give it a In a multi-core scenario the |
I was just asking because the introduction speaks about multi-core. Would it help to set the scope for each of the examples (single or multi or both) so that the reader can differentiate? |
Good idea, I'll add a note that the |
@andre-richter I've added some notes about multiple cores. Good observation: it's lead to needing to also note that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome. This is an excellent read now.
Shall we bors this @adamgreig ? |
I've just had a typo pointed out so give me a moment to fix that... |
9d3594b
Okay, fixed, if you're happy then go ahead and bors. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bors r+
49: First draft at concurrency chapter r=andre-richter a=adamgreig I've mostly focused on building up to safely sharing peripherals, without very much focus on RTFM or higher level things like an RTOS, since I don't think there's very much we can usefully say about them at the moment. Very happy to be told I'm wrong on that front though! Closes #7. r? @rust-embedded/resources Co-authored-by: Adam Greig <adam@adamgreig.com>
Build succeeded |
49: First draft at concurrency chapter r=andre-richter a=adamgreig I've mostly focused on building up to safely sharing peripherals, without very much focus on RTFM or higher level things like an RTOS, since I don't think there's very much we can usefully say about them at the moment. Very happy to be told I'm wrong on that front though! Closes rust-embedded#7. r? @rust-embedded/resources Co-authored-by: Adam Greig <adam@adamgreig.com>
I've mostly focused on building up to safely sharing peripherals, without very much focus on RTFM or higher level things like an RTOS, since I don't think there's very much we can usefully say about them at the moment. Very happy to be told I'm wrong on that front though!
Closes #7.
r? @rust-embedded/resources