This is the mail archive of the cygwin-developers@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: muto object.


n Tue, 2001-09-18 at 00:57, Christopher Faylor wrote:
> On Mon, Sep 17, 2001 at 02:23:04PM +1000, Robert Collins wrote:

> >Huh? MS reuse Handle ID's for threads? Ouch ouch ouch. <thinking out
> >loud>Actually the problem here is that we want a handle leak, for the
> >time taken to hit the muto and find the thread dead, and we don't want
> >to be calling DuplicateHandle every time ownership changes. Now if we
> >put the thread handle in non-TLS storage, pointed to by TLS, then the OS
> >will not clean up the duplicated handle if the thread exits. So we WILL
> >know that the thread hasn't been destroyed and recreated. If we
> >encounter a dead thread, then by closing the handle when we recover the
> >muto, we will allow the thread handle to go away, thus fixing the leak.
> 
> Assuming that we are closing the handle in the muto processing when the
> muto detects that the thread has gone away, yes.  So, we have a potential
> leak if the user uses mutos during the life of a thread but doesn't
> use any after the thread exits.  I guess that's not a big deal.

Right, and that potential 'leak' is also predicated on the user not
destroying the muto. I'll work up a patch to reflect these alterations
sometime soon. Then 95' here we come.

Rob


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]