[pypy-dev] question on rpython stack reconstruction feature
yung2.alan at gmail.com
Sat May 30 05:23:52 CEST 2009
I fixed the code accordingly, and resume() function seems to be (somehow)
However, freeze() function does not work the way I wanted. Following is how
I fixed it.
After translating pypy with stackless option with above code, I ran
following python code
if __name__ == '__main__':
resume() function needs to be fixed alittle bit, but when I run above code,
I wanted it to print out "bar" first, and not "foo"
but it prints out "foo" first.
So, it seems like rstack.stack_unwind() function does not seems to work.
On Fri, May 29, 2009 at 9:13 AM, Armin Rigo <arigo at tunes.org> wrote:
> Hi Alan,
> On Fri, May 29, 2009 at 08:19:27AM -0700, alan yung wrote:
> > I called them from normal Python application (in stackless translated
> > vm) and the behaviour is that they don't have any effect. There's no
> > (interpreter level/application level) stack unwinding or resuming.
> Ah, that's step 1. I see. As this is RPython code, it means that you
> cannot use some constructs -- in this case, the problem is that "if not
> freezed_executioncontext:" is constant-folded, so it is always True
> (which is of course not the case in a normal Python program). You don't
> have varying global lists in RPython, so you need to create a small
> class, create a global instance of it, and then you can read/write an
> attribute "freeze_executioncontext" on it.
> A bientot,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pypy-dev