perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Blackman <m...@blackmans.org>
Subject Re: reinitializing Perl's notion of $$ in mod_perl
Date Tue, 15 Apr 2008 15:29:16 GMT

On 15 Apr 2008, at 16:24, Mark Blackman wrote:
>
> On 15 Apr 2008, at 16:00, Torsten Foertsch wrote:
>> On Tue 15 Apr 2008, Mark Blackman wrote:
>>> While I did find Torsten Förtsch's very useful Perl::AfterFork
>>> module, surely the
>>> mod_perl code must be doing something like this itself, no?
>>>
>>> I'd be grateful to understand mod_perl's response to Perl's
>>> pid caching is, given that forking *will* happen in the mod_perl
>>> environment.
>>
>> There was/is a problem in mp1 that it did/does not reinitialize $$  
>> and
>> getppid(). With mp2 I haven't seen this before.
>>
>> But I have heard of pid caching inside C libraries. Maybe if you  
>> compile
>> modperl with another lib than apache. Then the apache lib caches and
>> reinitializes the pid in one place but modperl uses the other lib.
>
> Well this is a solaris 10 system and so it's just the straight /lib/ 
> libc.so.1
> in both cases.
>
> I'd be surprised if this is the issue. I suppose I could knock up a  
> quick bit of
> C to test it.

#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>

int main(int argc, char *argv){
   fork();
  printf("my pid is %d\n",getpid());
}

which appears to demonstrate no caching of the pid of the system in  
question.

- Mark

>
>
> - Mark
>
>>
>> If you run linux you can have a look at /proc/PID/maps or /proc/ 
>> pid/smaps. At
>> least shared libs are shown there.
>>
>> Torsten
>>
>> --
>> Need professional mod_perl support?
>> Just ask me: torsten.foertsch@gmx.net
>


Mime
View raw message