The behavior of POSIX threads can be tuned to gain performance improvements according to specific hardware capabilities and workload characteristics by setting the following tunables in the
pthreadnamespace:
The
glibc.pthread.mutex_spin_counttunable sets the maximum number of times a thread should spin on the lock before calling into the kernel to block. Adaptive spin is used for mutexes initialized with thePTHREAD_MUTEX_ADAPTIVE_NPGNU extension. It affects bothpthread_mutex_lockandpthread_mutex_timedlock.The thread spins until either the maximum spin count is reached or the lock is acquired.
The default value of this tunable is ‘100’.