I'm not sure if that's how ghc channels work. I seem to recall that the main ones are using STM, though I think there's an MVAr one. There's some differences in semantics for the two.
On Wednesday, December 25, 2013, Benjamin Herr wrote: > On Tue, 2013-12-24 at 18:48 -0800, Patrick Walton wrote: > > Haskell may be a nice thing to look at here: the unbounded channel is > > the primitive, and bounded channels are built on top of unbounded ones > > using an `MVar` to rate limit. Such a thing could be easily built in > > Rust using a channel paired with an `AtomicUint`. > > Arguably the MVar as a bounded channel of fixed capacity 1 is the > primitive (both taking from and putting into an MVar will block if it is > empty or full, respectively), and unbounded Chans are just MVars all the > way down. But I'm not sure if that's not just nitpicking. ;) > > -benh > > _______________________________________________ > Rust-dev mailing list > Rust-dev@mozilla.org <javascript:;> > https://mail.mozilla.org/listinfo/rust-dev >
_______________________________________________ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev