Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

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

by bluto (Curate)
on Oct 06, 2008 at 16:19 UTC ( #715617=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.

As I mentioned before you must put a sysseek in there (e.g. after the flock, but before the syswrite). If you don't you will see corruption since a single process will have a stale version of the current EOF for it's file descriptor.

I also see corruption with your code on my mac. I don't see it if there is a sysseek($FH, 0, 2). You mentioned that sysseek() "broke everything". When you put it back in this code, and check for error returns, what do you see?


Comment on Re^3: What the flock!? Concurrency issues in file writing.
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (21)
As of 2015-07-02 13:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (40 votes), past polls