Skip to content
systemcoding.dev
Topic

Concurrency

Threads, atomics, memory models, lock-free structures, async runtimes and actor systems such as Erlang/OTP, and the races each one invites.

Flat illustration of parallel threads meeting at a mutex, with the C, Go and Rust logos.
Concurrency

Parallelize a Loop with

Turn a serial C loop into a multithreaded one with one OpenMP pragma, then learn which loops are safe to split and which ones silently give wrong answers.

7 min read
Flat illustration of parallel threads meeting at a mutex, with the C, C++ and Erlang logos.
Concurrency

Wait for Conditions with pthread_cond_wait

Make a C thread sleep until another signals that work is ready with pthread_cond_wait, pthread_cond_signal and a predicate loop on Linux with glibc 2.41.

8 min read
Flat illustration of parallel threads meeting at a mutex, with the C, C++ and Erlang logos.
Concurrency

Protect Shared Data with pthread_mutex_lock

Guard a shared linked-list stack in C with pthread_mutex_lock and pthread_mutex_unlock on glibc 2.41, check return codes, and avoid leaks from missed unlocks.

7 min read

Get new posts by email

We send one email when a new post is published. No spam.

Unsubscribe in one click. No spam, ever.