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-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-17 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

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

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-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 Untested Index:

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

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. Did

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

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,

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

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 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 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

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

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 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 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 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 perl code

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

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*