Subject: Re: libpthread
To: None <,>
From: William Allen Simpson <>
List: tech-kern
Date: 06/25/2003 08:27:43
William Henny wrote:
> > On Sat, Jun 21, 2003 at 02:47:08AM +0200, Matthias Buelow wrote:
> >> But are there solid plans underway to give NetBSD 1x1
> >> and MxN kernel threading
> >
> >>MxN is what the SA code does, so NetBSD currently does that. The issue
> >>is that it's not release quality yet. 1x1 has been possible for a while
> >>with the clone(2) system call. It's Linux compatible, so you could
> >>compile linuxthreads on NetBSD with some minor adjustments.
> >
> An interesting article on the development of posix threading in Linux:
> I believe the latest offerings from Red Hat already uses NPTL, while all of
> the distributions will be using it come 2.6.
> As for the fate of NGPT:
> I think it says something when two programmers at Red Hat came up with an
> implementation around the 1:1 model that greatly outperformed the M:N
> implementation of the IBM/Intel folks, and in much shorter time.
> And then there's Solaris' move from a M:N to a 1:1 model, as the former
> proved very difficult to debug, and the 1:1 implementation they came up with
> performed better anyway.

I'm no expert on threads -- I've only done 1 project (a port from M$W to 
pthreads), and the company ( was sued out of existence before 
I got paid, so they didn't leave a good taste....  Also, constant stack
problems were hell to debug.

I've now read the above mentioned papers, and the Solaris 9 white paper
(from May 2002),

and have concluded that 1:1 is the direction NetBSD should head.  As the 
Solaris paper says:

  An important maxim in software engineering is that "correctness is a 
  constraint, while performance is a goal." The simplicity of the new 
  threads implementation makes it easier to deliver correctness, and 
  allows more time to be devoted to performance tuning.

I know it's probably a disappointment with all the work that has gone 
into this M:N model, but see:

William Allen Simpson
    Key fingerprint =  17 40 5E 67 15 6F 31 26  DD 0D B9 9B 6A 15 2C 32