diff --git a/src/concurrency/channels/bounded.md b/src/concurrency/channels/bounded.md index 8d492883e51..da611bee00a 100644 --- a/src/concurrency/channels/bounded.md +++ b/src/concurrency/channels/bounded.md @@ -35,8 +35,8 @@ fn main() { - Calling `send()` will block the current thread until there is space in the channel for the new message. The thread can be blocked indefinitely if there is nobody who reads from the channel. -- A call to `send()` will abort with an error (that is why it returns `Result`) - if the channel is closed. A channel is closed when the receiver is dropped. +- Like unbounded channels, a call to `send()` will abort with an error if the + channel is closed. - A bounded channel with a size of zero is called a "rendezvous channel". Every send will block the current thread until another thread calls [`recv()`]. diff --git a/src/concurrency/channels/unbounded.md b/src/concurrency/channels/unbounded.md index fbf9ef7c347..97de085a8ea 100644 --- a/src/concurrency/channels/unbounded.md +++ b/src/concurrency/channels/unbounded.md @@ -31,3 +31,12 @@ fn main() { ``` [`mpsc::channel()`]: https://doc.rust-lang.org/std/sync/mpsc/fn.channel.html + +
+ +- An unbounded channel will allocate as much space as is necessary to store + pending messages. The `send()` method will not block the calling thread. +- A call to `send()` will abort with an error (that is why it returns `Result`) + if the channel is closed. A channel is closed when the receiver is dropped. + +
diff --git a/src/concurrency/sync-exercises/dining-philosophers.md b/src/concurrency/sync-exercises/dining-philosophers.md index d7aa55f78b6..f36617999b8 100644 --- a/src/concurrency/sync-exercises/dining-philosophers.md +++ b/src/concurrency/sync-exercises/dining-philosophers.md @@ -52,3 +52,12 @@ name = "dining-philosophers" version = "0.1.0" edition = "2021" ``` + +
+ +- Encourage students to focus first on implementing a solution that "mostly" + works. +- The deadlock in the simplest solution is a general concurrency problem and + highlights that Rust does not automatically prevent this sort of bug. + +
diff --git a/src/concurrency/sync-exercises/link-checker.md b/src/concurrency/sync-exercises/link-checker.md index c9248f435d9..46dc2c341c3 100644 --- a/src/concurrency/sync-exercises/link-checker.md +++ b/src/concurrency/sync-exercises/link-checker.md @@ -80,6 +80,15 @@ cargo run `www.google.org` domain. Put an upper limit of 100 pages or so so that you don't end up being blocked by the site. +
+ +- This is a complex exercise and intended to give students an opportunity to + work on a larger project than others. A success condition for this exercise is + to get stuck on some "real" issue and work through it with the support of + other students or the instructor. + +
+ [1]: https://docs.rs/reqwest/ [2]: https://docs.rs/scraper/ [3]: https://docs.rs/thiserror/