I have resorted to polling a little file from inside the CGI script. The file can contain either '0' or '1', indicating that the script should abort. This works, too. However, the file I/O itself takes a lot of time relatively speaking, and I was wondering if there is more elegant way of doing this? I can only check it every 4 or 5 million iterations, otherwise I run into problems. I can live with that, but I am wondering if I could do it with an environment variable, for example?
Thanks for any tips!
After some preliminary tests, it seems that the shared memory facilities offered by PHP
shmop will be the easiest and safest to use in the current server environment available to me. Many thanks to Adrian Colomitchi who pointed me in the right direction (RAM disk == shared memory)!