This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
Re: NPTL for hppa-linux is not backwards compatible with Linuxthreads.
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: "Roland McGrath" <roland at redhat dot com>
- Cc: debian-glibc at lists dot debian dot org, parisc-linux <parisc-linux at lists dot parisc-linux dot org>, "Jeff Bailey" <jbailey at raspberryginger dot com>, "Aurelien Jarno" <aurel32 at debian dot org>, "Mike Frysinger" <vapier at gentoo dot org>, "Guy Martin" <gmsoft at gentoo dot org>, libc-ports at sourceware dot org
- Date: Sun, 18 Feb 2007 18:22:25 -0500
- Subject: Re: NPTL for hppa-linux is not backwards compatible with Linuxthreads.
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=M7C7tEg/kjnwK1wvnJYMQ4eVYN/e86mb7ffCVuRmqIk517JtZSDDy5P1Wz+muWc7SBLoV71E8GJ1C1mcKXD5Dr5mdbHCNET57OZNx3AKQ5GGWIGAv5PGiOR0JWv8JPtGBidrvQlzneIvj7qhL9dGhCP6j5AHu/sLfp+ImuOZIv4=
- References: <119aab440702181143h682c78d9ra0d765b06e08a594@mail.gmail.com> <20070218223333.4CD97180076@magilla.sf.frob.com>
On 2/18/07, Roland McGrath <roland@redhat.com> wrote:
> NPTL for hppa-linux is not backwards compatible with Linuxthreads, we
> have broken the pthread ABI.
Please elaborate on exactly which types and entrypoints are incompatible.
All statically initialized locks are broken. We made locks smaller,
and changed the value of the static initialization.
e.g.
pthread_mutex_t smutex = PTHREAD_MUTEX_INITIALIZER;
Linuxthreads:
smutex.__m_lock == {1,1,1,1}
NPTL:
smutex.__m_lock == 0
On Linuxthreads hppa-linux used a four word structure to represent a
lock. We used a structure to get a runtime 16-byte aligned lock word
to meet the requirements of the hardware "load and clear word." Since
the only available atomic hardware instruction is "load and clear
word", a lock is locked with a value of one, and unlocked with a value
of zero.
For NPTL we created a "compare and exchange" light-weight kernel
syscall. The light-weight kernel syscall is the basis for
atomic_compare_and_exchange_val_acq(). All other primitives are built
on this primitive. In this implementation we can use a single word
lock, like all other architectures, and our lowlevellock.h/.c
implementations are virtually identical to other architectures.
Any comments?
Cheers,
Carlos.