On 12/30/13 8:46 PM, Christian Ohler wrote:
To address the last sentence – bounded channels with default size 0
_do_ minimize the fallout of this design: The program would reliably
deadlock every time it is tested with a nonzero number of images,
since A will try to write to "Images" while B is blocked receiving
from "Done", not listening on "Images" yet.  I don't see this deadlock
as a nasty hazard – the code wouldn't work at all, and the programmer
would immediately notice.  If the programmer uses a non-zero buffer
size for the channel, it's a magic number that they came up with, so
they should know to test inputs around that magnitude.

I suspect a lot of programmers in systems with bounded channels just come up with some round number (like 10) and forget about it. Similar to the argument to listen(2)...

Patrick

_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to