C.DeRykus wrote:
> There's a tiny race condition  at this point since  the pidfile still
> hasn't been created.  What if another cron fires off during this
> very short window, doesn't see the pidfile, then slips through...
> Or, maybe even the shorter window between pidfile creation
> and its content being written  is the problem. Perhaps an
> atomic 'flock' on the pidfile would be a good idea to eliminate
> the latter window...

This can be avoided by using the O_EXCL flag with sysopen, at least on
the OSes that support it.  See `perldoc -f sysopen` for details.


-- 
Just my 0.00000002 million dollars worth,
  Shawn

Programming is as much about organization and communication
as it is about coding.

I like Perl; it's the only language where you can bless your
thingy.

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to