<div>Hi Andrew,</div>
<div> </div>
<div>I read your 2005 note, and I do not understand</div>
<div> </div>
<div>>I expect the following execution trace <br>><br>>(A | B) C (D | E) F<br>><br>>|<i> - means processes can execute in parallel. <br></i>><br>>It is okay to see B finish before A. However it is<br>
>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> </div>
<div>Larry<br> </div>
<div><span class="gmail_quote">On 10/21/08, <b class="gmail_sendername">Andrew Francis</b> <<a href="mailto:andrewfr_ice@yahoo.com">andrewfr_ice@yahoo.com</a>> 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>> We seem to have different ideas of what is simple. You<br>> propose exceptions, waits, signals, barriers, re-initialization,<br>
> and presumably global signal values. This in my opinion is a whole >Italian restaurant of spaghetti, and it sounds intrinsically global, >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> try:<br> # do some computation<br> synchronizer.signal(result)<br> except Signalled, data<br> # oops the consumer has moved on.... maybe<br>
# I should gracefully terminate.....<br><br><br>def consumer(synchronizer):<br> output = synchronizer.wait()<br> # okay, let us do some stuff with the output<br><br>synchronizer = Synchronizer(numberOfProducers)<br>
stackless.tasklet(consumer)(synchronizer)<br>for .... :<br> 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. 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>