Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

RE: (atl: about exceptions) RE: RE: race condition? - flock and $SIG{ALRM}

by Zarathustra (Beadle)
on Sep 19, 2000 at 21:33 UTC ( [id://33141]=note: print w/replies, xml ) Need Help??


in reply to (atl: about exceptions) RE: RE: race condition? - flock and $SIG{ALRM}
in thread race condition? - flock and $SIG{ALRM}

if you catch the exception instead of letting the process die, youŽll have to close the file yourself to get rid of the lock. Otherwise you might block other processes in the (rather rare) case the race condition occurs.

Hey, thanks - you're absolutely right. That's one bit I had completely over looked...

Good eye!

  • Comment on RE: (atl: about exceptions) RE: RE: race condition? - flock and $SIG{ALRM}

Replies are listed 'Best First'.
RE: RE: (atl: about exceptions) RE: RE: race condition? - flock and $SIG{ALRM}
by tilly (Archbishop) on Sep 19, 2000 at 22:05 UTC
    Just have the filehandle be localized or in a lexical scope. Then it will close on its own when it notices that you exited the scope it was opened in. :-)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2024-04-19 09:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found