TUSST — the Stroop SigilTUSST
journeyforgecampaignadvanced
sign in
‹ advanced path

Threads, Send/Sync & Shared State

The core of any RPC service under real load. Threads, the two auto traits that make sharing sound, Arc<Mutex<T>> and its alternatives, atomics with honest memory ordering, and channels.

serves: RPC/API services at high scale8 lessons · ~5h
progress0/8
Start track

// lessons

  1. 01

    Spawning & Joining Threads

    Run work in parallel and collect every result deterministically.

  2. 02

    Send & Sync

    Say why Rc is not Send and Arc is, from the definition rather than from memory.

  3. 03

    Arc<T>: Shared Ownership Across Threads

    Share read-only state with N workers at the cost of one atomic.

  4. 04

    Mutex, Guards & Poisoning

    Mutate shared state safely, and keep the critical section short on purpose.

  5. 05

    RwLock & Read-Heavy State

    Choose RwLock over Mutex on evidence, and name the starvation risk you took.

  6. 06

    Deadlocks & Lock Ordering

    Reproduce a deadlock, then remove it with a global lock order.

  7. 07

    Atomics & Memory Ordering

    Use fetch_add and compare_exchange, and justify Relaxed vs Acquire/Release.

  8. 08

    Channels & Backpressure

    Wire a producer/consumer with mpsc and explain what a bounded channel buys.

Every exercise compiles and runs in the Forge sandbox — standard library only, no external crates.

TUSST · The Ultimate Stellar Supreme Tutorial

learn rust → master stellar · open-source