🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: mod.computers.68k
Article #217

Re: Questions about the use of fork()

#217
From: mouse
Date: Tue, 31 Mar 1987 00:08
33 lines
2314 bytes
In article <8703210641.AA09391@violet.berkeley.edu>, mwm@VIOLET.BERKELEY.EDU (Mike  Meyer, No one lives forever.) writes:
[ stuff about how using fexec() because it covers 99% of the cases is a
  bad idea - I agree. ]
> What I prefer is two system calls:

> 2) newthread - roughly, vfork in 4BSD. This creates another process
> that shares all resources with the parent. If either one does an
> exit() (or exec()) the other one just continues. YOu probably want to
> schedule the child to run first. Some technic for rendezvous will be
> required.

> Newthread gives you the capabilities of Unix fork/exec, you just
> have to take more care about things. It should cover all the cases you
> want fork for. Of course, the cases you want it for fork/exec

Heavens no.  Do you realize what concurrent execution with shared stack
segments means?!  Shared text is OK, and is in fact used.  Shared data
can be useful but is normally a pain for tasks where you want fork()
but not fexec().  Shared stack is a disaster, *unless*, as in BSD
vfork(), one process waits until the other exit()s (or exec()s).  Even
then, vfork() is annoying in its restrictions.

fork() is nice when you want to keep all the code in one process
(fexec() requires having the child's program in another file somewhere,
and wiring its name in somehow - using fork() means the binary is
self-contained and more portable).

					der Mouse

Smart mailers: mouse@mcgill-vision.uucp
USA: {ihnp4,decvax,akgua,utzoo,etc}!utcsri!musocs!mcgill-vision!mouse
     think!mosart!mcgill-vision!mouse
ARPAnet: think!mosart!mcgill-vision!mouse@harvard.harvard.edu
Technical Details
Message-ID: <8703310008.AA20068@larry.ee.mcgill>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watnot!watmath!clyde!rutgers!ames!ucbcad!ucbvax!mcgill-vision.UUCP!mouse
References: <8703210641.AA09391@violet.berkeley.edu>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watnot!watmath!clyde!rutgers!ames!ucbcad!ucbvax!mcgill-vision.UUCP!mouse
From: mouse@mcgill-vision.UUCP.UUCP
Newsgroups: mod.computers.68k
Subject: Re: Questions about the use of fork()
Message-ID: <8703310008.AA20068@larry.ee.mcgill>
Date: Mon, 30-Mar-87 19:08:45 EST
Article-I.D.: larry.8703310008.AA20068
Posted: Mon Mar 30 19:08:45 1987
Date-Received: Wed, 1-Apr-87 07:26:52 EST
References: <8703210641.AA09391@violet.berkeley.edu>
Sender: mwm@ucbvax.BERKELEY.EDU
Distribution: world
Organization: The ARPA Internet
Lines: 33
Approved: info-68k@ucbvax.berkeley.edu