Skip to content

Concurrency practice problems in Rust

Difficulty:
Category:
Tag:

Showing 32 of 32

Status Title Difficulty
Arc gives you sharing, not mutability Easy
Arc: shared ownership across threads Easy
A single-producer single-consumer ring buffer Hard
A store-buffer memory-model interpreter Hard
Atomics: counters, flags and fetch_* Medium
Balanced ranges: the arithmetic before the threads Easy
Barrier: keeping workers in lock step Medium
Build a spinlock from AtomicBool and UnsafeCell Hard
Capstone: build a thread pool Hard
CAS loops: compare_exchange and fetch_update Hard
Condvar: a wakeup is a hint, the predicate is the truth Hard
Deadlock by lock ordering: the guarantee Rust does not give you Hard
Guard lifetimes: still holding the lock, still not meaning to Hard
Hand-rolling `join`: running two futures concurrently Medium
Index tagging: the pattern that makes concurrency testable Medium
JoinHandle, panics and thread::Result Medium
move closures: why the compiler forces your hand Easy
mpsc channels: message passing basics Easy
Mutex and MutexGuard: you cannot forget to unlock Easy
OnceLock: one initialisation, however many threads race for it Medium
park and unpark: building a blocking primitive by hand Hard
Poisoning: what a panic does to a lock Medium
Rc<RefCell<T>> vs Arc<Mutex<T>>, and the arena that beats both Medium
Safe parallel mutation with chunks_mut Medium
Scoped threads: borrow, do not clone Easy
Send: what it actually guarantees Medium
static mut and the edition-2024 wall Medium
sync_channel: bounded buffers and backpressure Medium
Sync: T is Sync exactly when &T is Send Medium
The drop(tx) hang: a bug with no diagnostics Medium
Threads, spawn and join Easy
unsafe impl Send, and the disjoint-capture trap Hard