in reply to Re: Can flock occasionally fail on systems that support file locking?
in thread Can flock occasionally fail on systems that support file locking?

Thank you for your reply.

No, this is the only program that knows about the data file. I have read about this in the various books and online help and verified this.

I have another idea, though:

I wonder if it's possible for Perl or the Web server to occasionally have a new instance of the same Perl script inherit the locks of a previous instance of the script. I got this idea by reading about how forking inherits locks.

For example, let's say 10 people submit the same form at the same time. Each of the 10 submissions starts a new instance of the same Perl script. The Perl script uses flock to lock a secondary file. Is it possible for Perl to occasionally decide that one instance of the script should inherit the locks of another? If so, then the locking has been defeated.

Richard

  • Comment on Re: Re: Can flock occasionally fail on systems that support file locking?

Replies are listed 'Best First'.
Re: Re: Re: Can flock occasionally fail on systems that support file locking?
by PodMaster (Abbot) on Jul 10, 2003 at 14:58 UTC
    That's not possible. Each instance of perl is independent of the other. Unless you use the fork function, it's not gonna happen.

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

      That's good to hear.

      I don't really want to try to figure out how to accommodate such behavior!

      Richard