[pypy-dev] interrupts, preemption, threads

Armin Rigo arigo at tunes.org
Fri Jan 4 15:24:34 CET 2008


Hi Daniel,

On Fri, Jan 04, 2008 at 04:03:55AM -0800, Daniel Farina wrote:
> > > - 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.
> > 
> 
> Is there going to be some cross-platform support for this? 

Thread-safe GCs are probably the biggest blocker.  To some extend we
will also need something for PyPy, although at first we can probably
just rely on the GIL to avoid concurrent GC calls.  So all the more
advanced stuff - including thread-safe or even truly concurrent GC - is
not really likely to be done any time soon by any of us, I imagine.  On
the other hand we're always open to contributions :-)

> As for examples, I imagine pypy/module/signal[/test] is the place to go,
> correct?

Yes, interp_signal.py contains all the necessary declaration, although
they are mixed up with gluing code specific to PyPy's Python
interpreter.  The first step would be to split this file and move the
general RPython-only code to pypy/rlib/rsignal.py, and keep only the
gluing in interp_signal.py; this is what we have already done with other
modules like _socket.


A bientot,

Armin.



More information about the Pypy-dev mailing list