I just cant get the following in my brain.  I have a modules that is
started with apache using the PerlModule-directive in httpd.conf.

This module defines a global pointer on startup that should be the
same in all sub-instances of httpd and really in the current
apache-session all instances print out : $g_ptr : HASH(0x8458a30)

This hashpointer is later filled with different values (dbhandles,
filehandles ...) that should kept open over more calls.

Now each session has the same pointer, but the content of the
anonymous hash its pointing too is different in each instance !!

thread 1:
$g_ptr : HASH(0x8458a30)
$g_ptr->{counter} : SCALAR(0x85aa62c)

thread 2:
$g_ptr : HASH(0x8458a30)
$g_ptr->{counter} : SCALAR(0x85f5e2c)

A even more strange example is an anonmous array that has the same
adress, but different content too.

The only explanation is that there is some mem-mapping for each
httpd-instance, but I dont know much about this.

My problem now is, that each httpd-instance opens a lot of db-handles
and connections and I end up with system-errors 'to many files opened'
or such things. 

Is there any way to share handles between all instances (I guess not,
and I'm sure this mem-mapping has a deeper meaning too: if more than
one instance access the same adress at the same time there would be
lot of troubles and I'm even more sure that this has something to do
with the copy-on-write feature of fork(), but I'm just not good in
this things, so I'd like to have some comment to be sure that this is
a principal problem and not a problem of my module)

thnx,
peter

-- 
mag. peter pilsl

phone: +43 676 3574035
fax  : +43 676 3546512
email: [EMAIL PROTECTED]
sms  : [EMAIL PROTECTED]

pgp-key available

Reply via email to