🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #22737

Re: fork()

#22737
From: Peter H. Golde
Date: Fri, 02 Mar 1990 22:33
24 lines
1338 bytes
In article <37873@cornell.UUCP> huff@cs.cornell.edu (Richard Huff) writes:
>I guess that most people are used to using fork() and not having a
>shared address space between processes.  We could eliminate fork() and
>exec() in favor of create() and activate(), where:
>.........

I fail to see what is wrong the simplest solution of all:
Just a spawn(program, argv, envp) call.  To change the childs
file handles, for example, you

a) switch your file handles around 
b) spawn the child
c) switch your file handle back

This is easy to do with dup() and dup2().  Other things
can be handled similarly..  

More complex uses of fork can be done better using multiple threads
(lightweight processes).  OS/2 for one uses this approach, and
it seems to be pretty easy to use, without the goofiness and
peformance problems of fork(), which can be considerable on
some architectures.

--Peter Golde
Technical Details
Message-ID: <31329@brunix.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!brunix!phg
References: <37873@cornell.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!brunix!phg
From: phg@cs.brown.edu (Peter H. Golde)
Newsgroups: comp.arch
Subject: Re: fork()
Message-ID: <31329@brunix.UUCP>
Date: 2 Mar 90 22:33:33 GMT
References: <37873@cornell.UUCP>
Sender: news@brunix.UUCP
Reply-To: phg@cs.brown.edu (Peter H. Golde)
Distribution: comp
Organization: Brown University Department of Computer Science
Lines: 24