18 Sep
2013
18 Sep
'13
11:03 a.m.
many use cases is not necessary. and locks are not free, as they involve memory barriers and atomic operations. and how many platforms implement PI mutexes?
Don't semaphores involve memory barriers and/or atomics too? POSIX semaphores do.
(N.B. I'm not disputing that semaphores have less overhead than CVs.)
they do, but much less: according to some micro-benchmarks with much contention, dispatch semaphores on osx are about 80 times faster than CVs, while posix semaphores on linux are about 30 times faster.