Made a huge change to Stackless. Please test!

  • Thread starter Christian Tismer
  • Start date
C

Christian Tismer

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
unpickling!

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:[email protected]>
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/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top