On Sun Jun 28 05:13:46 2009, blue wrote:
Show quoted text> use flag LOCK_NB with flock to avoid blocking or do something like
> mentioned in perlopentut.
>
> also, i think sysopen, instead of open, should be used before locking
> the file
There isn't any way to correctly integrate use of LOCK_NB. If finding
an exclusive lock on the PID file is interpreted as meaning we should
exit, there's then no way to implement the timeout value, since that
requires reading the file. If we were going to just go ahead and read
the file despite the lock, there's no point checking the lock in the
first place; the reason we do is that the only time the file should be
locked is because another process is literally in the middle of writing
its content, which means its content is unreliable.
Can you justify for me why you think sysopen should be used in
preference to open?