Subject: Re: native pthread support in 1.5
To: John Maier <firstname.lastname@example.org>
From: Jason R Thorpe <email@example.com>
Date: 08/28/2000 13:34:04
On Mon, Aug 28, 2000 at 02:49:45PM -0500, John Maier wrote:
> How then do we (NetBSD) support Linux compat pthread in 1.5?
If a threads package lives entirely in userland, then support in emulation
is obviously quite trivial.
Linux's threads package uses the __clone(2) system call, which we also
provide emulation for.
The issue is that threads support is more than just providing the right
system calls. There's also some fairly difficult integration work into
the C library that needs to happen in order to support threads.
> Is the pthread stuff (on Linux) a library or native to the Linux kernel?
It's a combination of both. The Linux threads library uses the __clone(2)
Now, as a result of that, Linux threads are a bit difficult to work with,
and they've even added API components to work around problems with their
approach to threads.
NetBSD is currently (quite actively, I might add, as I discuss progress
and issues with the developer who's working on it pretty much every day)
a pthreads implementation which uses an approach very similar to that
used by Solaris.
I think you'll be quite happy with the result of this work, and in the
mean time, please use unproven-pthreads or PTL2 (or PTH or whatever else
might be available). These are perfectly reasonable stop-gap measures.
Yes, I readily acknowledge that it sucks not having pthreads ship out
of the box, but I'll also point out that the pthreads implementations
available on the other free systems have some unfortunate negatives
associated with them ... NetBSD is learning from the mistakes made there,
and taking an approach to the implementation that addresses many of them.
-- Jason R. Thorpe <firstname.lastname@example.org>