in reply to RE: race condition? - flock and $SIG{ALRM}
in thread race condition? - flock and $SIG{ALRM}
Just a short note: 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.
As for using an exception or not ... if you need this file lock to continue normally, not getting it (including timeout) should be considered an exceptional condition. But thatŽs a matter of programming style, certainly no "rigth" or "wrong" way ...
Beers! Yup! :-))
Andreas
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: (atl: about exceptions) RE: RE: race condition? - flock and $SIG{ALRM}
by Zarathustra (Beadle) on Sep 19, 2000 at 21:33 UTC | |
by tilly (Archbishop) on Sep 19, 2000 at 22:05 UTC |