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:03:03 PST Newsgroups: comp.unix.osf.misc Path: gmd.de!xlink.net!howland.reston.ans.net!usc!elroy.jpl.nasa.gov!decwrl!concert!inxs.concert.net!taco!adm!mauney From: mauney@adm.csc.ncsu.edu (Jon Mauney) Subject: Re: Threads better than forks? Message-ID: Keywords: threads, fork, exec, DCE Sender: news@ncsu.edu (USENET News System) Organization: NCSU References: <1993Oct11.170510.13690@mnemosyne.cs.du.edu> Date: Mon, 11 Oct 1993 18:25:18 GMT 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."