Usenet comp.unix.osf.misc (1992-2004)
 help / color / mirror / Atom feed
From: zac@tractor.austin.ibm.com
Subject: Re: Threads better than forks?
Date: Tue, 12 Oct 1993 18:04:55 GMT	[thread overview]
Message-ID: <CEsq87.F12@hawnews.watson.ibm.com> (raw)
In-Reply-To: 29ej1h$n33@hpuerca.atl.hp.com

In <29ej1h$n33@hpuerca.atl.hp.com>, sailer@atl.hp.com (Lee Sailer) writes:
>Another difference between threads (tasks) and processes that I'm not quite
>sure about has to do with scheduling.  As I understand it, all a process's
>tasks share that one process's timeslice.  On the other hand, forked
>process's each get a timeslice of their own.
>
>  If this is true, than a function devided into 5 processes might execute
>faster than the same function divided into 5 threads within one process,
>since the 5 process solution would get five times the cpu time.
>
>  lee


This is true only for user-level threads.  User-level thread libraries are 
cooperatively multitasked within a process' time-slice - the kernel doesn't
know anything about them.  A process only has a single thread of execution 
to work with.  With kernel-level threads OTOH, the thread is the unit of
scheduling.  In other words the scheduler doesn't even deal with processes
but just with threads.  In this case a process starting 5 threads would get
the same average cpu time as 5 single-threaded processes (assuming all the
other variables like priority and i/o are kept equal).


Zac 

     I don't speak for IBM.  Heck, I don't even WORK for IBM.



  reply	other threads:[~1993-10-12 18:04 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 [this message]
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