Search⌘ K

Awaitable Types and Functions in the Coroutines Library

Explore how awaitable types like single_consumer_event and async_mutex work in the C++23 coroutines library. Learn how to synchronize threads using these awaitables and handle functions like sync_wait and when_all for efficient coroutine management.

cppcoro provides more awaitable types.

Awaitable types

cppcoro supports various awaitable types:

  • single_consumer_event
  • single_consumer_async_auto_reset_event
  • async_mutex
  • async_manual_reset_event
  • async_auto_reset_event
  • async_latch
  • sequence_barrier
  • multi_producer_sequencer
  • single_producer_sequencer

I want to have a closer look at the awaitables single_consumer_event and async_mutex.

single_consumer_event

The single_consumer_event is, according to the documentation, a simple manual-reset event type that supports only a single ...