I guess a sleep time of a couple of seconds between two calls to flock would not be considered tight anymore, i.e. it would be safe?
Even half a second or just sleep 0 (which causes the process to relinquish it's current timeslice) will ensure the OS gets processor time to clean up the dying process.
The situation where things go wrong is when you have multiple processes all polling in tight loops, thus not giving the (lower priority) task of cleaning up the terminating process a look in.
In reply to Re^3: flock on Windows : process killed while in critical region
by BrowserUk
in thread flock on Windows : process killed while in critical region
by rovf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |