<br><br>
<div><span class="gmail_quote">On 11/23/09, <b class="gmail_sendername">Jeff Senn</b> &lt;<a href="mailto:senn@maya.com">senn@maya.com</a>&gt; 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>&gt;<br>&gt;&gt; I pictured it having an interface like:<br>
&gt;&gt;<br>&gt;&gt; while True:<br>&gt;&gt;   selected_channel = select(quit_channel, request_channel)<br>&gt;&gt;   if selected_channel is quit_channel:<br>&gt;&gt;       return<br>&gt;&gt;   elif selected_channel is request_channel:<br>
&gt;<br>&gt; This is essentially how I would write it.  I would provide a<br>&gt; list of channels and return a list of channels that are ready. For efficiency, I would provide an additional value, hint, to prevent<br>&gt; the scheduler from tearing-down the structure when select returns.<br>
&gt;<br>&gt; readyList = select([channels], hint = True)<br>&gt;<br>&gt; 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 &quot;select-like-operation&quot; actually pops off the message).<br>[Unless you also propose a non-blocking receive...which would have other problems....<br>I haven&#39;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">&gt; ...<br>&gt; I understand your minimalist approach towards Stackless. However I think<br>&gt; 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>&gt; believe PyPy provides an opportunity to prototype changes in a safe and fast way.<br>&gt;<br>&gt; Cheers,<br>&gt; Andrew<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>
&gt; _______________________________________________<br>&gt; Stackless mailing list<br>&gt; <a href="mailto:Stackless@stackless.com">Stackless@stackless.com</a><br>&gt; <a href="http://www.stackless.com/mailman/listinfo/stackless">http://www.stackless.com/mailman/listinfo/stackless</a><br>
&gt;<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>