From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f678f,2aedba6752dd2388 X-Google-Attributes: gidf678f,public X-Google-ArrivalTime: 1993-10-11 17:54:35 PST Newsgroups: comp.unix.osf.misc Path: gmd.de!xlink.net!howland.reston.ans.net!europa.eng.gtefsd.com!uunet!tadpole.com!news.dell.com!swrinde!menudo.uh.edu!uuneo!sugar!jabberwock!daniels From: daniels@biles.com (Brad Daniels) Subject: Re: Threads better than forks? Keywords: threads, fork, exec, DCE References: <1993Oct11.170510.13690@mnemosyne.cs.du.edu> Organization: Biles and Associates Date: Mon, 11 Oct 1993 20:05:31 GMT Message-ID: In article <1993Oct11.170510.13690@mnemosyne.cs.du.edu>, Thomas Georges 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) +