badman wrote:

i create a variable in startup.pl like in ...
http://perl.apache.org/docs/2.0/user/coding/coding.html#Method_Handlers Here use Bird::Eagle;
      $Bird::Global::object = Bird::Eagle->new();
Now i have many instance of this object as any interpreter are in use, am i
right?

Yes, each Apache process has it's own Perl interpreter, so nothing is shared.

So everytime i update some attributes of $Bird::Global::object it change
only in some process.

Yes.

I was asking if there is a way that i could get a really shared variable
among all the process, it could be helpful to investigate threads's module?

Can I ask why? Most people these days are moving away from shared variables in lots of programming contexts (not just Perl or mod_perl). It might seem easier at first, but it actually makes your programs work harder (managing resource locks, semaphores, etc). Using a shared variable means your application will be stuck to just working on a single machine (bye-bye scalability).

Even Google's Chrome (it's new browser) uses a multi-process architecture for some of these same reasons (utilize multiple cores, isolation of concurrent tasks).

--
Michael Peters
Plus Three, LP

Reply via email to