Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Flocking in advance

by atl (Pilgrim)
on Aug 11, 2000 at 15:14 UTC ( [id://27488]=note: print w/replies, xml ) Need Help??


in reply to Flocking in advance

Locking something that doesn't exist is indeed not possible. Checking on the existence of a file and then opening/creating it will create you a race condition you should avoid. Two solutions for your problem come to my mind.

First, if you want to stick to that approach, use a second (empty) file to do the locking on. Your (perl written?) compiler tries to get a lock on that file and doesn't do anything until he gets it (or maybe a timeout occurs).

Another option is to use unique file names for the output, so multiple submissions can be made at any time. You might use a combination of username and timestamp, for example.

Andreas

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2024-04-18 13:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found