Hi Daniel, On Fri, Jan 04, 2008 at 01:46:40AM -0800, Daniel Farina wrote: > I wasn't able to locate any of the keywords ['interrupt', > 'preemption', 'thread'] in the web documentation, so I come to > the list to ask what is roughly the status of these things in the > generated PyPy virtual machines on whatever applicable platforms.
We only have limited support for threads at the moment. I think we have no specific support for high-level backends (JVM, CLI). On the low-level backends (C, LLVM), you can use thread primitives to start threads and use locks as you would do in C. In addition there is support in the translator for automatically inserting custom code before and after every external function call. We use this in PyPy's Python interpreter: it uses a global interpreter lock (GIL), which is released and reacquired around each external function call. (This is similar to CPython but we don't have to put the release/reacquire code everywhere by hand.) > - timeouts on arbitrary code fragments > - writing a preemptive scheduler of closures > - making use of two processors > - triggering garbage collections We have no specific support for all this. Multiple threads will run on multiple processors just like in C. Timeouts can be done in a platform-specific way with signals. For the rest, our custom garbage collectors are not thread-safe, at least yet; only the Boehm collector is, but its performance is not very good in multithreaded programs. A bientot, Armin. _______________________________________________ [email protected] http://codespeak.net/mailman/listinfo/pypy-dev
