[rust-dev] Why focus on single-consumer message passing?

Vladimir Lushnikov vladimir at slate-project.org
Sun Jan 26 12:21:08 PST 2014


Right, I should have been clearer :) There's no way to share memory without
having to use a lock (e.g. in Arc) unless you use unsafe Rust.


On Sun, Jan 26, 2014 at 7:51 PM, Patrick Walton <pcwalton at mozilla.com>wrote:

> On 1/26/14 7:00 AM, Vladimir Lushnikov wrote:
>
>> Here are a couple of observations/comments from a rust lurker:
>>
>> * +1 for message-passing as a core paradigm for inter-thread
>> communication. It is significantly easier to reason about than shared
>> memory. It is not a silver bullet for all cases of course (but that is
>> why you have unsafe code):
>>
>
> Well, you don't need unsafe code for shared memory. IMHO, one of the best
> features about Rust is that it has an excellent story for shared memory
> when you need it: it's memory safe and race free.
>
> But in the general case, "do not communicate by sharing memory; share
> memory by communicating" should still be your first approach. There is
> nothing evil about shared memory, but I think history has shown that it is
> inherently harder to reason about.
>
> Patrick
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20140126/ae9a1af6/attachment.html>


More information about the Rust-dev mailing list