2 ms·
I believe it's correct that that can be "said for most languages". Since you're asking, Rust's ownership/type system, for example, has checks in place that pre
by pizza234 6y ago
I believe it's correct that that can be "said for most languages".
Since you're asking, Rust's ownership/type system, for example, has checks in place that prevent at least some classes of concurrency errors.
For example, you can't directly modify a variable from multiple threads, due to the so-called "move" rules:
let mut myvar = vec![];
thread::spawn(move || {
myvar.push(1);
});
myvar.push(1); // can't do this; variable has been moved