[RESEND PATCH 1/3] Mutex: Accelerate lock acquisition by queuing spinner

kemi kemi.wang@intel.com
Tue Dec 18 02:21:00 GMT 2018



On 2018/12/17 下午8:55, Florian Weimer wrote:
> * Kemi Wang:
> 
>> +# define PTHREAD_QUEUESPINNER_MUTEX_INITIALIZER_NP \
>> +  { { 0, 0, 0, PTHREAD_MUTEX_QUEUESPINNER_NP, { 0, 0, 0, 0 }, 0, \
>> +      { __PTHREAD_SPINS }, { 0, 0 } } }
> 
> Is it really necessary to add the initializer?
> 

Not really.
But I prefer to keep it here because of ease of use.
Also, there are other initializers for other types of mutex, we'd better
keep the same style.

> Without it, we can remove all references to
> PTHREAD_QUEUESPINNER_MUTEX_INITIALIZER_NP from the hot path in case
> something better comes up.
> 
> Thanks,
> Florian
> 



More information about the Libc-alpha mailing list