Runtime System

Faster Mutexes

Total time plotted over utilization. While the processing time stays constant, the waiting time rises quickly with increasing utilization.

Single-threaded operating system kernels (like QNX® Neutrino® up to version 7.1) can severely bottleneck a multicore system. The result is a textbook queuing problem with waiting times quickly escalating once the OS kernel utilization passes about 50%. This poses among others an issue for processes and threads that need to synchronize with a high frequency. We provided our customer with a faster mutex implementation than std::mutex or pthread_mutex_t from the standard library they used. It was twice as fast on the happy path (i.e. mutex currently free) and due to the staggering effect of the mentioned queuing problem, it saved our customer about 20-30% of runtime in a critical process.

Quick facts

Hardware:

  • SoC: Qualcomm® Snapdragon®
  • CPU: Arm® Cortex®-A78

Operating System:

  • Blackberry® QNX

Compiler:

  • Blackberry QNX compiler (GCC-based)

Summary of our results:

  • Optimized mutexes 2×, resulting in less kernel contention
All referenced product or service names and trademarks are the property of their respective owners.