What's the latest state of N:M threads?

Hello,

I was trying to figure out how N:M threads finally works in Rust 1.0. Only thing I was able to find on the Internet was some statement that libgreen had been removed. My question is how N:M threads are implemented in Rust 1.0.

Thanks, Oliver

There is no support in-tree for N:M threading.

1 Like

There isnt support anywhere for it. @alexcrichton has a repo but it has not been updated since the removal, basically.

That's a pitty. Thanks for the information.

Are there any plans for a revival/replacement? CSP aka channels in Go make concurrency so much easier. It's just amazing. I guess you need real green threads to have "true CSP" compared to libgreen and other frameworks based on asynchronous callbacks.

If it helps there is GitHub - rustcc/coroutine-rs: Coroutine Library in Rust and https://github.com/carllerche/mio.

1 Like

Channels are a different feature than N:M threads: channel in std::sync::mpsc - Rust and sync_channel in std::sync::mpsc - Rust

As @Jexell mentions, there is also async IO in those packages.

Finally, while it's true CSP is great, Rust makes shared-memory concurrency safe as well: Fearless Concurrency with Rust | Rust Blog

3 Likes