Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: Recursive locks:killer application. Do they have one?

by sundialsvc4 (Abbot)
on Feb 02, 2012 at 14:00 UTC ( #951438=note: print w/replies, xml ) Need Help??

in reply to Recursive locks:killer application. Do they have one?

I have never found it necessary to use such a mechanism either.   Also, I think that such niceities, well-intentioned though they might be, might actually tend to create less-debuggable code simply because they are more permissive than they strictly “need” to be.   One of my mentors referred to it as (and I always loved this expression...) “Coding for WTF?!?!”   The notion being that, the more things that are allowed to occur, the more possibilities to have to sift through when you are faced with an evident bug but don’t yet know where.   Multiprocess code is already notoriously hard to debug, without “help” from the OS.   :-)

It is appealing, maybe, to somehow pawn “doing the right thing” off to the operating system ... but “a general case” is hard to consider here, which means that the OS code starts filling up with decision heuristics, which might match your case or simply be an unwanted degree-of-freedom in the mechanism that you are constructing.   If you need a mechanism like this one, you can construct it using simple atomic primitives.   (And if you do, you’d probably want to have an “already locked by this process” error-code from the OS primitive.)

  • Comment on Re: Recursive locks:killer application. Do they have one?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://951438]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2018-05-27 20:24 GMT
Find Nodes?
    Voting Booth?