4 ms·
Disclaimer: I've done some reading on Rust's concepts but not yet done any substantial coding. Corrections welcome :) I'm not informed enough to comment on how
by btschaegg 7y ago
Disclaimer: I've done some reading on Rust's concepts but not yet done any substantial coding. Corrections welcome :)
I'm not informed enough to comment on how async works exactly in Rust. However:
> If rust does not allow concurrent memory reads, then that's a big problem in my world.
Note that this is not the goal of the borrow checking system of Rust. You can read memory concurrently just fine (given immutable references to something), you're just not allowed to write to it while you're doing that.
Basically, references in Rust come as immutable (like `const` in C) and mutable, and you're only allowed to have multiple immutable or one mutable reference to the same thing at a time. If you have a mutable reference, you can derive multiple immutable ones from that, but the borrow checker will prevent you from accessing the mutable reference as long as one of the immutable ones is still active (which Rust manages with the concept of "lifetimes").