On Mon, 2004-02-23 at 20:34, Stas Bekman wrote:
> Richard F. Rebel wrote:
> 
> > Speaking of, does anyone know of a way to tell exactly how many
> > interpreters are running in a given process?
> 
> Sounds like a job for Apache::Status. Though it will need an API to query the 
> interpreter pools which AFAIK don't exist yet. Or may be it'll better suite
> Apache::VMonitor http://search.cpan.org/dist/Apache-VMonitor/. At the moment 
> it will show you all the active threads for each process, though it won't tell 
> you which one is perl and which is not.
> 
> Meanwhile if your interpreters pool is always growing and never get its items 
> killed you can cheat and count the number of started interpreters by defining 
> a function CLONE in some package, e.g. in httpd.conf:

Great hack Stas, but alas, I suspect(all right, I *know*) that there are
interpreters that are getting reaped in my situation.  Is there a
similar magic BLOCK for gc like the 'CLONE' convention?

The CLONE special block should be documented somewhere, who shall I rag
at for that??

And if I( haven't said it b4, thanks for the hard work on mp2...

> <Perl>
> package My::InterpreterCounter;
> use threads;
> use threads::shared;
> my $counter : shared = 0;
> sub CLONE {
>    lock $counter;
>    $counter++;
> }
> sub END {
>    print STDERR "$counter interpreters were started";
> }
> </Perl>
> 
> this is untested... the special function CLONE is called every time a new perl 
> interpreter is created (via perl_clone()). It can exist in any package.
> 
> __________________________________________________________________
> Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
> http://stason.org/     mod_perl Guide ---> http://perl.apache.org
> mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
> http://modperlbook.org http://apache.org   http://ticketmaster.com
-- 
Richard F. Rebel <[EMAIL PROTECTED]>
WhenU.com

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to