[Stackless] stacklesssocket.py

Alejandro Castillo pyalec at gmail.com
Sun Aug 22 11:29:38 CEST 2010


Yes. Definitely bumped into this problem.

As you can see in the sleep function, I have something like:

def sleep(seconds=sys.maxint):
    ......
    ......
    while True:
          try:
                channel.receive()
                break
          except StopIteration:
                pass


Don't know if it's the right way to work around it.  But it worked.


2010/8/22 Richard Tew <richard.m.tew at gmail.com>:
> On Sun, Aug 22, 2010 at 5:03 PM, Richard Tew <richard.m.tew at gmail.com> wrote:
>> Anyway, the inconsistency is that you can block a non-main thread when
>> the main tasklet does a channel operation.  But when the main tasklet
>> is on a channel, and another tasklet on the scheduler exits, the main
>> channel has to be reawakened.  This is completely in line with this
>> not having had enough usage to finalise the needs it has to meet.
>
> I would also add I was not running the scheduler on secondary threads,
> merely handing off logic to run there.  So I was not using the
> threadblock flag to alter thread scheduler behaviour in the way I
> described.
>
> Correcting the last paragraph:
>
> Anyway, the inconsistency is that you can block a non-main thread when
> its main tasklet does a channel operation.  But when that main tasklet
> is blocked on a channel, and the last remaining tasklet in the
> scheduler exits, in this situation it should be left blocked and the
> thread should block, but instead it has to be reawakened.  This is
> completely in line with this not having had enough usage to finalise
> the needs it has to meet.
>
> Cheers,
> Richard.
>
> _______________________________________________
> Stackless mailing list
> Stackless at stackless.com
> http://www.stackless.com/mailman/listinfo/stackless
>



More information about the Stackless mailing list