Skip to content

Commit a8d3384

Browse files
committed
Update concurrency post to mention current state of scoped threads
1 parent 735345f commit a8d3384

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

_posts/2015-04-10-Fearless-Concurrency.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ fn use_lock(mutex: &Mutex<Vec<i32>>) {
377377
let vec = access(&mut guard);
378378

379379
// vec has type `&mut Vec<i32>`
380-
vec.push(3);
380+
vec.push(3);sc
381381

382382
// lock automatically released here, when `guard` is destroyed
383383
}
@@ -475,6 +475,12 @@ Disaster averted.
475475

476476
### Sharing the stack: "scoped"
477477

478+
_Note: The API mentioned here is an old one which has been moved out of
479+
the standard library. You can find equivalent functionality in
480+
[`crossbeam`][crossbeam-crate] ([documentation for `scope()`][crossbeam-doc])
481+
and [`scoped_threadpool`][scoped-threadpool-crate]
482+
([documentation for `scoped()`][scoped-threadpool-doc])_
483+
478484
So far, all the patterns we've seen involve creating data structures
479485
on the heap that get shared between threads. But what if we wanted to
480486
start some threads that make use of data living in our stack frame?
@@ -611,3 +617,7 @@ months. Stay tuned!
611617
[scoped]: http://static.rust-lang.org/doc/master/std/thread/fn.scoped.html
612618
[syncbox]: https://github.com/carllerche/syncbox
613619
[simple_parallel]: https://github.com/huonw/simple_parallel
620+
[crossbeam-crate]: https://crates.io/crates/crossbeam
621+
[crossbeam-doc]: http://aturon.github.io/crossbeam-doc/crossbeam/fn.scope.html
622+
[scoped-threadpool-crate]: https://crates.io/crates/scoped_threadpool
623+
[scoped-threadpool-doc]: http://kimundi.github.io/scoped-threadpool-rs/scoped_threadpool/index.html#examples:

0 commit comments

Comments
 (0)