Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re^3: Auto flock

by davido (Archbishop)
on Nov 20, 2012 at 17:46 UTC ( #1004766=note: print w/replies, xml ) Need Help??

in reply to Re^2: Auto flock
in thread Auto flock

Your assessment of how to fix some of the concerns I raised is good. One could certainly build logic into the tool to deal with read versus write. And the failed flock issue could also be handled internally with better logic. There are other issues as well though. One is that code isn't usually written with the notion that 'open' could block, which is exactly what would happen with 'autoflock' if a file is already locked. That flock normally blocks to wait for a lock is expected behavior of that function, but not expected of open. That could break existing code.

So those are the issues we know about. My fear is the edge cases we haven't considered and aren't aware of. If we were talking about overriding 'chop', I'd say no big deal. open is a little more complicated, and the stakes are higher.

Yes, space_monk's suggestion is probably the one.


Log In?

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2018-05-22 14:20 GMT
Find Nodes?
    Voting Booth?