[PLUG] pthreads/glibc question

Terry Griffin griffint at pobox.com
Sun Jan 12 20:39:02 UTC 2003


There are three different pthread libraries for Linux. There's the original
LinuxThreads that you find in all current distributions (as part of glibc),
then two newer versions, NGPT from IBM, and NPTL from Ulrich Drepper
and Ingol Molnar of Red Hat. Both require kernel features that were added
in the 2.5 kernel, although the changes required for NGPT were very modest
while for NPTL they were quite drastic.

My guess is that the Red Hat beta release uses NPTL for POSIX threads,
and to make it work they back-ported (a lot of) stuff from 2.5 in to their
2.4 kernel. So... if you run a stock 2.4 kernel, NPTL pthreads wouldn't
work.

All this is happening because the original LinuxThreads library had two
serious problems. It wasn't POSIX compliant and performance really sucked for
very large numbers of threads. Both NGPT and NPTL fix both of these problems.
Preliminary testing shows that NPTL out-performs NGPT, at least in certain
scenarios.

Your options are: (1) Get the source code to the older LinuxThreads library,
build it and install that as your pthreads library, (2) run a 2.5 kernel, or
(3) go back to Red Hat's kernel.

Terry

On Sunday 12 January 2003 12:21 pm, Alan wrote:
> I am in the process of researching this, but maybe someone here knows
> off the top of their head...
>
> I am using the Redhat 8.0.92 beta.  It uses glibc 2.3.1 and gcc 3.2.1.
>
> I have been getting lockups, but I built a stock kernel version
> 2.4.21-pre3 with the options from the Athlon smp kernel used by Redhat.
>
> It boots fine, but pthreads will *not* function at all.
>
> Does anyone have an idea why?  I was not aware of any dependancies of
> pthreads on the kernel version and/or kernel patches needed to support
> pthreads.  The pthreads library is the one that comes from the glibc
> package.
>
> May not seem like a big deal, but there are a number of things that
> depend on pthreads.  (Like anything using Gnome 2.)
>
> Ideas?






More information about the PLUG mailing list