Skip to content

Commit 380dc3c

Browse files
authored
Add speaker notes to some concurrency pages (#2501)
Part of #1083.
1 parent e0fa410 commit 380dc3c

File tree

4 files changed

+29
-2
lines changed

4 files changed

+29
-2
lines changed

src/concurrency/channels/bounded.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ fn main() {
3535
- Calling `send()` will block the current thread until there is space in the
3636
channel for the new message. The thread can be blocked indefinitely if there
3737
is nobody who reads from the channel.
38-
- A call to `send()` will abort with an error (that is why it returns `Result`)
39-
if the channel is closed. A channel is closed when the receiver is dropped.
38+
- Like unbounded channels, a call to `send()` will abort with an error if the
39+
channel is closed.
4040
- A bounded channel with a size of zero is called a "rendezvous channel". Every
4141
send will block the current thread until another thread calls [`recv()`].
4242

src/concurrency/channels/unbounded.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,12 @@ fn main() {
3131
```
3232

3333
[`mpsc::channel()`]: https://doc.rust-lang.org/std/sync/mpsc/fn.channel.html
34+
35+
<details>
36+
37+
- An unbounded channel will allocate as much space as is necessary to store
38+
pending messages. The `send()` method will not block the calling thread.
39+
- A call to `send()` will abort with an error (that is why it returns `Result`)
40+
if the channel is closed. A channel is closed when the receiver is dropped.
41+
42+
</details>

src/concurrency/sync-exercises/dining-philosophers.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,12 @@ name = "dining-philosophers"
5252
version = "0.1.0"
5353
edition = "2021"
5454
```
55+
56+
<details>
57+
58+
- Encourage students to focus first on implementing a solution that "mostly"
59+
works.
60+
- The deadlock in the simplest solution is a general concurrency problem and
61+
highlights that Rust does not automatically prevent this sort of bug.
62+
63+
</details>

src/concurrency/sync-exercises/link-checker.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,15 @@ cargo run
8080
`www.google.org` domain. Put an upper limit of 100 pages or so so that you
8181
don't end up being blocked by the site.
8282

83+
<details>
84+
85+
- This is a complex exercise and intended to give students an opportunity to
86+
work on a larger project than others. A success condition for this exercise is
87+
to get stuck on some "real" issue and work through it with the support of
88+
other students or the instructor.
89+
90+
</details>
91+
8392
[1]: https://docs.rs/reqwest/
8493
[2]: https://docs.rs/scraper/
8594
[3]: https://docs.rs/thiserror/

0 commit comments

Comments
 (0)