[Python-Dev] Removing the GIL (Me, not you!)

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Sep 14 05:15:23 CEST 2007


Jon Ribbens wrote:
> To put it another way, would it actually matter if the reference
> counts for such objects became hopelessly wrong due to non-atomic
> adjustments?

Again, it would cost time to check whether you could
get away with doing non-atomic refcounting.

If you're thinking that no check would be needed because
only things like True, False and None would be shared
between threads, that's quite wrong. If the threads
are to communicate at all, they need to share some
kind of data somewhere.

Also keep in mind that there is one case of "wrong"
refcounting that would be distastrous, which is the
case where the refcount becomes zero prematurely.

-- 
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | Carpe post meridiem!          	  |
Christchurch, New Zealand	   | (I'm not a morning person.)          |
greg.ewing at canterbury.ac.nz	   +--------------------------------------+


More information about the Python-Dev mailing list