1
Fork 0

comm: Implement synchronous channels

This commit contains an implementation of synchronous, bounded channels for
Rust. This is an implementation of the proposal made last January [1]. These
channels are built on mutexes, and currently focus on a working implementation
rather than speed. Receivers for sync channels have select() implemented for
them, but there is currently no implementation of select() for sync senders.

Rust will continue to provide both synchronous and asynchronous channels as part
of the standard distribution, there is no intent to remove asynchronous
channels. This flavor of channels is meant to provide an alternative to
asynchronous channels because like green tasks, asynchronous channels are not
appropriate for all situations.

[1] - https://mail.mozilla.org/pipermail/rust-dev/2014-January/007924.html
This commit is contained in:
Alex Crichton 2014-03-17 14:34:25 -07:00
parent 6bf3fca8ff
commit 56cae9b3c0
11 changed files with 1229 additions and 115 deletions

View file

@ -433,8 +433,8 @@ mod test {
#[test]
fn rng() {
use rand::{Rng, task_rng};
let mut r = task_rng();
use rand::{StdRng, Rng};
let mut r = StdRng::new();
let _ = r.next_u32();
}