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

Re: Ways to sequence calls from multiple processes

by graff (Chancellor)
on Nov 30, 2004 at 04:39 UTC ( [id://411101]=note: print w/replies, xml ) Need Help??


in reply to Ways to sequence calls from multiple processes

I think that as long as your "common_resource" code never actually tries to write any important data into "lock.txt" while it has the lock on that file, you'll be fine.

There was a really good series of articles by Sean Burke in The Perl Journal a few years back about file locking, and as soon as I read it, I put some of his code into a module for creating a "semaphore file" -- an empty file whose sole purpose is to establish and hold a lock while the important "one-at-a-time" business goes on elsewhere. I've been using it for years without a hitch, on multiple OS's.

I even posted it here, in response to another SoPW thread. I just checked the url for the Burke article it was taken from, and that's still working also.

  • Comment on Re: Ways to sequence calls from multiple processes

Log In?
Username:
Password:

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

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

    No recent polls found