File tree Expand file tree Collapse file tree 4 files changed +29
-2
lines changed Expand file tree Collapse file tree 4 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -35,8 +35,8 @@ fn main() {
35
35
- Calling ` send() ` will block the current thread until there is space in the
36
36
channel for the new message. The thread can be blocked indefinitely if there
37
37
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.
40
40
- A bounded channel with a size of zero is called a "rendezvous channel". Every
41
41
send will block the current thread until another thread calls [ ` recv() ` ] .
42
42
Original file line number Diff line number Diff line change @@ -31,3 +31,12 @@ fn main() {
31
31
```
32
32
33
33
[ `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 >
Original file line number Diff line number Diff line change @@ -52,3 +52,12 @@ name = "dining-philosophers"
52
52
version = " 0.1.0"
53
53
edition = " 2021"
54
54
```
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 >
Original file line number Diff line number Diff line change @@ -80,6 +80,15 @@ cargo run
80
80
` www.google.org ` domain. Put an upper limit of 100 pages or so so that you
81
81
don't end up being blocked by the site.
82
82
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
+
83
92
[ 1 ] : https://docs.rs/reqwest/
84
93
[ 2 ] : https://docs.rs/scraper/
85
94
[ 3 ] : https://docs.rs/thiserror/
You can’t perform that action at this time.
0 commit comments