in reply to Re: Fork and multiple subs
in thread Fork and multiple subs
A fork makes a copy of the data portion of the process, but uses the same code portion, so the number of subs won't affect fork performance
fork doesn't copy anything. Individual memory pages get copied the first time they are changed after a fork. But maybe you were talking abstractly and meant they wouldn't eventually get copied. I don't think that's true either.
Specifically, I'm pretty sure some fields of some ops change during execution (Upd: I'm not so sure anymore ), and I don't think there's any attempt to keep the ops in a separate memory page from variables that may change. Even if ops were sequestered into their own memory page, loading a module or otherwise compiling code after the fork would change the page.
Update: Cleaned up phrasing. Added last sentence.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Fork and multiple subs
by Illuminatus (Curate) on Feb 17, 2011 at 14:00 UTC | |
by Eliya (Vicar) on Feb 17, 2011 at 15:32 UTC | |
by ikegami (Patriarch) on Feb 17, 2011 at 21:31 UTC |