Concurrency in Rust
doc.rust-lang.org
Concurrency in Rust
1–10 of 160 posts
Re: Concurrency in Rust
#2I think Steve Klabnik could clarify this, but the book at that link is in the process of being rewritten. I think it might be good to wait until it is. I personally found it slightly difficult to follow compared to other options like the soon to be published Programming Rust.
Re: Concurrency in Rust
#3For a more in-depth explanation of how Send and Sync work theoretically, see http://manishearth.github.io/blog/2015/05/30/how-rust-achiev... or http://huonw.github.io/blog/2015/02/some-notes-on-send-and-s...
Re: Concurrency in Rust
#4I'm having a tough time trying to understand this snippet
for i in 0..3 {
thread::spawn(move || {
data[i] += 1;
});
}
What is the 'move' thing here before the ||Re: Concurrency in Rust
#5I'm having a tough time trying to understand this snippet for i in 0..3 { thread::spawn(move || { data[i] += 1; }); } What is the 'move' thing here before the ||
A quick search turned up this: https://doc.rust-lang.org/book/closures.html#move-closures.
Re: Concurrency in Rust
#6Does Rust have a way to work with SIMD concurrency as opposed to just fork/join concurrency? Something along the lines of how openmp or cilk let you do a parallel for all?
Re: Concurrency in Rust
#7I'm having a tough time trying to understand this snippet for i in 0..3 { thread::spawn(move || { data[i] += 1; }); } What is the 'move' thing here before the ||
A move closure takes copies of the environment, instead of mutating the parent environment.
Re: Concurrency in Rust
#8What about the assumption (fatally flawed decision?) that malloc never fails when rust asks? Sounds like something that could affect concurrency
Re: Concurrency in Rust
#9Does Rust have a way to work with SIMD concurrency as opposed to just fork/join concurrency? Something along the lines of how openmp or cilk let you do a parallel for all?
You seem to have concurrency confused with parallelism. Concurrency just means working on another task before the prior one has completed. You're describing parallelism which is doing multiple tasks at the same time.
Re: Concurrency in Rust
#10Does Rust have a way to work with SIMD concurrency as opposed to just fork/join concurrency? Something along the lines of how openmp or cilk let you do a parallel for all?
A simple google search would have told you that there is work being done the introduce simd in Rust. There appear to be some basics there right now but not much if i understood my quick search.