# atomics

Published articles for atomics.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## 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

## How to Prevent Race Conditions in Coroutines

DevFeed: [How to Prevent Race Conditions in Coroutines](<https://devfeed.tech/articles/how-to-prevent-race-conditions-in-coroutines-25006.md>)

Original publisher: [Read original article](<https://typealias.com/articles/prevent-race-conditions-in-coroutines/>)

Author: author@typealias.com (Dave Leeds)

Published: 2025-11-24T00:00:00Z

Content type: tutorial

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [kotlin-coroutines](<https://devfeed.tech/topics/kotlin-coroutines.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>)

Tags: [actor](<https://devfeed.tech/tags/actor.md>), [atomicint](<https://devfeed.tech/tags/atomicint.md>), [atomics](<https://devfeed.tech/tags/atomics.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [coroutine](<https://devfeed.tech/tags/coroutine.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-coroutines](<https://devfeed.tech/tags/kotlin-coroutines.md>), [limitedparallelism](<https://devfeed.tech/tags/limitedparallelism.md>), [mutex](<https://devfeed.tech/tags/mutex.md>), [programming](<https://devfeed.tech/tags/programming.md>), [race-condition](<https://devfeed.tech/tags/race-condition.md>), [shared-mutable-state](<https://devfeed.tech/tags/shared-mutable-state.md>), [state](<https://devfeed.tech/tags/state.md>), [stateflow](<https://devfeed.tech/tags/stateflow.md>), [structured-concurrency](<https://devfeed.tech/tags/structured-concurrency.md>)

### AI overview

This tutorial explains that Kotlin coroutines and structured concurrency do not automatically protect shared mutable state from race conditions. It introduces the issue using an example that creates 100,000 random bakery orders.

### Source excerpt

Thanks to structured concurrency, there are a lot of concerns that we don't have to handle manually when working with Kotlin coroutines. For example, parent coroutines automatically wait for their children to complete before completing themselves. And when a parent coroutine is cancelled, its children are automatically cancelled, too. But when it comes to shared mutable state - mutable data that multiple coroutines could update at the same time - there's nothing magical in the design of coroutines to ensure that the state is updated properly.

## Fearless Concurrency Ep.2: Managing Threaded Programs and Data Races in Rust

DevFeed: [Fearless Concurrency Ep.2: Managing Threaded Programs and Data Races in Rust](<https://devfeed.tech/articles/fearless-concurrency-ep-2-managing-threaded-programs-and-data-races-in-rust-22259.md>)

Original publisher: [Read original article](<https://www.ardanlabs.com/blog/2024/09/fearless-concurrency-ep2-managing-threaded-programs-and-data-races-in-rust.html>)

Published: 2024-09-26T00:00:00Z

Content type: tutorial

Language: en

Sources: [William Kennedy](<https://devfeed.tech/sources/william-kennedy.md>)

Topics: [Rust](<https://devfeed.tech/topics/rust.md>), [Concurrent Programming](<https://devfeed.tech/topics/concurrent-programming.md>), [data](<https://devfeed.tech/topics/data.md>), [Operating system](<https://devfeed.tech/topics/operating-system.md>)

Tags: [atomics](<https://devfeed.tech/tags/atomics.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [concurrency-in-rust](<https://devfeed.tech/tags/concurrency-in-rust.md>), [creating-threads-in-rust](<https://devfeed.tech/tags/creating-threads-in-rust.md>), [fundamentals](<https://devfeed.tech/tags/fundamentals.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [managing-threads-in-rust](<https://devfeed.tech/tags/managing-threads-in-rust.md>), [preventing-race-conditions-in-rust](<https://devfeed.tech/tags/preventing-race-conditions-in-rust.md>), [rust](<https://devfeed.tech/tags/rust.md>), [rust-atomic-operations](<https://devfeed.tech/tags/rust-atomic-operations.md>), [rust-borrow-checker-for-threads](<https://devfeed.tech/tags/rust-borrow-checker-for-threads.md>), [rust-concurrency-tutorial](<https://devfeed.tech/tags/rust-concurrency-tutorial.md>), [rust-concurrent-programming](<https://devfeed.tech/tags/rust-concurrent-programming.md>), [rust-data-race-prevention](<https://devfeed.tech/tags/rust-data-race-prevention.md>), [rust-join-handles](<https://devfeed.tech/tags/rust-join-handles.md>), [rust-multithreading](<https://devfeed.tech/tags/rust-multithreading.md>), [rust-ownership-system](<https://devfeed.tech/tags/rust-ownership-system.md>), [rust-thread-safety](<https://devfeed.tech/tags/rust-thread-safety.md>), [rust-threading-basics](<https://devfeed.tech/tags/rust-threading-basics.md>), [safety](<https://devfeed.tech/tags/safety.md>), [std-thread-spawn-in-rust](<https://devfeed.tech/tags/std-thread-spawn-in-rust.md>), [thread-lifecycle-in-rust](<https://devfeed.tech/tags/thread-lifecycle-in-rust.md>), [threads](<https://devfeed.tech/tags/threads.md>)

### AI overview

Episode 2 of a Rust concurrency series explains how to create and manage threads with std::thread, use join handles, and safely share or modify data across threads. It describes how Rust's ownership system and borrow checker prevent data races, and introduces atomics for shared state.

### Source excerpt

Introduction: Welcome to Episode 2 of the Fearless Concurrency in Rust series! In this episode, Herbert Wolverson dives into the fundamentals of threading in Rust, demonstrating how to use Rust's threading capabilities effectively while maintaining safety. The focus is on using std::thread to spawn threads, preventing data races, and ensuring efficient, reliable multithreaded execution. Creating Threads in Rust: How to spawn and manage operating system threads using std::thread::spawn. Handling Data Races: Rust's borrow checker and ownership system preventing unsafe data access across threads.

## Ep. 6: Exploring Concurrency Pitfalls: Rust vs. C++ and Go

DevFeed: [Ep. 6: Exploring Concurrency Pitfalls: Rust vs. C++ and Go](<https://devfeed.tech/articles/ep-6-exploring-concurrency-pitfalls-rust-vs-c-and-go-22236.md>)

Original publisher: [Read original article](<https://www.ardanlabs.com/blog/2024/05/exploring-concurrency-pitfalls-rust-vs-c-and-go-ep-6.html>)

Published: 2024-05-20T00:00:00Z

Content type: comparison

Language: en

Sources: [William Kennedy](<https://devfeed.tech/sources/william-kennedy.md>)

Topics: [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [Rust](<https://devfeed.tech/topics/rust.md>), [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [Go Language](<https://devfeed.tech/topics/go-language.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Error Handling](<https://devfeed.tech/topics/error-handling.md>)

Tags: [atomics](<https://devfeed.tech/tags/atomics.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [error-handling](<https://devfeed.tech/tags/error-handling.md>), [go](<https://devfeed.tech/tags/go.md>), [indicating-intent](<https://devfeed.tech/tags/indicating-intent.md>), [mutex](<https://devfeed.tech/tags/mutex.md>), [pitfalls](<https://devfeed.tech/tags/pitfalls.md>), [reliable-codebases](<https://devfeed.tech/tags/reliable-codebases.md>), [rust](<https://devfeed.tech/tags/rust.md>), [safety-concern](<https://devfeed.tech/tags/safety-concern.md>), [synchronization](<https://devfeed.tech/tags/synchronization.md>), [threads](<https://devfeed.tech/tags/threads.md>), [type-coercion](<https://devfeed.tech/tags/type-coercion.md>)

### AI overview

This video compares how C++, Go, and Rust address data races in concurrent programs. It discusses unsynchronized shared access, Go's race-detection flag, and Rust's stricter mutability and synchronization rules, along with Rust's null-pointer avoidance and error handling.

### Source excerpt

Introduction: Join Herbert in an insightful discussion on concurrency, where he tackles the complexities of data races and how various programming languages address them: Understand the crucial role of recognizing data races in concurrent programming and their potential impacts. See practical examples illustrating the chaos caused by data races and learn how Rust's compiler prevents such issues, ensuring program stability. Explore Rust's unique features like null pointer avoidance and reliable error handling, which enhance safety and reliability in concurrent programming tasks.

## Oxidizing OCaml: Data Race Freedom

DevFeed: [Oxidizing OCaml: Data Race Freedom](<https://devfeed.tech/articles/oxidizing-ocaml-data-race-freedom-20202.md>)

Original publisher: [Read original article](<https://blog.janestreet.com/oxidizing-ocaml-parallelism/>)

Author: Max Slater

Published: 2023-09-01T00:00:00Z

Content type: article

Language: en

Sources: [Jane Street](<https://devfeed.tech/sources/jane-street.md>)

Topics: [OCaml](<https://devfeed.tech/topics/ocaml.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [data](<https://devfeed.tech/topics/data.md>), [async/await](<https://devfeed.tech/topics/async-await.md>), [Rust](<https://devfeed.tech/topics/rust.md>)

Tags: [async](<https://devfeed.tech/tags/async.md>), [atomics](<https://devfeed.tech/tags/atomics.md>), [await](<https://devfeed.tech/tags/await.md>), [code](<https://devfeed.tech/tags/code.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [data](<https://devfeed.tech/tags/data.md>), [ocaml](<https://devfeed.tech/tags/ocaml.md>), [rust](<https://devfeed.tech/tags/rust.md>), [synchronization](<https://devfeed.tech/tags/synchronization.md>)

### AI overview

This final post in a series explains how Jane Street uses OCaml modes and capsules to design a statically data-race-free API for multicore OCaml. It discusses shared-memory parallelism, the risks of mutable data races, and approaches for safely handling shared mutability across domains.

### Source excerpt

OCaml with Jane Street extensions is available from our public opam repo. Only a slice of the features described in this series are currently implemented.

## Rust atomics on x86: How and why

DevFeed: [Rust atomics on x86: How and why](<https://devfeed.tech/articles/rust-atomics-on-x86-how-and-why-35457.md>)

Original publisher: [Read original article](<https://darkcoding.net/software/rust-atomics-on-x86/>)

Author: Graham King

Published: 2022-01-30T23:18:06Z

Content type: article

Language: en

Sources: [Graham King](<https://devfeed.tech/sources/graham-king.md>)

Topics: [Rust](<https://devfeed.tech/topics/rust.md>), [x86](<https://devfeed.tech/topics/x86.md>), [ordering](<https://devfeed.tech/topics/ordering.md>)

Tags: [assembly](<https://devfeed.tech/tags/assembly.md>), [atomic](<https://devfeed.tech/tags/atomic.md>), [atomics](<https://devfeed.tech/tags/atomics.md>), [ordering](<https://devfeed.tech/tags/ordering.md>), [rust](<https://devfeed.tech/tags/rust.md>), [software](<https://devfeed.tech/tags/software.md>), [x86](<https://devfeed.tech/tags/x86.md>)

### AI overview

This article examines how Rust atomic memory orderings compile on x86. It finds that load and store operations generally produce the same instructions across orderings, while sequential consistency adds a full memory barrier. Read-modify-write operations also generally use the same instructions, though compiler reordering remains an important caveat.

### Source excerpt

On x86 it doesn't really matter what sync::atomic::Ordering you choose.

## Thread Local Randoms in Java

DevFeed: [Thread Local Randoms in Java](<https://devfeed.tech/articles/thread-local-randoms-in-java-24841.md>)

Original publisher: [Read original article](<https://alidg.me/blog/2020/4/24/thread-local-random>)

Author: Alimate

Published: 2020-04-24T00:00:00Z

Content type: tutorial

Language: en

Sources: [Ali Dehghan - Kemikit](<https://devfeed.tech/sources/ali-dehghan-kemikit.md>)

Topics: [Java](<https://devfeed.tech/topics/java.md>), [Randomizer](<https://devfeed.tech/topics/randomizer.md>), [benchmarking](<https://devfeed.tech/topics/benchmarking.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [Algorithm](<https://devfeed.tech/topics/algorithm.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [atomics](<https://devfeed.tech/tags/atomics.md>), [benchmarking](<https://devfeed.tech/tags/benchmarking.md>), [concurrent](<https://devfeed.tech/tags/concurrent.md>), [java](<https://devfeed.tech/tags/java.md>), [lock-free](<https://devfeed.tech/tags/lock-free.md>), [performance](<https://devfeed.tech/tags/performance.md>), [state](<https://devfeed.tech/tags/state.md>)

### AI overview

This article examines thread-local random number generation in Java. It compares a shared generator, a simple thread-local implementation, and the built-in approach, explaining how contention, atomic operations, synchronization, and shared mutable state affect throughput.

### Source excerpt

Benchmarking regular randoms against thread-local ones!