>Peter Buckingham <[EMAIL PROTECTED]> wrote: > >> Think of a situation where the memory footprint of the parent is large >> and you want execute something with a small footprint, eg execing >> something from a java process. >> >> The fact that you are execing means you don't need to access the address >> space of the parent for communication so why copy it? (like is done in fork) >> >> Linux uses Copy on Write to address this problem. > >SonOS-4.0 invented copy on write 20 years ago....
I'm fairly certain it was there long before that. The reason vfork() was invented was lack of proper hardware support (buggy hardware in fact) in the VAX 11/7x0 which was used at the time to develop 4.x BSD. But all implementations after that did use COW for fork(). >vfork is still faster because it also borrows the mmu context from the parent. It borrows the page tables. That's much faster than having to go through all pages and mark all writable pages as "Copy-On-Write"; this requires all pages to be marked read-only. Essentiall vfork() is an O(1) operation and fork() O(n) (where n is the size of the address space) Casper _______________________________________________ opensolaris-discuss mailing list opensolaris-discuss@opensolaris.org