Live data from Hacker News

Concurrency in Rust

doc.rust-lang.org

1–10 of 160 posts

Re: Concurrency in Rust

#2
I 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

#4
I'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

#6
Does 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

#7
post #4

I'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.

https://doc.rust-lang.org/book/closures.html#move-closures

Re: Concurrency in Rust

#9

Does 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

#10

Does 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.
Post reply on HN