News for hackers. Stuff that matters.
Re:Facebook is using D in production starting today by codex on Friday October 11, 2013 @01:32PM (#6534560)
This implies that an object will be unavailable while it is being passsed between threads. How fast is that? With a mutex, it's as fast as shared memory.
Re:Facebook is using D in production starting today by pcwalton on Friday October 11, 2013 @03:40PM (#6535445)
Message passing is a couple of atomic operations, and there are also L4-esque optimizations that allow a message send to be optimized into a direct context switch without a pass through the scheduler.

Also, you can use shared memory in Rust. If you do, the type system ensures there can be no data races: either the data is immutable or you must take the lock before you mutate the data.

Re:Facebook is using D in production starting today by mratzloff on Saturday October 12, 2013 @11:04AM (#6538952)
That's pretty nice. I've been waiting for Rust to stabilize before I bother learning it... It's been taking awhile, though. :-)
Re:Facebook is using D in production starting today by agwa on Friday October 11, 2013 @01:55PM (#6534713)
Under the hood, you still use shared memory in this style of programming. But the programmer never uses shared memory directly. Instead he passes references to the shared memory to other threads, and the act of passing a reference clears the reference in the sending thread so the sending thread can no longer access it.

In Rust, this style is enforced by the language. In C++11 you can enforce it by the convention of using std::unique_ptr and passing those between threads via a shared data structure like a blocking queue.