470,636 Members | 1,507 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,636 developers. It's quick & easy.

Made a huge change to Stackless. Please test!

Hi friends,

for the last two+ weeks, I was hacking on the internals
of stackless, in order to make things cleaner, smaller,
more natural and more complete.

This patch is a quite essential refactoring of the internals,
enhancing functionality at the same time. On the other hand,
semantics are almost not touched.

This finally became a redesign of a lot of the machinery.
Especially, frames no longer have f_tstate, and much
more important, frames no longer carry informationabout the
C state.
C state (as C stacks) is now a property of the tasklets.

All tasklets now have a c state by default.

There are trivial cstates and non-trivial cstates.
They are distinguished by the nesting_level.

A trivial cstate is a C state with nesting_level == 0.
This cstate does not need to be saved, since their context
is well-known. It can be replaced by a number of trivial
statements, which realize so-called soft switches almost
an order of magnitude faster.

Non-trivial cstates are those created by C stack switching.
Note that exactly these tasklets are not restartable after

As a major enhancement, the system now keeps track of all
tasklets which are using a non-trivial cstate, ensuring that
all these tasklets will receive a kill() signal if they
do not finish normally before thread termination.

Here the check-in message:
This was by far the largest check-in since months!
f_state variables are removed from frames.
cstack objects are removed from frames.
All cstate is now kept in the tasklets.
Tasklets with serious cstate are now killed
automatically on thread deallocation.
Tasklet soft-switching is now secured against
repeated entry from "outside": A version variable
is tracked, which makes sure that "main" is always
left with the most recent version of initial_stub.

Hey, this was two weeks of fulltime work!

Please, give this code a heavy load of testing!

With a few changes, this should be the code base
for porting Stackless to Python 2.3.3.

cheers - chris

Christian Tismer :^) <mailto:ti****@stackless.com>
Mission Impossible 5oftware : Have a break! Take a ride on Python's
Johannes-Niemeyer-Weg 9a : *Starship* http://starship.python.net/
14109 Berlin : PGP key -> http://wwwkeys.pgp.net/
work +49 30 89 09 53 34 home +49 30 802 86 56 mobile +49 173 24 18 776
PGP 0x57F3BF04 9064 F4E1 D754 C2FF 1619 305B C09C 5A3B 57F3 BF04
whom do you want to sponsor today? http://www.stackless.com/

Jul 18 '05 #1
0 1112

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.