Re: localized lexical varibles

[prev] [thread] [next] [Date index for 2005/03/15]

From: Perrin Harkins
Subject: Re: localized lexical varibles
Date: 23:59 on 15 Mar 2005
On Tue, 2005-03-15 at 22:27 +0300, Vladimir D Belousov wrote:
> As I know, my module has been loaded only once and has been loaded by 
> the root httpd process.
> And when any httpd forks exist (prefork), let's present next situation:
> one of the existing httpd forks changes value of any variable (in my 
> example $s).
> Whether value in relation to other existing forks will change?

No.  There is no sharing of variables between mod_perl processes.

> How I understand, the apache creates the new instruction point for each 
> process  - the index to the current instruction (standart in Unix, do 
> not load the code again), but where from does it get the variables and 
> any data?

This is just standard forking stuff.  Forked processes do not share any
data.  There is something called copy-on-write that works to save memory
between forked processes, but no actual sharing of data like you're
talking about here.

- Perrin

localized lexical varibles
Vladimir D Belousov 17:29 on 15 Mar 2005

Re: localized lexical varibles
Michael Peters 17:30 on 15 Mar 2005

Re: localized lexical varibles
Vladimir D Belousov 19:27 on 15 Mar 2005

Re: localized lexical varibles
Perrin Harkins 23:59 on 15 Mar 2005

Re: localized lexical varibles
Tom Schindl 17:40 on 15 Mar 2005

Re: localized lexical varibles
Vladimir D Belousov 18:54 on 15 Mar 2005

Re: localized lexical varibles
Michael Peters 18:59 on 15 Mar 2005

Re: localized lexical varibles
Vladimir D Belousov 19:41 on 15 Mar 2005

Generated at 16:59 on 18 Mar 2005 by mariachi v0.52