Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Mar 2009 17:55:43 -0700
From:      Julian Elischer <julian@elischer.org>
To:        Randall Stewart <rrs@lakerest.net>
Cc:        threads@freebsd.org, d@delphij.net
Subject:   Re: A mutex for inter-process ;-)
Message-ID:  <49D16A0F.4000404@elischer.org>
In-Reply-To: <78DBBDDA-5A39-4CEB-8289-F36EFB96461D@lakerest.net>
References:  <7D4F6788-0F12-4863-9635-7FADA9115D16@lakerest.net>	<49D136B1.6060809@delphij.net> <78DBBDDA-5A39-4CEB-8289-F36EFB96461D@lakerest.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Randall Stewart wrote:
> 

>>
>> I think davidxu@ deischen@ and julian@?
>>
>> BTW.  How do you handle with one process exit (abnormally) without
>> releasing the mutex?  Just curious :)
> 
> I have a couple of ways of dealing with this..
> 

> 1) Of course the initialization routine calls atexit() to get a
> "cleanup  handler" in place.

this is not really sufficient for a system supplied service.


> 2) Often times, of course, this can fail e.g. you get a SIGSEGV..
> or some such. When you attach the memory, an audit is done. The
> audit will validate that the pid is still alive and has the
> particular tid in it. Of course this is not 100% but as long as the
> tid's have not rolled over it should work. The function is also
> public (need to add that and many things to the manual pages ;-D)
> so that onecan call it whenever one wants :-)

TIDs do roll over the last I looked.. (this may have changed)

did you say man page?  goodie..
lets' see it..

There have been a lot of IPC and mutex implementations
but the trick always comes with the requirement
that they handle process/thread death.

David has done some recent work in this space..

> 
> I will ping Julian and the others...
> 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?49D16A0F.4000404>