Skip to content.

logo Stackless Python


Personal tools

New Stackless Protocol

Stackless has used some extra fields in the type objects, to support non-recursive calls. After dynamic classes evolved more and more, keeping track of such extra fields has become more and more difficult. In extent, I had to maintain quite a large number of function copies, which behaved slightly different. After all, this approach didn't give me all the results I expected.

Since yesterday, I have been working intensively on a new approach. It might be sligtly less efficient, but it seems to be very, very clean.

tp_call_nr and tp_iternext_nr have been removed from type objects. So far, type objects are unchanged, again.

Stackless instead now supports an implicit parameter for every function call. It would be great if we could make it into an explicit parametzer, but that would change the mplementation completely.

Information about the concrete implementation should probably go somewhere else. Just summarizing: Stackless passes all Python tests and all of its internal tests, the code base is reduced, again, and we have a couple of noew non-recursive calls:

  • tasklet.raise_exception can run stackless,
  • tasklet.kill can run stackless,
  • generator.next can run stackless, like "for i in generator" could already, last time.

This version of stackless is not accessible via the stackless cvs. If you want to try it, you need to use

cvs co slpdev/src/2.3/dev

Will add a link to this to the public pages, soon.

 

Powered by Plone