Comparing POSIX semaphore and pthread_mutex performance
I’ve got an embedded Linux project running on a Cortex A8 (32-bit ARM). I have a handful of individual hardware resources that I need to lock for atomic operation both between threads in the same process and between multiple processes. The hardware operation itself is fairly fast (single microseconds), so lock/unlock overhead could add up. Contention for any given resource will be rare, but I still need to not get stuck in a deadlock due to priority inversion when it does happen.