This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Spin locks


Mark Kettenis <kettenis@wins.uva.nl> writes:

> Here's a quick note to let people know that I'm working on
> implementing the POSIX spin locks that are in the current IEEE
> Std. 1003.1-200X draft.

For Hurd this is, I assume.  I've committed the Linux implementation
some time ago.

> Spin locks should be fast and simple.

Well, make it an option.  Note that you are always exposing a part of
the interface: the pthread_spinlock_t type.  If you change this you'll
have problem anyhow.  If you keep the same structure you'll use the
same algorithms as well (most probably).  There are some more
advantage in using inlined versions (such as avoiding the lock prefix
on x86 if you know the application runs on single processor machines).

Anyhow, there definitely should be an option to turn the inlining off.
Or better, there should be a flag to turn it on.  The extra sanity
checks are sometimes really useful.

-- 
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]