Dec 18, 2014, 6:22 AM
"Locking" the script implies that only 1 instance of the script should be running at any given time, which goes against one of the requirements in the opening post.
Re: [Zhris] simultaneous exection of script on webpage
how can I make the script so that it can execute simultaneously on different requests ?
Now, the new question/requirement.
If the script is running everytime anew, how would I get it to know what is the correct entry in the database table to use, so that it does not repeat itself ? Delete the entry, I guess ?We don't have enough info on what the script does or how the data is being used to be able to properly answer that question. However, instead of locking the script to a single instance, it may be more appropriate to do the locking at the DB (either table locking or row locking depending on the storage engine). Using a storage engine that supports transactions would be best and is what is needed to support row level locking.
If the processing script takes 45+ minutes to complete, my first suggestion would be to profile the script to see if there are bottlenecks that can be optimized.
(This post was edited by FishMonger on Dec 18, 2014, 6:23 AM)