[Stackless] Google's new Go programming language

Larry Dickson ldickson at cuttedge.com
Mon Nov 23 22:58:04 CET 2009

On 11/23/09, Andrew Francis <andrewfr_ice at yahoo.com> wrote:
> Hi Larry:
> >Select (on inputs) requires single-receiver channels. Multiple senders are
> >OK. Given that restriction, a select can be implemented without race
> >conditions.
> Okay I think I get what you are saying. If you are doing a receive(),
> having multiple senders is okay. And if you are doing a send(), having
> multiple receivers are okay. However if you are doing a receive, and there
> is another receiver beats you to the punch, that is a problem. With a little
> change to the select() interface, this could be detected and an exception
> could be raised.

Even better, you could have mutually exclusive species
"channel-with-multiple-receivers" and "channel-with-select". An attempt to
initialize a select would fail if the channel has more than 1 receiver. An
attempt to add another receiver would fail if the channel has a select
underway. Better yet (in my personal opinion), the two kinds of channels
would be distinguished at declaration.


> Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.stackless.com/pipermail/stackless/attachments/20091123/6a1a182d/attachment.htm>

More information about the Stackless mailing list