On this page
threads.h
Prev: stdatomic.h | Up: stdlib | Next: setjmp.h
Rel: Concurrency vs. Parallelism, c/builtins
Ref: cppreference โ <threads.h>
Tags: #public #prog #c #stdlib #threads #index
Include
#include <threads.h>
Overview
Optional C11 standard threading primitives (thrd_t, mtx_t, cnd_t); note macOS often prefers POSIX <pthread.h>.
Specialized (#tier/specialized)
- thrd_create โ Spawns a new OS thread running
func(arg)and waits for completion viathrd_join(thr, &res). - mtx_lock โ Acquires a mutual-exclusion lock to guard shared mutable state across threads.
Linked from
Related notes
- tuts/c/stdlib Linked here; links to this page; shared tags: #c, #index, #prog, #stdlib
- tuts/c/stdlib/setjmp Linked here; links to this page; shared tags: #c, #index, #prog, #stdlib
- tuts/c/stdlib/stdatomic Linked here; links to this page; shared tags: #c, #index, #prog, #stdlib
- tuts/c/stdlib/threads/mtx_lock Linked here; links to this page; shared tags: #c, #prog, #stdlib, #threads
- tuts/c/stdlib/threads/thrd_create Linked here; links to this page; shared tags: #c, #prog, #stdlib, #threads
- tuts/c/builtins Linked here; shared tags: #c, #index, #prog
- tuts/c/stdlib/stdatomic/atomic_compare_exchange_weak links to this page; shared tags: #c, #prog, #stdlib
- tuts/c/builtins/_Thread_local links to this page; shared tags: #c, #prog
- tuts/programming/concurrency/concurrency_vs_parallelism Linked here; shared tags: #prog
- tuts/c/stdlib/assert shared tags: #c, #index, #prog, #stdlib