alliance-programmers '02
Re: vfork in mbk


Frédéric Pétrot (Frederic.Petrot@lip6.fr)
Wed, 23 Jan 2002 17:56:04 +0100

On Wed, Jan 23, 2002 at 05:19:35PM +0100, Pierre NGUYEN-TUONG wrote: > Hello, > > mbk is using vfork instead of fork (file sources/mbk/mbk_sys.c). Reading > the vfork manual, you can > see that > > " BUGS > It is rather unfortunate that Linux revived this spectre from > the past. The BSD manpage states: "This > system call will be eliminated when proper system sharing > mechanisms are implemented. Users should not > depend on the memory sharing semantics of vfork as it will, in > that case, be made synonymous to fork."" > > Besides vfork doesn't exist on IRIX. Surprising, no ? Is there a -good- > reason to maintain vfork in mbk ? I read from the Solaris manual (and it is also partly evocated in the Linux one) : «~vfork - spawn new process in a virtual memory efficient way~» The reason why vfork was prefered is linked to resource usage, since it avoids lots of memory allocation and duplications. Grossly, vfork runs in its parent memory whereas fork duplicate the parent memory prior to run in it. This is particularly sensitive on older machines with fewer resources. Now if vfork poses a portability problem, lets remove it, since its behavior is more constrained that the one of vfork. We could has well detect its existance (using for example autoconf), and then compile conditionally, but this is an other story. See ya, Fred -- @----------------------,-,-----,-------------------------------------@ |Ad augusta Frederic PETROT: MC d'ASIM/LIP6/UPMC (Paris VI) | |Per angusta 65-66/403 4 place Jussieu, 75252 Paris Cedex 05 | |Work:331 44275415 Fax:331 44277280 Frederic.Petrot@lip6.fr | |Home:331 47129513 //www-asim.lip6.fr/~fred/ | @--------------------------------------------------------------------@

 



Alliance Web Site © 1997, 2002 ASIM/LIP6/UPMC, page maintained by Czo [Olivier Sirol] , last updated on 24 January 2002.