Subj : Re: recursive mutexes To : comp.programming.threads From : Uenal Mutlu Date : Wed May 18 2005 05:36 pm "Markus Elfring" wrote > > You are putting operations into 2 categories: > > 1) operations which can be done only if the object is locked > > 2) operations which can be done only if the object is not locked > > > > This is unneccessary complication, and it's dangerous. > > My point of view is: all operations on a shared object can be done only > > in a locked state (#1 above). So one has to forget #2 and never assume to do #2. > > An object can be modified only in a locked state, otherwise wait or > > give up your time-slice back to the schedular. > > The result is: simplication, safety, speed. > > How does your statement fit to existing lock-free algorithms? We were talking about locking. Lock-free shared access is IMO an illusion, usabe for some very small and limited cases only, but not for 99.9% of practical requirements. And IMO they are also slower than a method which uses locking, even if this might sound counter-intuitive. .