Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-18 Thread Mark Blackman
On 18 Apr 2008, at 09:52, Philippe M. Chiasson wrote: Mark Blackman wrote: On 17 Apr 2008, at 07:46, Philippe M. Chiasson wrote: Mark Blackman wrote: On 16 Apr 2008, at 10:24, Mark Blackman wrote: On 16 Apr 2008, at 08:42, Philippe M. Chiasson wrote: Can you try this simple patch and see if

Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-18 Thread Philippe M. Chiasson
Mark Blackman wrote: On 17 Apr 2008, at 07:46, Philippe M. Chiasson wrote: Mark Blackman wrote: On 16 Apr 2008, at 10:24, Mark Blackman wrote: On 16 Apr 2008, at 08:42, Philippe M. Chiasson wrote: Can you try this simple patch and see if it makes your troubles go away. It does indeed have

Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-17 Thread Mark Blackman
On 17 Apr 2008, at 07:46, Philippe M. Chiasson wrote: Mark Blackman wrote: On 16 Apr 2008, at 10:24, Mark Blackman wrote: On 16 Apr 2008, at 08:42, Philippe M. Chiasson wrote: Can you try this simple patch and see if it makes your troubles go away. It does indeed have the desired effect of

Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-16 Thread Philippe M. Chiasson
Mark Blackman wrote: On 16 Apr 2008, at 10:24, Mark Blackman wrote: On 16 Apr 2008, at 08:42, Philippe M. Chiasson wrote: Can you try this simple patch and see if it makes your troubles go away. It does indeed have the desired effect of getting $$ reset to the child pid by the time the PerlCh

Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-16 Thread Mark Blackman
On 16 Apr 2008, at 10:24, Mark Blackman wrote: On 16 Apr 2008, at 08:42, Philippe M. Chiasson wrote: Can you try this simple patch and see if it makes your troubles go away. It does indeed have the desired effect of getting $$ reset to the child pid by the time the PerlChildInitHandler ha

Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-16 Thread Mark Blackman
On 16 Apr 2008, at 08:42, Philippe M. Chiasson wrote: Can you try this simple patch and see if it makes your troubles go away. It does indeed have the desired effect of getting $$ reset to the child pid by the time the PerlChildInitHandler handler is called. - Mark Index: src/modules/p

Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-16 Thread Philippe M. Chiasson
Mark Blackman wrote: On 15 Apr 2008, at 13:51, 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

Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-15 Thread Mark Blackman
On 15 Apr 2008, at 13:51, 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* h

Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-15 Thread Mark Blackman
On 15 Apr 2008, at 17:27, Torsten Foertsch wrote: On Tue 15 Apr 2008, Mark Blackman wrote: int main(int argc, char *argv){ fork(); printf("my pid is %d\n",getpid()); } Please use the fork-syscall here not the C function. Right, the C library will almost certainly use the fork() call h

Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-15 Thread David Nicol
On Tue, Apr 15, 2008 at 8:28 AM, Mark Blackman <[EMAIL PROTECTED]> wrote: > modperl_perl_init_ids() which itself eventually does a > > sv_setiv(GvSV(gv_fetchpv("$", TRUE, SVt_PV)), ids->pid); > > where ids->pid should contain the result of a recent getpid. > > *However* I note that in the main

Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-15 Thread Mark Blackman
On 15 Apr 2008, at 17:27, Torsten Foertsch wrote: On Tue 15 Apr 2008, Mark Blackman wrote: int main(int argc, char *argv){ fork(); printf("my pid is %d\n",getpid()); } Please use the fork-syscall here not the C function. i'm trying to test the C-library behaviour though? in my case,

Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-15 Thread Torsten Foertsch
On Tue 15 Apr 2008, Mark Blackman wrote: > int main(int argc, char *argv){ >    fork(); >   printf("my pid is %d\n",getpid()); > } Please use the fork-syscall here not the C function. Torsten -- Need professional mod_perl support? Just ask me: [EMAIL PROTECTED]

Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-15 Thread Perrin Harkins
On Tue, Apr 15, 2008 at 11:00 AM, Torsten Foertsch <[EMAIL PROTECTED]> wrote: > There was/is a problem in mp1 that it did/does not reinitialize $$ and > getppid(). Under what circumstances? I use $$ all the time and have never seen any sort of caching behavior from it. I use Linux. - Perrin

Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-15 Thread Mark Blackman
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 grate

Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-15 Thread Mark Blackman
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 p

Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-15 Thread Torsten Foertsch
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*

Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-15 Thread Mark Blackman
On 15 Apr 2008, at 14:15, Perrin Harkins wrote: On Tue, Apr 15, 2008 at 9:05 AM, Mark Blackman <[EMAIL PROTECTED]> wrote: My assumption is that perl caches the PID on startup and only reinitializes on perl fork(), thus in the embedded case a fork() outside the perl API doesn't reinitialize

Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-15 Thread Perrin Harkins
On Tue, Apr 15, 2008 at 9:05 AM, Mark Blackman <[EMAIL PROTECTED]> wrote: > My assumption is that perl caches the PID on startup and > only reinitializes on perl fork(), thus in the embedded case > a fork() outside the perl API doesn't reinitialize $$ at least > for some cases. It must be a m

Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-15 Thread Mark Blackman
On 15 Apr 2008, at 13:59, Perrin Harkins wrote: On Tue, Apr 15, 2008 at 8:51 AM, Mark Blackman <[EMAIL PROTECTED]> 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've been using fork, mod

Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-15 Thread Perrin Harkins
On Tue, Apr 15, 2008 at 8:51 AM, Mark Blackman <[EMAIL PROTECTED]> 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've been using fork, mod_perl, and $$ for years without a single problem.

reinitializing Perl's notion of $$ in mod_perl

2008-04-15 Thread Mark Blackman
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. - Mark