<div>Hi Andrew,</div>
<div>&nbsp;</div>
<div>I read your 2005 note, and I do not understand</div>
<div>&nbsp;</div>
<div>&gt;I expect the following execution trace <br>&gt;<br>&gt;(A | B) C (D | E) F<br>&gt;<br>&gt;|<i> - means processes can execute in parallel. <br></i>&gt;<br>&gt;It is okay to see B finish before A. However it is<br>
&gt;wrong to see C finish before B and A finish.<br><br>Do you mean C starts after (A|B) finish, or they all start together, or ..?</div>
<div>&nbsp;</div>
<div>Larry<br>&nbsp;</div>
<div><span class="gmail_quote">On 10/21/08, <b class="gmail_sendername">Andrew Francis</b> &lt;<a href="mailto:andrewfr_ice@yahoo.com">andrewfr_ice@yahoo.com</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi Larry:<br><br>&gt; We seem to have different ideas of what is simple. You<br>&gt; propose exceptions, waits, signals, barriers, re-initialization,<br>
&gt; and presumably global signal values. This in my opinion is a whole &gt;Italian restaurant of spaghetti, and it sounds intrinsically global, &gt;which is poison to maintainable multiprocessing in my experience.<br><br>
This is what I had in mind. A sketch.<br><br>def producer(synchronizer):<br>&nbsp;&nbsp; try:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # do some computation<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; synchronizer.signal(result)<br>&nbsp;&nbsp; except Signalled, data<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # oops the consumer has moved on.... maybe<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # I should gracefully terminate.....<br><br><br>def consumer(synchronizer):<br>&nbsp;&nbsp; output = synchronizer.wait()<br>&nbsp;&nbsp; # okay, let us do some stuff with the output<br><br>synchronizer = Synchronizer(numberOfProducers)<br>
stackless.tasklet(consumer)(synchronizer)<br>for .... :<br>&nbsp;&nbsp; stackless.tasklet(producer)(synchronizer)<br><br>Most of the effort is in defining the right behaviour.....<br><br>Once again, my experiences are when you naively use channels, it is easy to get in trouble.&nbsp;&nbsp;A construct like receive_first() looks difficult to implement, in comparison to a synchronizer.<br>
<br>Here is a thread from December 2005 (2005!)<br><br><a href="http://www.stackless.com/pipermail/stackless/2005-December/000290.html">http://www.stackless.com/pipermail/stackless/2005-December/000290.html</a><br><br>Cheers,<br>
Andrew<br><br><br><br><br><br><br><br><br></blockquote></div><br>