stackless/microthread merge

Christian Tismer tismer at tismer.com
Wed Mar 1 08:22:02 EST 2000


Will Ware wrote:
> 
> At IPC8, I got the chance to talk to Christian Tismer, the author
> of Stackless Python, about the possibility of using it as the basis
> for implementing microthreads. (This is desirable because his
> hacking of ceval.c was much tidier and better thought-out than mine.)
> He suggested that with a stackless build, it should be possible to
> implement microthreads entirely in Python.
> 
> It is, with one caveat: My earlier implementation looked to the
> user like pre-emptive task-switching, which I accomplished by stepping
> Python's VM a few opcodes at a time. If I resist the temptation to do
> damage in ceval.c, task-switching must be explicit in the user's Python
> code, esp. in potentially infinite loops that might block all other
> threads. For the time being I regard that as a reasonable price for
> leaving all the really hard work to Christian.

Congratulation on the implementation on top of Stackless!

I'm just a few days (maybe one) away from publishing
SLP 1.1 with Continuations 0.7.
There is a per-thread scheduling hook that will allow for
pre-emptive switching. This hook is especially for you,
and you can define its interface. At the moment, I have
a callable object hook to offer. Please contact me privately
about the proper protocol and I'll implement it.

cheers - chris

-- 
Christian Tismer             :^)   <mailto:tismer at appliedbiometrics.com>
Applied Biometrics GmbH      :     Have a break! Take a ride on Python's
Kaunstr. 26                  :    *Starship* http://starship.python.net
14163 Berlin                 :     PGP key -> http://wwwkeys.pgp.net
PGP Fingerprint       E182 71C7 1A9D 66E9 9D15  D3CC D4D7 93E2 1FAE F6DF
     we're tired of banana software - shipped green, ripens at home




More information about the Python-list mailing list