Fine thread control, Run only n bytecodes

David Pokorny davebrok at soda.csua.berkeley.edu
Fri Aug 13 00:38:14 EDT 2004


"Paul Rubin" <http://phr.cx@NOSPAM.invalid> wrote in message
news:7x7jsynifw.fsf at ruckus.brouhaha.com...
> "David Pokorny" <davebrok at soda.csua.berkeley.edu> writes:
> > I'd like to be able to take a function or other chunk of code (that
someone
> > else has written), run it for, say 50 byte codes, and then return
control
> > back to my program/controlling thread until my program/controlling
thread
> > indicates that it wants to run the next 50 bytes codes of the foreign
> > program, etc...
>
> This subject has come up before.  If you're trying to timeshare, I
> don't think that's really going to help you.  Some bytecodes can take
> unbounded amounts of time to execute.

As far as I know, the worst problem is with the likes of

BUILD_LIST
BUILD_TUPLE
UNPACK_SEQUENCE
...

For those who are interested, I've found the most promising solution so far:
a Python metacircular VM (written in Python).
http://www.codespeak.net/pipermail/pypy-dev/2003q1/000048.html





More information about the Python-list mailing list