.. _control_structures:

Async Control Structures
-----------------------------------------------------------------------------------

.. toctree::
   :maxdepth: 1
   :hidden:

   atomic_condvar
   auto_reset_event
   barrier
   latch
   manual_reset_event
   mutex
   semaphore

The original versions of these control structures work by blocking threads. The TMC versions work by suspending tasks.

.. list-table:: Async Control Structures
   :header-rows: 1

   * -  TMC Async Version
     -  Original Blocking Version
   * - :literal_ref:`tmc::atomic_condvar<atomic_condvar>`
     - std::atomic<T>::wait() / notify_*()
   * - :literal_ref:`tmc::auto_reset_event<auto_reset_event>`
     - Windows AutoResetEvent
   * - :literal_ref:`tmc::barrier<barrier>`
     - std::barrier
   * - :literal_ref:`tmc::latch<latch>`
     - std::latch
   * - :literal_ref:`tmc::manual_reset_event<manual_reset_event>`
     - Windows ManualResetEvent
   * - :literal_ref:`tmc::mutex<mutex>`
     - std::mutex
   * - :literal_ref:`tmc::semaphore<semaphore>`
     - std::counting_semaphore
