Spin locks
Ulrich Drepper
drepper@redhat.com
Thu May 4 16:00:00 GMT 2000
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 `------------------------
More information about the Libc-hacker
mailing list