From: Bob Alexander Date: 2002-03-13T02:06:20+09:00 Subject: Re: Some potential RCRs "Paul Brannan" wrote > As an alternative, I would suggest a wrapper around the current Mutex > object. There's a name for this kind of mutex, but I can't remember > what it is. It has various names -- Python calls it RLock ("R" for recursive, as opposed to Lock). Java, which fancies itself a multi-threaded, performant language doesn't have a non-recursive lock. My thought is that Ruby doesn't need a non-recursive mutex. Non-recursive mutexes (muti?) only make sense in low-level performance-sensitive code where the saving of a couple of machine cycles is an issue. (If you are that performance-oriented, then Ruby isn't your choice.) Other than that, their non-recursiveness serves no useful purpose (except to cause deadlocks :-). Nested locks, on the other hand, are very useful, allowing higher level methods which acquire the mutex to call lower level methods which also have to acquire the mutex. I suggest just changing the current Mutex to be recursive. I don't think that would introduce any compatibility issues. Bob