Linux and GC
Kragen
kragen@pobox.com
Tue, 12 May 1998 17:27:00 -0400 (EDT)
On Tue, 12 May 1998, Scott L. Burson wrote:
> Well, on most Unix machines, it will involve at least allocating enough
> swap space to hold the entire address space if necessary, and possibly
> actually copying the entire address space. On Linux, it will only
> involve allocating a new page table and process structure for the child
> and enough swap space to hold whatever pages get mutated while the gc
> is trying to scan them.
>
> Linux is not the first Unix to have this feature by any means. Berkeley Unix
> (the first virtual-memory Unix) had it more-or-less from the beginning (circa
> 1980), although one had to make a different system call (`vfork' instead of
> `fork'). The only difference with Linux is that the old `fork' functionality
> is gone; `fork' and `vfork' do the same thing.
No, vfork() is very different. vfork() suspends the parent process
until the child process calls exec(), in order to avoid the potentially
immense overhead of copying the whole memory space. Linux doesen't
need a separate vfork() because its fork() just marks things as
copy-on-write.
Using vfork() on a 4.2BSD system for this would turn this into a
remarkably obtuse way to write a pausing collector.
Perhaps someone could check a 4.4BSD man page to see if that's still
what vfork() does.
Kragen