![](https://secure.gravatar.com/avatar/99fde0c1dfd216326aae0aff30d493f1.jpg?s=120&d=mm&r=g)
7 Nov
2014
7 Nov
'14
9:05 a.m.
Kristian Nielsen
So you may be right that the implementation needs no explicit full memory barrier in theory...
On the other hand, I have implemented code that _does_ assume a full barrier for each operation individually (see
I checked glibc sources for powerpc. They seem to have only acquire barrier for pthread_mutex_lock(), and only release barrier for pthread_mutex_unlock(), assuming I read the code correctly. So looks like I am wrong to think that a full barrier is necessarily implied by pthread_mutex_lock() alone (or pthread_mutex_unlock() alone). I will need to review my earlier code to check for this. Well, usually in fact only the acquire / release is sufficient, but I'll need to check. Thanks, - Kristian.