[ENH] RecursiveMutex (disregard RecursionLock)

Lex Spoon lex at cc.gatech.edu
Sat Sep 21 15:23:10 UTC 2002


Stephan Rudlof <sr at evolgo.de> wrote:

> >  I'm not convinced it is
> > thread-safe, but what the heck.
> 
> You could shelter it by another Sema ;-)
> 
> > Maybe it's as thread-safe as the
> > operation inherently is, anyway.
> 
> Too short to understand your possible problems.

What I mean is, why bother protecting something if the definition of the
operation has inherent race conditions.  For example, assume that some
other thread is lurking in the background ready to signal the semaphore
at the worst possible time -- does it matter if we make them wait to the
end of the method?  To make things harder, also imagine that multiple
processes are watching the state of the semaphore, and that some of them
might be suspended at the time.

I don't know.  I suspect it doesn't matter, but I haven't really thought
it through completely.


Lex



More information about the Squeak-dev mailing list