[PATCH 1 of 1] Replacing select.select() with os.fstat() which works also on windows

Matt Mackall mpm at selenic.com
Tue Sep 27 19:27:50 CDT 2005


On Wed, Sep 28, 2005 at 12:42:56AM +0200, Zbynek Winkler wrote:
> Matt Mackall wrote:
> 
> >On Tue, Sep 27, 2005 at 09:05:38PM +0200, Zbynek Winkler wrote:
> > 
> >
> >># HG changeset patch
> >># User zbynek at alex.kolej.mff.cuni.cz
> >># Node ID 838c97b17a4162fb508452ec08a32bb0e0078d5c
> >># Parent  0e2be889ccd7eaf0c5c1f08b486e02be3ec7358f
> >>Replacing select.select() with os.fstat() which works also on windows.
> >>   
> >>
> >I like this. 
> >
> Great!
> 
> >It passes my hand run tests and the test suite except:
> > 
> >
> >>-            for l in self.pipee:
> >>-                self.ui.status("remote: ", l)
> >>+            readerr()
> >>   
> >>
> >This is intentionally blocking so that we read until the other end
> >closes the pipe.
> > 
> >
> Ok, I didn't know that (maybe add a little comment?) Actually during my 
> testing on windows the __del__ method was never called. The 
> documentation says that it is sometimes not called for objects that 
> exist when the interpreter is shutting down. On windows it was not 
> called and the threaded version didn't work because of that. The helper 
> thread never ended because it was blocked reading the error output. Sigh 
> :( This implementation is better anyway ;-)

It's now in tip, with the __del__ bit reverted. 

BTW, the usual cause for destructors not getting called is circular
references or otherwise outstanding references when shutdown is
happening. So I suspect your thread was holding onto a reference to
the object and the object itself was pointing to the thread.

It's interesting that people's aversion to goto is much higher than
their aversion to threads, as threads are _much_ more trouble.

-- 
Mathematics is the supreme nostalgia of our time.


More information about the Mercurial mailing list