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


#1

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


#2

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


#3

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


#4

That’s a pitty. Thanks for the information.


#5

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.


#6

If it helps there is https://github.com/rustcc/coroutine-rs and https://github.com/carllerche/mio.


#7

Channels are a different feature than N:M threads: http://doc.rust-lang.org/stable/std/sync/mpsc/fn.channel.html and http://doc.rust-lang.org/stable/std/sync/mpsc/fn.sync_channel.html

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: http://blog.rust-lang.org/2015/04/10/Fearless-Concurrency.html