On Tue, Dec 24, 2013 at 6:32 PM, Kevin Cantu <[email protected]> wrote:
> This seems like a false dichotomy.  I'd rather ask: do we want the
> scheduling library code to deliberately avoid resource exhaustion or
> do we want the Servo code to deliberately avoid resource exhaustion?
>
> Kevin

Bounded channels present the choice between blocking (with an optional
timeout) when the channel is full or making a non-blocking call with
custom handling of the error case. Unbounded channels don't provide a
way to write robust systems without layering on application-level
message passing and book-keeping. It doesn't absolve you of handling
deadlocks by considering the bounds because you're just going to get a
far worse out-of-memory condition instead.

It's not sane to rely on the OS scheduler giving a consistent balance
of time slices between producers and consumers over a given period of
time. If you really know there are external factors limiting the size
of the queue, you can pass that as a bound. I don't think there's much
reason to use an unbounded queue when you aren't micro-optimizing to
the point where you're saving bytes and instructions by dropping one
of the condition variables.
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to