rust/src/libstd/sync
Alex Crichton 0a6b9219d1 Rewrite channels yet again for upgradeability
This, the Nth rewrite of channels, is not a rewrite of the core logic behind
channels, but rather their API usage. In the past, we had the distinction
between oneshot, stream, and shared channels, but the most recent rewrite
dropped oneshots in favor of streams and shared channels.

This distinction of stream vs shared has shown that it's not quite what we'd
like either, and this moves the `std::comm` module in the direction of "one
channel to rule them all". There now remains only one Chan and one Port.

This new channel is actually a hybrid oneshot/stream/shared channel under the
hood in order to optimize for the use cases in question. Additionally, this also
reduces the cognitive burden of having to choose between a Chan or a SharedChan
in an API.

My simple benchmarks show no reduction in efficiency over the existing channels
today, and a 3x improvement in the oneshot case. I sadly don't have a
pre-last-rewrite compiler to test out the old old oneshots, but I would imagine
that the performance is comparable, but slightly slower (due to atomic reference
counting).

This commit also brings the bonus bugfix to channels that the pending queue of
messages are all dropped when a Port disappears rather then when both the Port
and the Chan disappear.
2014-02-11 16:32:00 -08:00
..
arc.rs
atomics.rs Register new snapshots 2014-02-04 00:06:08 -08:00
deque.rs Removing do keyword from libstd and librustc 2014-01-29 09:15:41 -05:00
mod.rs
mpmc_bounded_queue.rs Rewrite channels yet again for upgradeability 2014-02-11 16:32:00 -08:00
mpsc_queue.rs Rewrite channels yet again for upgradeability 2014-02-11 16:32:00 -08:00
spsc_queue.rs Rewrite channels yet again for upgradeability 2014-02-11 16:32:00 -08:00