Re: NPTL for hppa-linux is not backwards compatible with Linuxthreads.
"Carlos O'Donell" <[email protected]>
| Newsgroups | gmane.linux.debian.devel.glibc,gmane.linux.ports.hppa |
|---|---|
| Message-ID | <[email protected]> |
On 2/18/07, Roland McGrath <[email protected]> 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.