Hello James,
суббота, 12 февраля 2000 г., you wrote:
JGS> What you want to do, I think, is something like the following:
JGS> sub tie_keys {
JGS> unless(tied %Keys or not defined $IPC::Shareable::VERSION) {
JGS> tie(%Keys, 'IPC::Shareable', 'abcd', { # random glue...
JGS> mode => 0600, # a bit more secure
JGS> destroy => 'no',
JGS> exclusive => 'no',
JGS> create => 'yes',
JGS> });
JGS> }
JGS> }
My point was NOT to tie separately in each child, but execute tie()
once during startup. The code of module that is being loaded
from startup.pl looks like this:
BEGIN {
use IPC::Shareable;
tie %RADDR_CACHE,
'IPC::Shareable',
{ key => 'href', mode => 0666, create => 1 };
}
[bla-bla-bla]
END {
untie %RADDR_CACHE;
}
It works fine for me, i.e. all children has a proper access to
segment, can read & write all that I need and so on.
But if I tie() with { destroy => 1 }, segment is being destroyed in
approximately 10 seconds after httpd startup (seems like httpd
parent restarts itself after initialization). So I've tried to destroy
segment manually and then found that END {} is not executed during
parent shutdown...
Actually, that is not a REAL problem, because httpd is running already
and garbage collector is on its way ;)
Best regards,
Ilya mailto:[EMAIL PROTECTED]