summaryrefslogtreecommitdiff
path: root/exercises/smart_pointers/arc1.rs
diff options
context:
space:
mode:
authortajo48 <55502906+tajo48@users.noreply.github.com>2023-06-15 00:46:45 +0200
committerGitHub <noreply@github.com>2023-06-15 00:46:45 +0200
commite1704a2f1bd2e1c92e0741d656228fe6ccf36a35 (patch)
tree6bbd1dd1ea127dd652e0fe64093c10a78734fdf5 /exercises/smart_pointers/arc1.rs
parent1e02f194fdd1cb1ca99cf1d93d11455db8b1bce6 (diff)
parent0282da6881c0708b5aaf6a01e731b88b61201f71 (diff)
Merge branch 'main' into main
Diffstat (limited to 'exercises/smart_pointers/arc1.rs')
-rw-r--r--exercises/smart_pointers/arc1.rs19
1 files changed, 11 insertions, 8 deletions
diff --git a/exercises/smart_pointers/arc1.rs b/exercises/smart_pointers/arc1.rs
index ffb306a..3526ddc 100644
--- a/exercises/smart_pointers/arc1.rs
+++ b/exercises/smart_pointers/arc1.rs
@@ -1,21 +1,24 @@
// arc1.rs
-// In this exercise, we are given a Vec of u32 called "numbers" with values ranging
-// from 0 to 99 -- [ 0, 1, 2, ..., 98, 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.
+//
+// In this exercise, we are given a Vec of u32 called "numbers" with values
+// ranging from 0 to 99 -- [ 0, 1, 2, ..., 98, 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.
+//
// The first thread (offset 0), will sum 0, 8, 16, ...
// The second thread (offset 1), will sum 1, 9, 17, ...
// The third thread (offset 2), will sum 2, 10, 18, ...
// ...
// 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. We need to make a change in each of the two TODOs.
-
-
+//
// Make this code compile by filling in a value for `shared_numbers` where the
// first TODO comment is, and create an initial binding for `child_numbers`
-// where the second TODO comment is. Try not to create any copies of the `numbers` Vec!
+// where the second TODO comment is. Try not to create any copies of the
+// `numbers` Vec!
+//
// Execute `rustlings hint arc1` or use the `hint` watch subcommand for a hint.
// I AM NOT DONE