about summary refs log tree commit diff
path: root/src/libstd/sync/mpmc_bounded_queue.rs
AgeCommit message (Collapse)AuthorLines
2014-04-10std,serialize: remove some internal uses of ~[].Huon Wilson-6/+6
These are all private uses of ~[], so can easily & non-controversially be replaced with Vec.
2014-03-31std: Switch field privacy as necessaryAlex Crichton-1/+1
2014-03-28Convert most code to new inner attribute syntax.Brian Anderson-1/+1
Closes #2569
2014-03-20rename std::vec -> std::sliceDaniel Micay-3/+3
Closes #12702
2014-03-13std: Rename Chan/Port types and constructorAlex Crichton-10/+10
* Chan<T> => Sender<T> * Port<T> => Receiver<T> * Chan::new() => channel() * constructor returns (Sender, Receiver) instead of (Receiver, Sender) * local variables named `port` renamed to `rx` * local variables named `chan` renamed to `tx` Closes #11765
2014-02-11Rewrite channels yet again for upgradeabilityAlex Crichton-1/+1
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-01Make next_power_of_two generic for unsigned integersBrendan Zabarauskas-2/+2
Also rename `next_power_of_two_opt` to `checked_next_power_of_two`.
2014-01-29Removing do keyword from libstd and librustcScott Lawrence-4/+4
2014-01-21Remove unnecessary parentheses.Huon Wilson-1/+1
2014-01-17Add a generic power functionFlavio Percoco-2/+2
The patch adds a `pow` function for types implementing `One`, `Mul` and `Clone` trait. The patch also renames f32 and f64 pow into powf in order to still have a way to easily have float powers. It uses llvms intrinsics. The pow implementation for all num types uses the exponentiation by square. Fixes bug #11499
2014-01-09Merge some numeric traits with Real and don't re-export RealExtBrendan Zabarauskas-1/+1
The methods contained in `std::num::{Algebraic, Trigonometric, Exponential, Hyperbolic}` have now been moved into `std::num::Real`. This is part of an ongoing effort to simplify `std::num` (see issue #10387). `std::num::RealExt` has also been removed from the prelude because it is not a commonly used trait.
2013-12-24std: Get stdtest all passing againAlex Crichton-3/+9
This commit brings the library up-to-date in order to get all tests passing again
2013-12-24std: Introduce std::syncAlex Crichton-0/+211
For now, this moves the following modules to std::sync * UnsafeArc (also removed unwrap method) * mpsc_queue * spsc_queue * atomics * mpmc_bounded_queue * deque We may want to remove some of the queues, but for now this moves things out of std::rt into std::sync