User Guide

Contents

Intel® Threading Building Blocks (Intel® TBB)
Mutexes

With
Intel® Threading Building Blocks (Intel® TBB)
, you can associate a
mutex
with a shared object to enforce mutually exclusive access to that object. A mutex is either locked or unlocked. For a thread to safely access the object:
  • The thread
    acquires a lock
    on the mutex.
  • The thread accesses the associated shared object.
  • The thread
    releases its lock
    on the mutex.
When a mutex is locked, if another thread tries to also acquire a lock on it, this second thread is stalled until the first thread releases its lock on the mutex. This functionality provided by a mutex is exactly the semantic function intended by the
Intel Advisor
annotations
ANNOTATE_LOCK_ACQUIRE()
and
ANNOTATE_LOCK_RELEASE()
.
With
Intel TBB
, the annotation lock address becomes the mutex object. The
ANNOTATE_LOCK_ACQUIRE()
and
ANNOTATE_LOCK_RELEASE()
annotations become operations on this mutex.
Intel TBB
provides several classes for locking, each with different properties. For more information, refer to the
Intel TBB
documentation. If you are not sure what type of a mutex is most appropriate, consider using
tbb::mutex
as your initial choice.

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804