32 Concurrency support library [thread] (original) (raw)

32.5 Atomic operations [atomics]

32.5.6 Waiting and notifying [atomics.wait]

Atomic waiting operationsand atomic notifying operationsprovide a mechanism to wait for the value of an atomic object to change more efficiently than can be achieved with polling.

An atomic waiting operation may block until it is unblocked by an atomic notifying operation, according to each function's effects.

[Note 1:

Programs are not guaranteed to observe transient atomic values, an issue known as the A-B-A problem, resulting in continued blocking if a condition is only temporarily met.

— _end note_]

[Note 2:

The following functions are atomic waiting operations:

— _end note_]

[Note 3:

The following functions are atomic notifying operations:

— _end note_]

A call to an atomic waiting operation on an atomic object Mis eligible to be unblockedby a call to an atomic notifying operation on Mif there exist side effects X and Y on M such that: