Armin Rigo - 2004-08-26

Logged In: YES
user_id=4771

This is a good idea, though I don't see a reasonable way to
implement it in Psyco. Most sequences of generated code
have to run with the GIL (Global Interpreter Lock) acquired,
even those with no explicit call to the C API -- for example,
reading a list item is inlined and only takes a few assembler
instructions, but these have to be protected by the GIL too
or they could read garbage or segfault if the list is modified at
the wrong time by another thread. The only kind of code
that could run without the GIL is really purely arithmetic code,
and even so the GIL is needed from time to time due to
limitations of Psyco (e.g. each 'return some_int' forces a call
to PyInt_FromLong()).