Skip to content

Rename atomic.wake to atomic.notify #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 9, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions _posts/2018-10-24-multithreading-rust-and-wasm.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ of [atomic instructions][atomics]. In Rust parlance this means that
[`AtomicUsize`] and friends will actually compile to atomic operations, whereas
today they're [simply lowered to single-threaded equivalents][wasm-singlethread]
(as there's no threads!). While essential, these aren't too too thrilling just
yet until you hit [`wait` and `wake`][wait-and-wake].
yet until you hit [`wait` and `notify`][wait-and-notify].

Atomic modifications allow us to perform some level of synchronization, but
full synchronization often requires actual blocking of a thread until another is
finished. This is where the `i32.atomic.wait` and `atomic.wake` instructions
finished. This is where the `i32.atomic.wait` and `atomic.notify` instructions
come into play. First we can block a thread (atomically) using
[`i32.atomic.wait`], and then another thread can execute [`atomic.wake`] to wake
[`i32.atomic.wait`], and then another thread can execute [`atomic.notify`] to wake
up a thread blocked on the same address. I believe this is similar to [futexes]
on Linux, although I've never used them myself!

Expand Down Expand Up @@ -632,9 +632,9 @@ Discord](https://discord.gg/6SHrCn), or follow along on GitHub with either
[ray-patches]: https://github.com/alexcrichton/raytracer/compare/master...update-deps
[firefox-spec-bug]: https://bugzilla.mozilla.org/show_bug.cgi?id=1496582
[dlmalloc]: https://github.com/alexcrichton/dlmalloc-rs
[wait-and-wake]: https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md#wait-and-wake-operators
[wait-and-notify]: https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md#wait-and-notify-operators
[`i32.atomic.wait`]: https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md#wait
[`atomic.wake`]: https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md#wake
[`atomic.notify`]: https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md#notify
[`ArrayBuffer`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer
[`Arc`]: https://doc.rust-lang.org/std/sync/struct.Arc.html
[`start`]: http://webassembly.github.io/spec/core/syntax/modules.html#start-function
Expand Down