|
From: Bart V. A. <bva...@ac...> - 2012-02-15 09:51:23
|
On Wed, Feb 15, 2012 at 9:28 AM, Tom Hughes <to...@co...> wrote: > I don't think it actually spins in userspace, it's just that it is able to > check (and if available take) the lock from userspace and only enter the > kernel if it needs to block. Not that it's important, but as far as I can see the pthread_mutex_lock() implementation does spin in userspace for mutexes of type PTHREAD_MUTEX_ADAPTIVE_NP. See e.g. http://sourceware.org/git/?p=glibc.git;a=blob;f=nptl/pthread_mutex_lock.c. Bart. |