Posted by Steve on 09/06/05 12:31
> If more than one user clicks the submit button at the same time can I use
> flock to ensure that all the data gets written to the file? Is the following
> code correct?
This will work, but you might also wish to add timeout logic so that if
a user is kept waiting for too long the loop breaks. Where you go from
there will depend on your application and the possible reasons for the
deadlock: ask them to resubmit the form, or come back later, or log an
error and give up.
---
Steve
[Back to original message]
|