Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* Understanding threads in Unix
@ 1998-09-27  4:00 lo tek
  1998-09-28  4:00 ` William LeFebvre
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: lo tek @ 1998-09-27  4:00 UTC (permalink / raw)


I was a Windows NT programmer before becoming web master and (kind of) a
Unix admin. I have begun to evaluate upgrading our DEC Unix platform to
either AIX or Solaris. (Why get rid of DEC - concern about its future
due to Compaq's ties to microsoft, availability of off-the-shelf
software, et al) Anyway, I've heard that some Unix OSes don't have
threads. I have a Linux workstation, and I believe Linux has threads. Is
this a System V versus OSF thing?

>From what I understand on NT, a new thread is different from a new
process in that a new thread gets its own stack but not its own heap.
This means it's faster to initialize a new thread instead of a new
process. The advantage is that, for example, a web server only uses new
threads to handle each request, instead of "blocking" requests and using
new processes.

How do AIX and Solaris compare in this regard? If neither has threads,
or neither has many apps that use threads, is this a performance
problem? Certainly I'm not suggesting NT would outperform. :) If both
have threads, which is more stable? Also, if an OS doesn't have threads,
an app may wish to emulate a threaded
environment, forcing each vendor to recreate threading which is probably
not trivial, and therefore error-prone.

tia,
lo tek

ps - if you could, when you reply to the newsgroup, please send a copy
to lotek@iname.com



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Understanding threads in Unix
  1998-09-27  4:00 Understanding threads in Unix lo tek
  1998-09-28  4:00 ` William LeFebvre
