Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: What the flock!? Concurrency issues in file writing.

by moritz (Cardinal)
on Oct 01, 2008 at 16:02 UTC ( [id://714822]=note: print w/replies, xml ) Need Help??


in reply to Re^2: What the flock!? Concurrency issues in file writing.
in thread What the flock!? Concurrency issues in file writing.

If there were no failure conditions for flock, then I'm sure the documentation wouldn't say
Returns true for success, false on failure

I'm not quite sure what the exact failure condition is in which flock neither waits for the lock nor dies, but it seems to exist.

(Update: It seems that it only will fail if LOCK_NB is used, but I'm not entirely sure).

Replies are listed 'Best First'.
Re^4: What the flock!? Concurrency issues in file writing.
by JavaFan (Canon) on Oct 01, 2008 at 20:38 UTC
    Yeah, flock can fail, but that's typically a case of running out of system resources; possibly, but rare. It doesn't seem the OP is describing a case that happens only third blue moon.

    It doesn't mean you shouldn't check the return value of flock, but I doubt that this is the cause of the problem.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://714822]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-04-20 15:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found