XP is just a number | |
PerlMonks |
Re: Forking and sharing variablesby httptech (Chaplain) |
on May 21, 2000 at 16:38 UTC ( [id://14019]=note: print w/replies, xml ) | Need Help?? |
Ok, a couple of things I ran into. First, you went back to
using 'data' as the glue for IPC::Shareable. If I'm not mistaken,
this would cause a problem if you had more than one instance of
this program running, because they would try to access the same
shared memory segment. That's why I was using the pid of the
process as the glue.
Also, from what I understand, at the end of the program you need to call IPC::Shareable->clean_up or the shared memory segment persists after the program ends, which is probably not desirable. The last thing, which is one I couldn't get past, is that I seem to be running out of memory when creating the tied %mxs hash when using your method of defining it. It doesn't happen on a small list, but when I tried it on a list of 200 addresses I get: So I added size => 8000000 to %options and that just led me to plain old Out of memory! I can't see why it should take more than 8 megabytes of memory to store MX servers for 200 domains. It didn't do this in my example code. But I don't see anything radically different about defining the %mxs hash ahead of time that would cause this. Any ideas?
In Section
Seekers of Perl Wisdom
|
|