liveBook · Manning

Cnd_timedwait

cnd_timedwait is a C threads-library function that atomically releases a mutex while waiting on a condition variable, then reacquires it after notification or an absolute timeout.

How 2 Manning books explain it

Modern C, Third Edition

cnd_timedwait is a C threads-library function that atomically releases a mutex while waiting for a condition variable and returns when signaled or when an absolute time limit is reached.

How it is used
Coordinates accounting, update, and drawing threads while limiting how long each condition wait lasts.
How deep it goes
Explains deadline construction, predicate rechecks, liveness reasoning, and the wait’s mutex release-and-acquire behavior.
Examples
Uses a one-second `life_wait` wrapper and accounting, update, and drawing wait loops.
What you can do after
Apply it via the C threads library to time-limit waits, recheck predicates, and reason about progress.

Read how Modern C, Third Edition explains cnd_timedwait →

Modern C

cnd_timedwait is a C standard threads function that atomically releases a mutex while waiting on a condition variable until notification or an absolute timeout, then reacquires the mutex.

How it is used
Coordinates worker threads that should sleep until work arrives, the game finishes, or a frame-rate-oriented timeout expires.
How deep it goes
Explains arguments, absolute deadlines, mutex association, and predicate rechecking, but defers implementation internals.
Examples
Uses a one-second life_wait helper and accounting, update, and drawing thread predicates.
What you can do after
Apply it via C threads by supplying a condition variable, locked mutex, and absolute timespec deadline inside a predicate loop.

Read how Modern C explains cnd_timedwait →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.