Moving towards Python 3.0 (was Re: [Python-Dev] Speed up functioncalls)

Fred L. Drake, Jr. fdrake at acm.org
Tue Feb 1 21:06:17 CET 2005


On Monday 31 January 2005 14:08, Glyph Lefkowitz wrote:
 > As it stands, this idiom works most of the time, and if an EMFILE errno
 > triggered the GC, it would always work.

That might help things on Unix, but I don't think that's meaningful.  Windows 
is much more sensitive to files being closed, and the refcount solution 
supports that more effectively than delayed garbage collection strategies.

With the current approach, you can delete the file right away after releasing 
the last reference to the open file object, even on Windows.  You can't do 
that with delayed GC since Windows will be convinced that the file is still 
open and refuse to let you delete it.  To fix that, you'd have to trigger GC 
from the failed removal operation and try again.

I think we'd find there are a lot more operations that need that support than 
we'd like to think.


  -Fred

-- 
Fred L. Drake, Jr.  <fdrake at acm.org>



More information about the Python-Dev mailing list