[mod_python] Please help me :)

mod_python at mikebell.org mod_python at mikebell.org
Sat May 17 00:18:56 EST 2003


On Fri, May 16, 2003 at 02:43:17PM -0700, Michael Gibbs wrote:
> Our problem is that we are trying to maintain a counter using a global 
> variable. However the script returns different values when multiple browser 
> form requests are being submitted. The counter seems to get changed by 
> different requests but not as expected. Are we doing something wrong?

Your global variables will only be shared by requests handled by the
same interpreter. Each apache process forked has its own. You need to
use some form of shared memory to get multiple processes to share a
counter, be it by mmaping a file or using a database connection or
whatever.


More information about the Mod_python mailing list