Question about Python threads

Daniel Dittmar daniel.dittmar at sap.com
Mon Aug 26 15:57:40 CEST 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.

Daniel






More information about the Python-list mailing list