spawning a child by double forking

Peter da Silva peter at ficc.uu.net
Tue Jul 4 07:45:13 AEST 1989


In article <12376 at bloom-beacon.MIT.EDU>, jik at athena.mit.edu (Jonathan I. Kamens) writes:
>   Second, let's say that my program has a 512k binary image.  I fork
> the first time, and I'm taking up a meg of memory.  I fork again, and
> I'm taking up a meg and a half.

Not if you have a modern fork() that does copy-on-write. And even if you
have a stupid fork you probably have vfork(). The cost of forking
children is really pretty minor these days. (yow, an innovation that
actually REDUCES memory use! Must be a mistake!)
-- 
Peter da Silva, Xenix Support, Ferranti International Controls Corporation.
Business: peter at ficc.uu.net, +1 713 274 5180. | "X3J11 is not in the business
Personal: peter at sugar.hackercorp.com.         |  of legislating morality ..."
Quote: Have you hugged your wolf today? `-_-' |      -- Henry Spencer



More information about the Comp.unix.questions mailing list