@ 1998-09-28  4:00 ` Ben Elliston
  1998-09-29  4:00   ` Patrick TJ McPhee
  1998-10-01  4:00 ` Jason Rosenberg
  2 siblings, 1 reply; 8+ messages in thread
From: Ben Elliston @ 1998-09-28  4:00 UTC (permalink / raw)


lo tek <lotek@iname.com> writes:

> I was a Windows NT programmer before becoming web master and (kind of) a
> Unix admin. I have begun to evaluate upgrading our DEC Unix platform to
> either AIX or Solaris. (Why get rid of DEC - concern about its future
> due to Compaq's ties to microsoft, availability of off-the-shelf
> software, et al) Anyway, I've heard that some Unix OSes don't have
> threads. I have a Linux workstation, and I believe Linux has threads. Is

This is true--some Unix OSes don't have threads.  But most popular
ones do.

> this a System V versus OSF thing?

No.  It's just a vendor decision.

> How do AIX and Solaris compare in this regard? If neither has threads,
> or neither has many apps that use threads, is this a performance
> problem? Certainly I'm not suggesting NT would outperform. :) If
> both

If you're worried about Web server performance, then evaulate the
server software on the three (AIX, Solaris, NT) platforms on face
value.  Don't worry about how they're implemented.

Recent versions (within the last few years) of AIX and Solaris both
have threads.  Solaris has UNIX Int'l threads (and now pthreads) and
AIX has a fairly recent draft of POSIX threads.  Can anyone comment on
what draft level IBM implemented in AIX 4.2 (or later)?

> have threads, which is more stable? Also, if an OS doesn't have
> threads,

I can't comment on the relative stability of these two OSs.  They both
have their bugs.  But doing something common like running a Web server
shouldn't cause you any stability problems.

Ben

---
Ben Elliston
bje@cygnus.com




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Understanding threads in Unix
  1998-09-27  4:00 Understanding threads in Unix lo tek
@ 1998-09-28  4:00 ` William LeFebvre
  1998-09-30  4:00   ` Mark
  1998-09-28  4:00 ` Ben Elliston
  1998-10-01  4:00 ` Jason Rosenberg
  2 siblings, 1 reply; 8+ messages in thread
From: William LeFebvre @ 1998-09-28  4:00 UTC (permalink / raw)


In article <360F04C1.ECAD5E9@iname.com>, lo tek  <lotek@iname.com> wrote:
>>From what I understand on NT, a new thread is different from a new
>process in that a new thread gets its own stack but not its own heap.

What's a heap?  :-)

In Unix, multiple threads execute in the same virtual memory space.
They each have their own execution context (registers including PC
and stack pointer) but they all share the same virtual memory space.
Processes have separate memory spaces as well as execution contexts.

>This means it's faster to initialize a new thread instead of a new
>process.

That's correct (in general).  It also takes fewer resources.

>The advantage is that, for example, a web server only uses new
>threads to handle each request, instead of "blocking" requests and using
>new processes.

Well, the request wouldn't explicitly block.  Instead it would have to
wait as a new process was created, or as the request was dispatched to
a waiting process (which may then have to be paged in).

>How do AIX and Solaris compare in this regard? If neither has threads,
>or neither has many apps that use threads, is this a performance
>problem? Certainly I'm not suggesting NT would outperform. :) If both
>have threads, which is more stable? Also, if an OS doesn't have threads,
>an app may wish to emulate a threaded
>environment, forcing each vendor to recreate threading which is probably
>not trivial, and therefore error-prone.

Okay, there's threads and there's kernel entities.  A thread is a
virtual object, but a kernel entity is a specific OS's mechanism
for implementing multiple contexts in a single process.  In Solaris
these are called lightweight processes.  You *must* treat these
two items separately.

It is true that threads can be implemented with any sort of API.
There is a POSIX standard threads api called "pthreads" and it is very
widely deployed across many Unix variants.  Before pthreads, some
vendors did implement their own threads mechanism, and it was quickly
headed to the chaotic world you evisioned.  But everyone now is moving
towards pthreads.  This is a good thing.

How a pthreads thread is mapped on to a kernel entity is completely up
to the OS.  Those systems which have no support for kernel-based
threading have no choice but to implement threads in a software
library.  They can do this and still retain the pthreads semantics.
Those systems which have the ability may choose to map threads to
kernel entities one-to-one.  But the better systems implement 2-level
or many-to-few: threads are bound to and unbound from kernel entities
as needed.  This is conceptually similar to how virtual pages are
mapped to physical pages.  One kernel entity (LWP) may handle s
variety of threads throughout its lifetime.

For more info, read my Performance Computing column on Threaded
Programming.  It was published in the September 1998 edition.  Visit:
http://www.performancecomputing.com/columns/daemons/9809.shtml

Better yet, get Butenhof's book.

-- 
				William LeFebvre
				Group sys Consulting
				<wnl@groupsys.com>
				+1 770 813 3224



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Understanding threads in Unix
  1998-09-28  4:00 ` Ben Elliston
@ 1998-09-29  4:00   ` Patrick TJ McPhee
  0 siblings, 0 replies; 8+ messages in thread
From: Patrick TJ McPhee @ 1998-09-29  4:00 UTC (permalink / raw)


In article <m2u31s994m.fsf@dublin.cygnus.com>,
Ben Elliston  <bje@cygnus.com> wrote:

% Recent versions (within the last few years) of AIX and Solaris both
% have threads.  Solaris has UNIX Int'l threads (and now pthreads) and
% AIX has a fairly recent draft of POSIX threads.  Can anyone comment on
% what draft level IBM implemented in AIX 4.2 (or later)?

4.3 has posix threads. 4.1 and 4.2 have, I believe, draft 7 pthreads.

Digital Unix 4.0d seems very fast and stable to me. I'm not sure I would
move off to some other platform unless I was actually having a problem
with it.
--

Patrick TJ McPhee
East York  Canada
ptjm@interlog.com



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Understanding threads in Unix
  1998-09-28  4:00 ` William LeFebvre
