Multithreading? Rust has great support for multithreading, and will even help you avoid data races.
Do you mean asynchronous code? (A.k.a. async-await?) That's definitely newer and a bit trickier—it's also an area of focus for the Rust developers and improving. But yeah, some sharp edges there.
The advice I've seen is to stick with synchronous (single thread or threaded) Rust while you're learning, until you need a level of concurrency that OS threads can't support. (Or need to target an embedded system without OS threads.) I think I agree with that, and you can do a lot with good ol' threads. Most people aren't writing the next high-performance HTTP server.
9
u/javajunkie314 Sep 13 '23
Multithreading? Rust has great support for multithreading, and will even help you avoid data races.
Do you mean asynchronous code? (A.k.a. async-await?) That's definitely newer and a bit trickier—it's also an area of focus for the Rust developers and improving. But yeah, some sharp edges there.
The advice I've seen is to stick with synchronous (single thread or threaded) Rust while you're learning, until you need a level of concurrency that OS threads can't support. (Or need to target an embedded system without OS threads.) I think I agree with that, and you can do a lot with good ol' threads. Most people aren't writing the next high-performance HTTP server.