laziness, impatience, and hubris | |
PerlMonks |
Re: Lock Fileby ikegami (Patriarch) |
on Nov 02, 2010 at 23:04 UTC ( [id://869114]=note: print w/replies, xml ) | Need Help?? |
A lock that is not automatically freed on unplanned program exit and unplanned systems restart is dangerous. It creates the possibility of a situation where a lock is thought to be held but isn't. Having to poll the lock is inefficient (to varying degree). It can also prevent fairness (i.e. one particular process could wait forever for a lock if scheduling benefits other processes). And now you know why flock was recommended.
In Section
Seekers of Perl Wisdom
|
|