@ 1998-09-30  4:00   ` Mark
  0 siblings, 0 replies; 8+ messages in thread
From: Mark @ 1998-09-30  4:00 UTC (permalink / raw)
  To: drushing

William LeFebvre wrote:
> 
> In article <360F04C1.ECAD5E9@iname.com>, lo tek  <lotek@iname.com> wrote:
> >>From what I understand on NT, a new thread is different from a new
> >process in that a new thread gets its own stack but not its own heap.
> 
> What's a heap?  :-)
> 
> In Unix, multiple threads execute in the same virtual memory space.
> They each have their own execution context (registers including PC
> and stack pointer) but they all share the same virtual memory space.
> Processes have separate memory spaces as well as execution contexts.
> 
> >This means it's faster to initialize a new thread instead of a new
> >process.
> 
> That's correct (in general).  It also takes fewer resources.
> 
> >The advantage is that, for example, a web server only uses new
> >threads to handle each request, instead of "blocking" requests and using
> >new processes.
> 
> Well, the request wouldn't explicitly block.  Instead it would have to
> wait as a new process was created, or as the request was dispatched to
> a waiting process (which may then have to be paged in).
> 
> >How do AIX and Solaris compare in this regard? If neither has threads,
> >or neither has many apps that use threads, is this a performance
> >problem? Certainly I'm not suggesting NT would outperform. :) If both
> >have threads, which is more stable? Also, if an OS doesn't have threads,
> >an app may wish to emulate a threaded
> >environment, forcing each vendor to recreate threading which is probably
> >not trivial, and therefore error-prone.
> 
> Okay, there's threads and there's kernel entities.  A thread is a
> virtual object, but a kernel entity is a specific OS's mechanism
> for implementing multiple contexts in a single process.  In Solaris
> these are called lightweight processes.  You *must* treat these
> two items separately.
> 
> It is true that threads can be implemented with any sort of API.
> There is a POSIX standard threads api called "pthreads" and it is very
> widely deployed across many Unix variants.  Before pthreads, some
> vendors did implement their own threads mechanism, and it was quickly
> headed to the chaotic world you evisioned.  But everyone now is moving
> towards pthreads.  This is a good thing.
> 
> How a pthreads thread is mapped on to a kernel entity is completely up
> to the OS.  Those systems which have no support for kernel-based
> threading have no choice but to implement threads in a software
> library.  They can do this and still retain the pthreads semantics.
> Those systems which have the ability may choose to map threads to
> kernel entities one-to-one.  But the better systems implement 2-level
> or many-to-few: threads are bound to and unbound from kernel entities
> as needed.  This is conceptually similar to how virtual pages are
> mapped to physical pages.  One kernel entity (LWP) may handle s
> variety of threads throughout its lifetime.
> 
> For more info, read my Performance Computing column on Threaded
> Programming.  It was published in the September 1998 edition.  Visit:
> http://www.performancecomputing.com/columns/daemons/9809.shtml
> 
> Better yet, get Butenhof's book.
> 
> --
>                                 William LeFebvre
>                                 Group sys Consulting
>                                 <wnl@groupsys.com>
>                                 +1 770 813 3224
Thanks for this useful information



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Understanding threads in Unix
  1998-10-02  4:00   ` Mark & Suzanne (gcs might work)
