dual processor

Paul Rubin http
Mon Sep 5 18:48:01 CEST 2005

Nick Craig-Wood <nick at craig-wood.com> writes:
> >  of is decrementing a reference count.  Only one thread can be allowed to
> >  DECREF at any given time for fear of leaking memory, even though it will
> >  most often turn out the objects being DECREF'ed by distinct threads are
> >  themselves distinct.
> Yes locking is expensive.  If we placed a lock in every python object
> that would bloat memory usage and cpu time grabbing and releasing all
> those locks.  However if it meant your threaded program could use 90%
> of all 16 CPUs, rather than 100% of one I think its obvious where the
> payoff lies.

Along with fixing the GIL, I think PyPy needs to give up on this
BASIC-style reference counting and introduce real garbage collection.
Lots of work has been done on concurrent GC and the techniques for it
are reasonably understood by now, especially if there's no hard
real-time requirement.

More information about the Python-list mailing list