From: kjana@...4lab.to (YANAGAWA Kazuhisa) Date: 2002-03-13T20:35:06+09:00 Subject: Re: Some potential RCRs In message sean@celsoft.com writes: > > |------------------ > > |The built-in Mutex object should be nestable. > > | > > |Acquiring a mutex in nested contexts in the same thread should > > |not cause deadlock. It doesn't seem appropriate for a language at > > |Ruby's level to have a non-nestable Mutex, and it is a pothole > > |for program errors. > > > > I will take time to investigate it later (I'm not a thread > > expert). Maybe one of you help me with better implementation. > > I think this definitely needs to change, if that's how it works, or > at least it should be an option when creating the mutex. The same > context should be able to call the same mutex recursively and obtain > the lock each time. Each time increasing the mutex' lock count, > each release decrementing the mutex lock count. Then you use monitor.rb or sync.rb, both with the standard distribution, both provide reentrant mutual exclusion primitive. Well, that does not obstacle the name `Mutex' to be given to more sophisticated one. -- kjana@dm4lab.to March 13, 2002 So many men, so many minds.