scsh-users
[Top] [All Lists]

fork vs. spawn

To: scsh@martigny.ai.mit.edu
Subject: fork vs. spawn
From: wilson@cs.utexas.edu (Paul Wilson)
Date: 7 Aug 1996 13:55:42 -0500
Organization: CS Dept, University of Texas at Austin
Apologies in advance is this is ill-thought-out or uninformed:

My understanding is that Scsh process control is based on UNIX-style
fork(), which may be problematic for non-UNIX OS's, and has potential
implementation inefficiencies, depending on the underlying Scheme
implementation and the OS's further-underlying implementation of
fork.

In most cases, I'd think you could do just as well to use a spawn()
primitive, which spawns a process that doesn't have a copy of lots
of the spawner's state.  (E.g., if I just want to create a process
to run some utility as a stream filter.)

I'd think that spawn could be more portable than fork.  Under UNIX,
you could have a little parent process that you ask to fork copies
of itself when you want to spawn.  The real scsh process would use that
little process as a process creation server.

Comments welcome.

-- 
| Paul R. Wilson, Comp. Sci. Dept., U of Texas @ Austin (wilson@cs.utexas.edu)
| Papers on memory allocators, garbage collection, memory hierarchies,
| persistence and  Scheme interpreters and compilers available via ftp from 
| ftp.cs.utexas.edu, in pub/garbage (or http://www.cs.utexas.edu/users/wilson/) 
     

<Prev in Thread] Current Thread [Next in Thread>