Overhead of pthread mutexes?
All modern thread implementations can handle an uncontended mutex lock entirely in user space (with just a couple of machine instructions) – only when there is contention, the library has to call into the kernel. Another point to consider is that if an application doesn’t explicitly link to the pthread library (because it’s a single-threaded … Read more