Re: Singleton Persistence

Perrin Harkins <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <CAC0_be1PFz86YTxTNKOLvjmP7-2RP67SuW+MfODHzYSNT8A0Qg@mail.gmail.com>
On Sat, Feb 1, 2014 at 8:14 PM, John Dunlap <[email protected]> wrote:
> In mod_perl, can instantiated singletons survive requests?

Sure, anything you put in a global will survive until the httpd child
process is shut down.  How many requests each child serves depends on
your configuration.  When a new child starts up, it will have the same
state as the parent process, so if you put something into a global in
the parent, it will be there in the children.  There is no sharing
between processes though, so changes in a child process will not be
reflected in the other processes or in newly spawned ones.

- Perrin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.