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

"Martin v. Löwis" martin at v.loewis.de
Thu Sep 13 06:42:18 CEST 2007


> What do you think?

I think what you are describing is the situation of today,
except in a less-performant way. The kernel *already*
implements such a "synchronization server", except that
all CPUs can act as such. You write

"Since we are guaranteeing that synchronized code is running on a single
core, it is the equivalent of a lock at the cost of a context switch."

This is precisely what a lock costs today: a context switch.

Since the Python interpreter is synchronized all of the time, it
would completely run on the synchronization server all of the
time. As you identify, that single CPU might get overloaded, so
your scheme would give no benefits (since Python code could never
run in parallel), and only disadvantages (since multiple Python
interpreters today can run on multiple CPUs, but could not
anymore under your scheme).

Regards,
Martin


More information about the Python-Dev mailing list