2 ms·
Some of the concurrency mechanisms are built from scratch today. For example, pipes (the new channel communication layer) are entirely written in bare Rust, wit
by pcwalton 14y ago
Some of the concurrency mechanisms are built from scratch today. For example, pipes (the new channel communication layer) are entirely written in bare Rust, with no C++ at all. They use atomic operations: https://github.com/mozilla/rust/blob/master/src/libcore/pipes.rs https://github.com/mozilla/rust/blob/master/src/libcore/pipe...
Other interesting parts of the runtime that are built using Rust are task spawning (lots of locks): https://github.com/mozilla/rust/blob/master/src/libcore/task/spawn.rs https://github.com/mozilla/rust/blob/master/src/libcore/task...
And implementations of mutexes: https://github.com/mozilla/rust/blob/master/src/libcore/private.rs https://github.com/mozilla/rust/blob/master/src/libcore/priv...
The current plan is to implement the entire runtime in Rust itself. That includes the userland scheduler. So we will need all the low-level OS primitive mutexes, condition variables, pthread infrastructure, etc. There's no reason we can foresee why this would be particularly difficult; the only reason why it wasn't done this way from the start is for bootstrapping reasons.