Product Documentation

V11.5 Update Guide

Previous Topic

Next Topic

CRITICAL_SECTION_SPIN - Configurable mutex spin for Unix/Linux

In an earlier modification, support was added for a configurable spin count on critical sections for FairCom Server on Windows systems. This was done because it is more efficient to have threads spin trying to acquire the synchronization object (using atomic operations) rather than immediately calling a kernel function to block until the synchronization object can be acquired in cases in which a synchronization object such as a critical section or a mutex is held for a short period of time.

The configuration option CRITICAL_SECTION_SPIN, which controls this behavior, has been extended to Unix/Linux systems in V11.3.0 and later. The default value is 1000, meaning that we try up to 1000 calls to pthread_mutex_trylock() before making the blocking pthread_mutex_lock() call.

In a file open/close mutex contention test on a Linux system, a significant speedup was observed when using this option.

TOCIndex