Spin locks
Ulrich Drepper
drepper@redhat.com
Fri May 5 09:59:00 GMT 2000
Mark Kettenis <kettenis@wins.uva.nl> writes:
> Anyway, I've taken a look at the code in linuxthreads/spinlock.c, but
> it looks to me as if your implementation is more like a fast and
> simple mutex than a spin lock. In fact the only different between a
> spin lock and a PTHREAD_MUTEX_FAST_NP mutex, is that you avoid the
> check of the mutex type.
Well, this is the only way to avoid priority inversion. If you know
nothing abou the other thread contesting for the spinlock you will run
into these problems. My understanding is the priority iversions must
be handled gracefully.
--
---------------. 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