[Stackless] "Attempt to run a locked frame!"

Bernd Rinn Bernd.Rinn at epost.de
Tue Feb 20 15:18:24 CET 2001

On Tue, Feb 20, 2001 at 02:54:24PM +0100, Christian Tismer wrote:
> Ok, maybe I've got it.
> In miniserver.py, you are doing the following:
> class socketFile:
>     def __init__(self, sock, mode, init_buffer="", timeout=10):
>         self.socket  = sock
>         self.buffer  = init_buffer
>         self.mode    = mode
>         self.timeout = timeout
>         if mode == readMode: self.get()
> Now, get() calls the wait function from the uthread package.
> wait() appends your current thread to a waiting list and
> schedules the next one. In the case of a single client,
> the next thread is the same thread, it just continues
> and everything is fine.        
> Problem: You are crreating a thread in the context of
> an __xxx__ method, __init__ in this case. This is a
> problem with Stackless, since these special methods
> are still causing an interpreter recursion.

Yep, that's it. When I move f.get() out of the constructor, everything
works fine! 

Maybe it would be a good idea to make a note on the uthread homepage
about this restriction.

> [...] Making Stackless completely stackless is a very hard task
> but will hapen at some time in the future.

To be honest, I find it hard even to understand the consequences of
continuations (and I think I have some practice with abstract ideas
from theoretical physics).



Bernd Rinn
Fakultät für Physik
Universität Konstanz

Tel. 07531/88-3812, 
e-mail: Bernd.Rinn at uni-konstanz.de
PGP-Fingerprint: 1F AC 31 64 FF EF A9 67  6E 0D 4C 26 0B E7 ED 5C
Stackless mailing list
Stackless at starship.python.net

More information about the Stackless mailing list