Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!sharkey!indetech!rec From: rec@indetech.UUCP (Rick Cobb) Newsgroups: comp.os.minix Subject: Re: fork Summary: Encore has a neat idea (sfork()) Message-ID: <2057@ruby.UUCP> Date: 9 Mar 89 01:04:47 GMT References: <1989Mar3.174924.977@utzoo.uucp> <85830@felix.UUCP> Reply-To: rec@ruby.UUCP (Rick Cobb) Organization: Independence Technologies, Inc. Fremont, CA Lines: 37 Encore has a research system in which fork is broken down to a very fine level of granularity. See ``Variable Weight Processes with Flexible Shared Resources'' in the the _1989 Winter USENIX Conference Proceedings_, available from the USENIX Association, POBox 2299, Berkeley. Their approach has two elements to it: first, you make all the process specific stuff in the kernel (the user and proc structs, call them together the process structure) be accessed through a pointer. I.e., instead of process -> file_descriptor_array you do process -> file_descript_p -> file_descriptor_array You also stuff reference counts in the stuff that's pointed to. Now, you have a kernel where a parent or child can choose *exactly* which parts of their environments to share, and which ones not to share. Then, what sfork() does is to just (1) create a new process pointer (providing a new runtime context only), and (2) copy the references from the process structure of the parent to the child. If you want a *real* fork, you then (could) use the ``resctl'' call to ask that you be given a copy of the parent's resource, instead of the resource itself, or that you be given a freshly initialized structure to point to. They do give a system call interface called fork() which does all the copying. This facility is intended primarily for enhancing sharability of resources; for example, if you do no copying (just an sfork()), you get something about as light as a MACH thread. I haven't thought about what changes or additional features you might give to exec in this system; it seems you might be able to get a faster fork/exec pair from it, though.