Question about Python threads

Daniel Dittmar daniel.dittmar at
Mon Aug 26 09:57:40 EDT 2002

Ville Vainio wrote:
> Yes, Java uses garbage collection. On a related note: could GIL be
> dumped if refcounts were no longer used (ie Python changed over to gc
> instead)? I know there are many other things that depend on GIL, but
> how much of it would be impossible/hard to fix/bad for performace?

- a lot of code in the Python interpreter would have to be changed to pass
a pointer to the interpreter/thread state rather than relying on the
interpreter info to be available as global variables
- a lot of Python code wouldn't work anymore because many
Python programmers rely on
data = open (...).read ()
to close the file immediately. Sure, garbage collection
will close the file later, but file handles are a too
valuable ressource.


More information about the Python-list mailing list