Subj : Re: Lockable objects To : comp.programming.threads From : doug Date : Sat May 21 2005 12:01 pm "Giancarlo Niccolai" wrote in message news:d6n2ua$a3a$2@newsread.albacom.net... > Uenal Mutlu wrote: > >> I'm predicting that in the near future all non-trivial objects the >> programming language offers (esp. C++ & STL) will have >> some built-in synchronization methods for the user, like: >> Lock() >> Unlock() >> TryLock() >> IsLocked() >> GetLockCount() >> And most probly the locking will be done by using recursive mutices >> internally. > > Mutulu, are you really serious? > It's on the first page of any threading book! > > if ( IsLocked(X) ) { > <<< Here another thread locks X >>> > // do something believing X is not locked > // and bang. > } > > That's why no-one ever implemented an IsLocked primitive. > > I am beginning to suspect you are a troll; so, please, are you SERIOUS > about > threading or are you making jokes of us? > > Giancarlo. > As David pointed out in another thread, the dangerous thing is that someone out there might actually listen to this guy, under the mistaken impression he knows what he's talking about. And that's not good, because it means that we all have to spend hours debugging their flaky code when we cross paths with them. .