Path: utzoo!attcan!uunet!peregrine!ccicpg!cci632!rit!tropix!moscom!ur-valhalla!uhura.cc.rochester.edu!rochester!rutgers!cmcl2!phri!marob!daveh From: daveh@marob.masa.com (Dave Hammond) Newsgroups: comp.unix.questions Subject: Using vfork() -vs fork() Message-ID: <1989Jun19.013230.16107@marob.masa.com> Date: 22 Jul 89 01:32:30 GMT Sender: daveh@marob.masa.com Reply-To: daveh@marob.masa.com (Dave Hammond) Organization: ESCC, New York City Lines: 24 Pertaining to vfork() and fork() usage in Berkely-specific C programs: From what I can glean from the manual, the advantages of vfork() over fork() are (1) virtual memory efficiency and (2) shared access to parent memory, data structures, etc. until an execv(). The disadvantage seems to be that returning to the parent context while the childs context still exists does not work. Does this mean that spawning an asynchronous process via vfork() is not possible? My application wants to spawn children to: (1) execute adhoc subtasks (like `system("command")' ). (2) execute adhoc subtasks asynchronously (like `system("command &")' ). (3) execute cooperative subtasks for data sharing (like `popen("command")' ). My feeling is that vfork() is less appropo for this application than fork(). Am I offbase about this? Can someone provide concrete examples of where I'd want to use vfork(), rather than fork()? -- Dave Hammond daveh@marob.masa.com