# A quick overview of atomics in C

DevFeed: [A quick overview of atomics in C](<https://devfeed.tech/articles/a-quick-overview-of-atomics-in-c-29428.md>)

Original publisher: [Read original article](<https://lemire.me/blog/2026/09/09/a-quick-overview-of-atomics-in-c/>)

Author: Daniel Lemire

Published: 2026-09-09T20:41:53Z

Content type: tutorial

Language: en

Sources: [Daniel Lemire](<https://devfeed.tech/sources/daniel-lemire.md>)

Topics: [C](<https://devfeed.tech/topics/c.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [Concurrent Programming](<https://devfeed.tech/topics/concurrent-programming.md>), [Programming](<https://devfeed.tech/topics/programming.md>)

Tags: [atomics](<https://devfeed.tech/tags/atomics.md>), [c](<https://devfeed.tech/tags/c.md>), [join](<https://devfeed.tech/tags/join.md>), [ordering](<https://devfeed.tech/tags/ordering.md>), [posix](<https://devfeed.tech/tags/posix.md>), [programming-language](<https://devfeed.tech/tags/programming-language.md>), [systems](<https://devfeed.tech/tags/systems.md>), [thread](<https://devfeed.tech/tags/thread.md>), [threads](<https://devfeed.tech/tags/threads.md>)

## AI overview

This tutorial introduces atomics in C, explaining data races on shared non-atomic variables, atomic accesses, instruction reordering, and memory-ordering models including relaxed, release, and acquire semantics. It also discusses C11 threads and platform support limitations.

## Source excerpt

If you write in C, by default, you use a single thread. Extra cores do not help until you create more threads. However, if you include the header <threads.h>, you can pass a function to thrd_create, and wait for it with thrd_join. #include <threads.h> #include <stdio.h> int worker(void *arg) { printf("hello from thread %d\n", *(int ... Continue reading A quick overview of atomics in C