in reply to collective unconcious (about shared memory...)
On most modern versions of Unix, all new processes will initially share all (or nearly all) of their memory with their parent (each new process gets its own new list of page table entries that define how to map virtual memory address ranges into real memory and/or swap space pages). After that, when any of the related processes writes to a shared page of memory, a fault will occur which will cause that page of memory to be copied to a page that is local to the writing process.
So you have to let your fork()ed processes run for a while before you can get a feel for how much memory they will manage to continue to share.
Since IO::Socket::SSL eventually uses some C code, you should be sure to put that code into a shared library. That way that chunk of memory will always remain shared between all processes (even if they aren't related) since the shared library is loaded using mmap (or an equivalent).
Perl code compiles to an opcode tree. I'm curious if Perl manages to leave large chunks of this tree as read-only so that related processes can continue to share that memory.
- tye (but my friends call me "Tye")
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (tye)Re: collective unconcious (about shared memory...)
by dws (Chancellor) on Apr 17, 2001 at 08:15 UTC | |
by tye (Sage) on Apr 17, 2001 at 08:35 UTC | |
by tilly (Archbishop) on Apr 17, 2001 at 15:27 UTC | |
|
Re: (tye)Re: collective unconcious (about shared memory...)
by dshahin (Pilgrim) on Apr 17, 2001 at 21:47 UTC | |
by tye (Sage) on Apr 17, 2001 at 22:08 UTC |