Skip to content
← All tracks

Atomics, Send/Sync and the Memory Model

Rust

Where a competent Rust programmer becomes a systems programmer: atomics, orderings, `Send`/`Sync` as auto traits — and an honest account of what cannot be observed without loom.

This track is written for Rust, which isn't the mode you're browsing in.

0 / 8 solved · 4 articles
  1. 1. Not solved yet. Atomics: counters, flags and fetch_*
  2. 2. Not solved yet. CAS loops: compare_exchange and fetch_update
  3. 3. Memory orderings, honestly Read
  4. 4. Not solved yet. A store-buffer memory-model interpreter
  5. 5. Not solved yet. A single-producer single-consumer ring buffer
  6. 6. Send and Sync as unsafe auto traits Read
  7. 7. False sharing: correct code, ten times slower Read
  8. 8. Not solved yet. OnceLock: one initialisation, however many threads race for it
  9. 9. Not solved yet. static mut and the edition-2024 wall
  10. 10. Not solved yet. Build a spinlock from AtomicBool and UnsafeCell
  11. 11. Not solved yet. Rc<RefCell<T>> vs Arc<Mutex<T>>, and the arena that beats both
  12. 12. What this grader cannot check, and what real teams use Read

Check yourself

4 questions · one attempt each

These do not count toward finishing the track. They are here to catch the things that are easy to read past.

0 / 4

A thread writes data then sets a flag; another sees the flag and reads the data. Which orderings make that safe?

// writer: data = 42; flag.store(true, ?);
// reader: if flag.load(?) { read data }
Question 1 of 4