Usenet comp.unix.osf.misc (1992-2004)
 help / color / mirror / Atom feed
From: mauney@adm.csc.ncsu.edu (Jon Mauney)
Subject: Re: Threads better than forks?
Date: Mon, 11 Oct 1993 18:25:18 GMT	[thread overview]
Message-ID: <mauney.750363918@adm> (raw)
In-Reply-To: 1993Oct11.170510.13690@mnemosyne.cs.du.edu

tgeorges@nyx.cs.du.edu (Thomas Georges) writes:

>I just finished the DCE applications programming 3 day class and was 
>discussion some issues with a coworker.  He asked the question, "What's the
>advantage of using threads over fork/exec with signals?"

>Anyone care to post some advantages?  His thought was that the non-threded
>kernels would have lots of overhead that could be avoided by using
>fork and exec.

The two most obvious reasons are efficiency and convenience.

a) Fork is usually a fairly heavyweight operation.  Creating a thread
  should be fairly fast, making it feasible to create a new thread
  as needed.  Also, scheduling of threads within a process doesn't
  require a context switch, and there takes much less time than
  switching between two processes.

2) Because threads share an address space, data communication among threads
  is simpler.  Two communicate between processes you must go to
  some trouble to set up an IPC mechanism.  with threads, the data
  is simply there.
-- 
Jon Mauney, Mauney Computer Consulting
mauney@csc.ncsu.edu   (919) 828-8053

"She wrote a long letter, on a short piece of paper."


  reply	other threads:[~1993-10-11 18:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-10-11 17:05 Threads better than forks? Thomas Georges
1993-10-11 18:25 ` Jon Mauney [this message]
1993-10-12  2:39   ` Thuan Q. Pham
1993-10-12 15:38     ` Lee Sailer
1993-10-12 18:04       ` zac
1993-10-12 18:53       ` Simon Patience
1993-10-14 15:37       ` Jari Tavi
1993-10-14 15:22     ` Steven Wayne Hudson
1993-10-14 18:57       ` Joshua Goldman
1993-10-15 17:39       ` Chris Fulmer
1993-10-14 15:23     ` FAQ request Steven Wayne Hudson
1993-10-13  9:11   ` Threads better than forks? Stuart John Cochran
1993-10-13 12:31     ` Simon Patience
1993-10-11 20:05 ` Brad Daniels
1993-10-12 19:19 ` Rich Salz
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox