laziness, impatience, and hubris | |
PerlMonks |
(atl: flocks and processes) RE: race condition? - flock and $SIG{ALRM}by atl (Pilgrim) |
on Sep 17, 2000 at 21:26 UTC ( [id://32877]=note: print w/replies, xml ) | Need Help?? |
Letīs analyze what happens, if you get an flock
and die before you can unset the alarm.
Have fun ...
Andreas Update: BTW, using a nonblocking flock and putting the process to sleep for a random time would eliminate the need for signals. Try something like three tries with varying random sleeping times, if unsuccessful, give up (i.e. die). Adjust number of tries and sleeping time for your needs.
In Section
Seekers of Perl Wisdom
|
|