[Stackless] Blocked Tasklets

Richard lickspittle at gmail.com
Wed Nov 30 08:01:52 CET 2005


Just testing to see if this address works for sending to the list.  I
sent a reply to this yesterday and did not receive it on either of my
subscribed addresses.

On 11/29/05, Benjamin Buco <fiatetdeusetlux at yahoo.com> wrote:
> 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:
>
> 0
> Sending 0
> getting 0
> -1
> -1
>
> Any help would be greatly appreciated.
> Thanks,
> Benjamin Buco
>
> Code Follows
>
> def Test():
>     def Move(movechan):
>         for n in range(13):
>             print "Sending %r" % (n)
>             movechan.send(n)
>     def Move2(movechan2):
>         x=0
>         while x<>14:
>             x = movechan2.receive()
>             print "getting %r" % (x)
>     ch2=stackless.channel()
>     print ch2.balance
>     a2=stackless.tasklet(Move)(ch2)
>     a2.run()
>     a2=stackless.tasklet(Move2)(ch2)
>     a2.run()
>     print ch2.balance
>     x=0
>     print ch2.balance
> Test()
>
> ________________________________
> Yahoo! Music Unlimited - Access over 1 million songs. Try it free.
>
>
> _______________________________________________
> Stackless mailing list
> Stackless at stackless.com
> http://www.stackless.com/mailman/listinfo/stackless
>
>

_______________________________________________
Stackless mailing list
Stackless at stackless.com
http://www.stackless.com/mailman/listinfo/stackless



More information about the Stackless mailing list