I'm working on a large system running under HP-UX 10.xx (on 9000/700
series machines).We need to spawn processes from a main application. This
main application is huge (image size currently approx. 40MB and growing -
don't know off hand the split between text, BSS etc). To spawn the
processes we must do the standard "fork"-"exec.." call sequence. The
fork() system call creates "an exact copy of the calling process"
(quote from the HP-UX 10.01 fork(2) man entry).
Can anyone tell me what exactly is copied by the fork() call? I know that
there must be something like a "process control block" created for the
child (it will mostly be a copy of the parent's), but is the program text
and data actually copied? In a virtual memory system like HP-UX 10.xx is
any significant amount of memory actually allocated and copied (apart
from, say, the one page containing the program counter at the time of the
fork)? My concern here is that there may be a large CPU cycle and/or
memory overhead in forking a process this large.
The man entry for vfork(2) indicates that this call *may* be more
efficient, but the implementation is free to treat this call as being
identical to fork. In the case of HP-UX 10.xx (xx=01 or 1) is vfork "a
higher performance version of fork()"?
(not the address on this posting's header) as well as a posting (in case
others are interested).
Thanks very much,