@ 1998-10-01  4:00     ` Chad Schrock
  0 siblings, 0 replies; 8+ messages in thread
From: Chad Schrock @ 1998-10-01  4:00 UTC (permalink / raw)


Mark & Suzanne (gcs might work) wrote:

--snip--

> 3/ its almost always had the fastest CPU. BTW 612MHZ alpha chips
> are only just keeping on par with top end CPU around the block.
> Its not till next month when customers can start getting the new
> EV6 chips into machines that this will change again. 

Next month?  That would be a pleasant surprise.

The last I heard, DEC/Compaq wasn't going to be able to ship 
machines with the EV6 processors until sometime after the 
first of the year, optimistically.


chad

--
chad@		
radix.net



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Understanding threads in Unix
  1998-09-27  4:00 Understanding threads in Unix lo tek
  1998-09-28  4:00 ` William LeFebvre
  1998-09-28  4:00 ` Ben Elliston
@ 1998-10-01  4:00 ` Jason Rosenberg
  1998-10-02  4:00   ` Mark & Suzanne (gcs might work)
  2 siblings, 1 reply; 8+ messages in thread
From: Jason Rosenberg @ 1998-10-01  4:00 UTC (permalink / raw)
  To: lo tek

Seriously,

I think any concerns about the future of Digital Unix are unfounded.
Furthermore, Digital Unix is in my opinion the fastest and cleanest
flavor of Unix on the market, and has the cleanest and most stable
implementation of pthreads out there.  You ought to really
evaluate your inclination to switch.  A switch to AIX would be
a disaster, AIX is nothing but problems.  

You just aren't going to beat the speed of the Alpha processor right
now.

Jason

lo tek wrote:
> 
> I was a Windows NT programmer before becoming web master and (kind of) a
> Unix admin. I have begun to evaluate upgrading our DEC Unix platform to
> either AIX or Solaris. (Why get rid of DEC - concern about its future
> due to Compaq's ties to microsoft, availability of off-the-shelf
> software, et al) Anyway, I've heard that some Unix OSes don't have
> threads. I have a Linux workstation, and I believe Linux has threads. Is
> this a System V versus OSF thing?
> 
> >From what I understand on NT, a new thread is different from a new
> process in that a new thread gets its own stack but not its own heap.
> This means it's faster to initialize a new thread instead of a new
> process. The advantage is that, for example, a web server only uses new
> threads to handle each request, instead of "blocking" requests and using
> new processes.
> 
> How do AIX and Solaris compare in this regard? If neither has threads,
> or neither has many apps that use threads, is this a performance
> problem? Certainly I'm not suggesting NT would outperform. :) If both
> have threads, which is more stable? Also, if an OS doesn't have threads,
> an app may wish to emulate a threaded
> environment, forcing each vendor to recreate threading which is probably
> not trivial, and therefore error-prone.
> 
> tia,
> lo tek
> 
> ps - if you could, when you reply to the newsgroup, please send a copy
> to lotek@iname.com



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Understanding threads in Unix
  1998-10-01  4:00 ` Jason Rosenberg
@ 1998-10-02  4:00   ` Mark & Suzanne (gcs might work)
  1998-10-01  4:00     ` Chad Schrock
  0 siblings, 1 reply; 8+ messages in thread
From: Mark & Suzanne (gcs might work) @ 1998-10-02  4:00 UTC (permalink / raw)


Jason Rosenberg wrote:
> 
> Seriously,
> 
> evaluate your inclination to switch.  A switch to AIX would be
> a disaster, AIX is nothing but problems.

A switch to anything is not usually a good problem fix. AIX is ok
Its not as nice as Digital UNIX however :). Could be worse they my
have switched to NT :)

> 
> You just aren't going to beat the speed of the Alpha processor right
> now.

	Now thats just marketing crap. Comparing the top processor
from various people may lead to such a statement but not everyone buys
or has the latest greatest CPU from the vendor nor do they need it.
So just because I sit behind a EV45 266 MHZ alpha it doesn't make it 
un-beat-able. It was my fastest machine till recently when I purchased
a 292Mhz PPC G3 which blows my poor alpha away in both speed and power
consumption.
	And speed isn't alpha's best value point its 
1/ a 64bit processor with a 64bit OS and its always been that way
sorry I haven't had the priviledge to use AIX 4.3 4.2.x 64 support
was laughable 

2/ Digital UNIX is very nice UNIX both from a sysadm point of view and
programming point of view. Its as important an asset as the chip itself
hope compaq know this!

3/ its almost always had the fastest CPU. BTW 612MHZ alpha chips
are only just keeping on par with top end CPU around the block. Its
not till next month when customers can start getting the new EV6 chips
into machines that this will change again. Have you ever played leap
frog :)

	Cheers
		Mark:)



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~1998-10-02  4:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-09-27  4:00 Understanding threads in Unix lo tek
1998-09-28  4:00 ` William LeFebvre
1998-09-30  4:00   ` Mark
1998-09-28  4:00 ` Ben Elliston
1998-09-29  4:00   ` Patrick TJ McPhee
1998-10-01  4:00 ` Jason Rosenberg
1998-10-02  4:00   ` Mark & Suzanne (gcs might work)
1998-10-01  4:00     ` Chad Schrock

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox