http://qs1969.pair.com?node_id=1008659


in reply to Re^2: flock on Windows : process killed while in critical region
in thread flock on Windows : process killed while in critical region

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.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

RIP Neil Armstrong