I understand that pthread_cond_wait() is documented to get spurious wake ups and the caller must check for that condition and that the motivation for this is to allow implementations of pthread_cond_wait() to have better performance and to force the caller to create more robust code.
However, I have not seen anyone get specific about the performance opportunity that this affords though other than mention of race conditions that would be expensive to avoid.
Can someone please go into detail about what race conditions would arise in order to ensure there were no spurious wake ups and what hardware architectures would cause such scenarios to arise?