<DIV id=RTEContent>Well, I found stackless a few weeks ago and its helping out a great deal so far. However I seem to be a bit confused about when a channel unblocks a tasklet. For some reason I thought that a tasklet blocked while waiting on a channel and then immediatly began to run itself again after being unblocked. Here's my code, its pretty obvious what I want it do do, but these are the results I get:</DIV> <DIV> </DIV> <DIV>0<BR>Sending 0<BR>getting 0<BR>-1<BR>-1</DIV> <DIV> </DIV> <DIV>Any help would be greatly appreciated.</DIV> <DIV>Thanks,</DIV> <DIV>Benjamin Buco</DIV> <DIV> </DIV> <DIV>Code Follows</DIV> <DIV> </DIV> <DIV>def Test():<BR> def Move(movechan):<BR> for n in range(13):<BR> print "Sending %r" % (n)<BR>
movechan.send(n)</DIV> <DIV> def Move2(movechan2):<BR> x=0<BR> while x<>14:<BR> x = movechan2.receive()<BR> print "getting %r" % (x)</DIV> <DIV> ch2=stackless.channel()<BR> print ch2.balance<BR> a2=stackless.tasklet(Move)(ch2)<BR> a2.run()<BR> a2=stackless.tasklet(Move2)(ch2)<BR> a2.run()<BR> print ch2.balance<BR> x=0<BR> print ch2.balance</DIV> <DIV>Test()</DIV><p>
                <hr size=1> <a href="http://pa.yahoo.com/*http://us.rd.yahoo.com/evt=36035/*http://music.yahoo.com/unlimited/">Yahoo! Music Unlimited - Access over 1 million songs. Try it free.</a>