Skip Menu |

This queue is for tickets about the File-Pid-Quick CPAN distribution.

Report information
The Basics
Id: 47411
Status: open
Worked: 15 min
Priority: 0/
Queue: File-Pid-Quick

People
Owner: chaos [...] cpan.org
Requestors: blue [...] thisisnotmyrealemail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: use non-blocking flock
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
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?