Usenet comp.unix.osf.misc (1992-2004)
 help / color / mirror / Atom feed
From: daniels@biles.com (Brad Daniels)
Subject: Re: Threads better than forks?
Date: Mon, 11 Oct 1993 20:05:31 GMT	[thread overview]
Message-ID: <CEr158.6K2@biles.com> (raw)
In-Reply-To: 1993Oct11.170510.13690@mnemosyne.cs.du.edu

In article <1993Oct11.170510.13690@mnemosyne.cs.du.edu>,
Thomas Georges <tgeorges@nyx.cs.du.edu> wrote:
>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?"

Apart from system overhead issues, there is the fact that threads share a
common data space.  This means you can pass information from one thread
to another without copying.  While you can achieve similar effects with
shared memory and multiple processes, managing the situation is more
complex and expensive.

Also, in the case of RPC communications, it is feasible to start up
as many threads as you want to simplify your algorithm.  For example,
in our package, we may use RPC to communicate with as many as 10 or
20 different data servers, and we may have several different scan rates
for querying each server.  Rather than deal with juggling servers,
finding lowest common denominator scan rates per server, deciding how
many communication processes to start, and deciding how to divvy up
shared memory among the logically independent communication
operations, we decided to simply start one thread per data source and
scan rate.  We have one connection per data source, and all the different
scan rates' threads use that one connection, so we also minimize the number
of network connections.

- Brad
-- 
----------------------------------------------------------------------
+ Brad Daniels			| "Let others praise ancient times;  +
+ Biles and Associates		|  I am glad I was born in these."   +
+ These are my views, not B&A's	|	  - Ovid(43 B.C - 17 A.D)    +


  parent reply	other threads:[~1993-10-11 20:05 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
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 [this message]
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