4 ms·
> In the language and/or the standard library? In Rust, we have extremely strong concurrency support in the language/standard library in the form of our type s
by steveklabnik 10y ago
> In the language and/or the standard library?
In Rust, we have extremely strong concurrency support in the language/standard library in the form of our type system, which disallows data races at compile time. We only provide 1:1 threading, but libraries can use this type system to extend it: there's N:M threading libraries, as well as more exotic concurrency stuff than we provide directly. Rust also generally takes a "no batteries included" approach, generally speaking.
In Ruby, there's Thread and Fiber. MRI's GIL hurts it here, but other implementations don't have this problem.
- ngrilly 10y agoCan you provide links to the Rust N:M threading libraries you recommend? How is the stack managed in these libraries (does it start small and is resized at runtime)? Same question for Ruby :-)
- steveklabnik 10y agohttps://crates.io/crates/mioco https://crates.io/crates/mioco https://crates.io/crates/coroutine https://crates.io/crates/coroutine I don't know much about the details, as I haven't used them myself, I just know they exist. http://ruby-doc.org/core-2.2.0/Thread.html http://ruby-doc.org/core-2.2.0/Thread.html http://ruby-doc.org/core-2.2.0/Fiber.html http://ruby-doc.org/core-2.2.0/Fiber.html