perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank Maas" <>
Subject RE: handler object: data sometimes resetting
Date Wed, 28 Sep 2005 09:50:53 GMT
> Thanks, Frank, thanks, Damyan, for your answers.
> I've add testing info to my script, as you recommend:
> Editing: [2612]8068957.60529976$self current=0
> Editing: [2613]8068957.60529976$self current=0
> Editing: [2614]8068957.60529976$self current=0
> Editing: [2614]8068957.60529976$self current=1
> Editing: [2614]8068957.60529976$self current=2
> So, you were right, it's different processes. So, i have more
> questions about it: 
> 1) Why the address of object is the same, but it has different
> values? I can't imagine, how this could be.. Where can i find more
> info about it? 

The address that is returned is an address in the memory space of 
the running perl interpreter. If you start two interpreters with the
same process, then there is a very good chance that the address is
the same. The address is not an absolute address pointing towards a
shared memory location!

> 2) How can i avoid such problem (i mean not
> reconfigure apache to use 1 process, just write correct Perl script
> to store data between processes). I want, as example, "edited" field
> to be increasing on each request regardless of the process which
> handle this request. 

What you are looking for is sharing data between processes. Using
Google or the archives of this mailinglist 
should give you enough information. I've seen proposed solutions with 
memcached, IPC, a special session, some kind of shared memory, a database 
table and more.

Good luck!


View raw message