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

Patrick Walton pcwalton at mozilla.com
Sat Jan 25 09:39:14 PST 2014


On 1/25/14 9:31 AM, Patrick Walton wrote:
> On 1/25/14 2:48 AM, Daniel Micay wrote:
>> Rust aims to be a systems language displacing C and C++ from their
>> niche. I don't think it's suitable as one with the standard library,
>> and it's not replacement for C without a large library ecosystem.
>
> As Brian said, this sort of inflammatory, unspecific criticism is not
> welcome. Especially when you are advocating making channels *less*
> performant.

As an aside, I don't think multi-consumer queues are the right API for 
dividing up work among many workers, because of the massive contention 
on the queue. Work stealing is the proven approach here. I suspect the 
API should look something like this:

https://github.com/mozilla/servo/blob/18a2050a64cd6f320cc59cb490a69b0e895f11d3/src/components/util/workqueue.rs

This just landed in Servo today and after we give it some time to bake 
I'd like to uplift it to libextra.

Patrick



More information about the Rust-dev mailing list