Implementing `fork' in a single address space

Peter da Silva peter at ficc.uu.net
Wed Dec 13 10:34:40 AEST 1989


This is why I wish POSIX provided an alternative to the fork() semantics:

In article <10131 at june.cs.washington.edu> pardo at june.cs.washington.edu (David Keppel) writes:
> I'm having problems figuring out how to implement `fork' correctly in
> one address space.

You have to copy the entire stack and data segment on a context switch while
the two forks of the program are both running. This is typically implemented
by forcing them to swap. Once one exits or execs, you can quit doing it.

> * Are there any pd (public-domain, or freeware) micro-unicies that I
>   can look at?

MINIX, by Andy Tannenbaum. ast at cs.vu.nl
-- 
`-_-' Peter da Silva. +1 713 274 5180. <peter at ficc.uu.net>.
 'U`  Also <peter at ficc.lonestar.org> or <peter at sugar.lonestar.org>.
"It was just dumb luck that Unix managed to break through the Stupidity Barrier
and become popular in spite of its inherent elegance." -- gavin at krypton.sgi.com



More information about the Comp.unix.questions mailing list