When is pthread_spin_lock the right thing to use (over e.g. a pthread mutex)?

Viewed 20515

Given that pthread_spin_lock is available, when would I use it, and when should one not use them ?

i.e. how would I decide to protect some shared data structure with either a pthread mutex or a pthread spinlock ?

4 Answers
Related