July 2007
Intermediate to advanced
332 pages
10h 4m
English
queuing_mutex Class — Class that models the Mutex Concept that is fair and scalable.
#include "tbb/queuing_mutex.h" class queuing_mutex;
A queuing_mutex models the Mutex Concept. A queuing_mutex is scalable, in the sense that if a task has to wait to acquire the mutex, it spins on its own local cache line. A queuing_ mutex is fair, in that tasks acquire the lock in the order they requested it, even if they are later suspended. A queuing_mutex is not reentrant.
The current implementation does busy-waiting, so using a queuing_mutex may degrade system performance if the wait is long.
See Table 7-2.