Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

•Re: Flock and Destroy

by merlyn (Sage)
on Oct 11, 2003 at 15:23 UTC ( [id://298514]=note: print w/replies, xml ) Need Help??


in reply to Flock and Destroy
in thread First Time Untainting Data

No, you've got a destruction going on. Consider:
  • process 1 opens for create - file deleted
  • process 1 flocks - and continues
  • process 1 writes its data
  • process 2 opens for create - blam, process 1 data is gone
  • process 1 closes, releasing the flock
  • process 2 flocks - and continues
  • process 2 writes its data
  • process 2 closes
I guess if your goal is to have only the most recent data, you've succeeded, but you didn't need to do the flock for that... you can just leave the flocks entirely out.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2024-04-23 17:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found