summaryrefslogtreecommitdiff
path: root/exercises/19_smart_pointers/arc1.rs
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2024-07-04 11:51:33 +0200
committermo8it <mo8it@proton.me>2024-07-04 12:58:04 +0200
commitdec6772b050bdbc59718ac2a52f6a7752d733bd9 (patch)
tree1189b5d982fbddeda9909457faaefa74e0352c05 /exercises/19_smart_pointers/arc1.rs
parentb4f4c79ac4c9214b77061b7cb969656612c7383f (diff)
Improve the comment of arc1
Diffstat (limited to 'exercises/19_smart_pointers/arc1.rs')
-rw-r--r--exercises/19_smart_pointers/arc1.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/exercises/19_smart_pointers/arc1.rs b/exercises/19_smart_pointers/arc1.rs
index c3d714d..6bb860f 100644
--- a/exercises/19_smart_pointers/arc1.rs
+++ b/exercises/19_smart_pointers/arc1.rs
@@ -1,4 +1,4 @@
-// In this exercise, we are given a `Vec` of u32 called `numbers` with values
+// In this exercise, we are given a `Vec` of `u32` called `numbers` with values
// ranging from 0 to 99. We would like to use this set of numbers within 8
// different threads simultaneously. Each thread is going to get the sum of
// every eighth value with an offset.
@@ -9,8 +9,11 @@
// …
// The eighth thread (offset 7), will sum 7, 15, 23, …
//
-// Because we are using threads, our values need to be thread-safe. Therefore,
-// we are using `Arc`.
+// Each thread should own a reference-counting pointer to the vector of
+// numbers. But `Rc` isn't thread-safe. Therefore, we need to use `Arc`.
+//
+// Don't get distracted by how threads are spawned and joined. We will practice
+// that later in the exercises about threads.
// Don't change the lines below.
#![forbid(unused_imports)]