russx2
03-05-2003, 08:52 AM
Hi,
I have a script that takes some POST input and uses an external system call to ImageMagick to make an image. I am trying to put in 'protection' to stop the user pressing refresh multiple times (and lagging the server - each image takes approx 5 secs to produce).
I decided on a 'locking' mechanism where I create a temp file with their userid before calling the command and deleting it after (and checking for its existance at the beginning of the script.
However, what seems to be happening is that the server is 'queueing' the requests. With 2 browsers open, and both having 'refresh' pressed simultaneously (near enough) they take it in turns to execute, rather than both trying to execute simultaneously. Hence, the locking mechanism isn't working.
Any ideas? Is this normal behaviour for PHP? Can a session only 'access' one page at a time?
Cheers,
Russ
I have a script that takes some POST input and uses an external system call to ImageMagick to make an image. I am trying to put in 'protection' to stop the user pressing refresh multiple times (and lagging the server - each image takes approx 5 secs to produce).
I decided on a 'locking' mechanism where I create a temp file with their userid before calling the command and deleting it after (and checking for its existance at the beginning of the script.
However, what seems to be happening is that the server is 'queueing' the requests. With 2 browsers open, and both having 'refresh' pressed simultaneously (near enough) they take it in turns to execute, rather than both trying to execute simultaneously. Hence, the locking mechanism isn't working.
Any ideas? Is this normal behaviour for PHP? Can a session only 'access' one page at a time?
Cheers,
Russ
