Thread: Apache gurus...
View Single Post
Old 05-06-2005   #2
Mr Benn
Members
 
Mr Benn's Avatar
 
Join Date: Oct 2003
Posts: 113
Default

Speaking for Apache 1.3.x, the only way you can share variables accross child processes is through shared memory (shmget() etc). To accomplish this you're going to have to write an Apache module in C. I wrote one a few years ago that used shared memory for tracking some things, if you're having trouble i can dig it out next week.

I don't see much wrong with just reading/incrementing/writing the result to a database though..

If you use an Apache module, you could have more trouble in the future if you want to quickly put your script on other servers etc.

I've got a feeling Apache 2.x can better support "global variables" accross child processes, as i think it uses pthreads instead of fork()ing. I'm not sure though, you'll have to look into it
__________________
MrBenn

"As if by magic, the shopkeeper appeared."
Mr Benn is offline   Reply With Quote