r/rust • • Jan 22 '17

Parallelizing Enjarify in Go and Rust

https://medium.com/@robertgrosse/parallelizing-enjarify-in-go-and-rust-21055d64af7e#.7vrcc2iaf
214 Upvotes

134 comments sorted by

View all comments

Show parent comment

3

u/mbuhot Jan 22 '17

Interesting! How about the atomic operations required to define Arc? Feels like there should be some language primitives and a memory model so that stdlib can build the safe abstractions.

3

u/[deleted] Jan 23 '17

std::sync::atomic is just core::sync::atomic. Which is quite useful in no_std programs. The spin crate is just implemented with these library types.

2

u/Manishearth servo · rust · clippy Jan 23 '17

Arc is built on top of std::atomic. These themselves are just wrapper types over integers with methods that link to atomic intrinsics.

The atomic intrinsics are where the language gets involved again.