snp-lab-code/P10_Sync/Sync/mutex/README_MAC_OSX

8 lines
170 B
Plaintext
Raw Permalink Normal View History

2020-05-10 02:07:29 +02:00
For Mac users
"pthread_mutex_lock(&lock)" is slow on MACs compared to Linux:
use instead: "while (pthread_mutex_trylock(&lock) > 0) {} ;"
which implements a spin lock