Return to BSD News archive
Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.mel.connect.com.au!munnari.OZ.AU!spool.mu.edu!howland.reston.ans.net!newsfeed.internetmci.com!news.kei.com!nntp.coast.net!torn!nott!bcarh189.bnr.ca!bmerhc5e.bnr.ca!bcrkh13.bnr.ca!news From: Will Packard <will@nt.com> Newsgroups: comp.unix.bsd.freebsd.misc,comp.unix.advocacy Subject: Re: Win32 CreateThread() vs Unix fork() Date: 13 Dec 1995 20:35:30 GMT Organization: Northern Telecom Lines: 43 Message-ID: <4andei$hmc@bcrkh13.bnr.ca> References: <4ab85f$idq@news.voicenet.com> <DJBt1u.GFD@tigger.jvnc.net> <4akmsb$qa3@shellx.best.com> <4al3miINNmqt@gambier.ugrad.cs.ubc.ca> NNTP-Posting-Host: nbrwh101.bnr.ca Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 1.1N (X11; I; HP-UX B.10.00 9000/819) X-URL: news://47.8.2.174/4al3miINNmqt@gambier.ugrad.cs.ubc.ca Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:10330 comp.unix.advocacy:12129 c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku) wrote: >In article <4akmsb$qa3@shellx.best.com>, >David Paigen <paigen@shellx.best.com> wrote: >>jlucas@uvi.edu (John Lucas) writes: >> >>>Threads are just another name for "lighweight process"; you often need >>>"heavyweight processes" too. :-} >> >>LWP first came to the commercial unix world, AFAIK, via SunOS circa '90. >>It was one of those things where a customer wanted them so Sun supplied. >>Threads (i.e. LWP) had been in VMS for awhile, I don't know about >>other commercial OSs. >> >>The funny thing is that although LWP VMS were indeed lightweight (say, >>2 lbs. vs. 3 kg.), threads under unix were not, really (3g. vs. 4g.). >> >>Unix process creation is fast, and context switching on unix style >>hardware is even better. LWPs were invented for OSs that were dogs, IMHO. >> <snip> > >Not true. Threaded code can be more succinct and easier to understand than >non-threaded code. The first time I wrote a threaded program, I was hooked. > <snip> I suspect that your comments are summed up by "threaded solutions are better than non-threaded solutions" in the typical single-tasking sense. I think David was comparing UNIX processes to UNIX threads. In general, software solutions in UNIX *do* involve multiple processes, with the accompanying performance and structural benefits. Theoretically, if process context switches are expensive, threading will provide better performance than using separate processes (hence the term "lightweight processes"). Architecturally, there is no difference (ie. high-level software design). The lack of overhead associated with a thread is the reason to use threads instead of separate processes. If you put all kinds of conditions, security, etc. on thread creation, you erode the performance advantage of using threads in the first place. Will