<br><br>
<div><span class="gmail_quote">On 11/23/09, <b class="gmail_sendername">Jeff Senn</b> <<a href="mailto:senn@maya.com">senn@maya.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>On Nov 23, 2009, at 12:13 PM, Andrew Francis wrote:<br>><br>>> I pictured it having an interface like:<br>
>><br>>> while True:<br>>> selected_channel = select(quit_channel, request_channel)<br>>> if selected_channel is quit_channel:<br>>> return<br>>> elif selected_channel is request_channel:<br>
><br>> This is essentially how I would write it. I would provide a<br>> list of channels and return a list of channels that are ready. For efficiency, I would provide an additional value, hint, to prevent<br>> the scheduler from tearing-down the structure when select returns.<br>
><br>> readyList = select([channels], hint = True)<br>><br>> but for a start I would simply the interface to return a single channel.<br><br>Unfortunately that seems to create a race condition (opposed to the implementations<br>
in other environments where the "select-like-operation" actually pops off the message).<br>[Unless you also propose a non-blocking receive...which would have other problems....<br>I haven't been following this thread completely...]<br>
<br>Imagine the tasklet interrupted (by someone else receiving from the same channel)<br>between the select and the following .receive(...)</blockquote>
<div> </div>
<div>Select (on inputs) requires single-receiver channels. Multiple senders are OK. Given that restriction, a select can be implemented without race conditions.</div>
<div> </div>
<div>Larry Dickson</div>
<div>Cutting Edge Networked Storage</div><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">> ...<br>> I understand your minimalist approach towards Stackless. However I think<br>> Stackless can evolve only so far without actual changes to the scheduler. Priorities involved a change to the scheduler. Again, I<br>
<br>I do agree with this...<br><br>> believe PyPy provides an opportunity to prototype changes in a safe and fast way.<br>><br>> Cheers,<br>> Andrew<br>><br>><br>><br>><br>><br>><br>><br>><br>
> _______________________________________________<br>> Stackless mailing list<br>> <a href="mailto:Stackless@stackless.com">Stackless@stackless.com</a><br>> <a href="http://www.stackless.com/mailman/listinfo/stackless">http://www.stackless.com/mailman/listinfo/stackless</a><br>
><br><br><br>_______________________________________________<br>Stackless mailing list<br><a href="mailto:Stackless@stackless.com">Stackless@stackless.com</a><br><a href="http://www.stackless.com/mailman/listinfo/stackless">http://www.stackless.com/mailman/listinfo/stackless</a><br>
</blockquote></div><br>