About this playground
Concurrency is what keeps an app responsive while it does more than one thing at once, and getting it wrong is behind some of the most baffling bugs in software: the list that stutters, the value that's wrong only sometimes, the tap that freezes the screen.
This book teaches concurrency in Swift across both of its eras, the classic model built on Grand Central Dispatch and Operations, and the modern model of async/await, structured concurrency, and actors. Instead of treating the older approach as obsolete, it solves the same problem each way, so you feel the pains the modern tools were designed to relieve and learn when to reach for each.
Every concept comes with small, self-contained examples you can run, edit, and run again, watching concurrency happen in real time: ordering, timing, cancellation, and data races as they actually occur. You build intuition by predicting the output and then seeing exactly where your mental model bends.
Starting from threads, queues, and the hazards that trip everyone up, you work all the way to actors, Sendable, and Swift's modern data-race safety, and come away knowing not just how each tool works, but which one to trust for the job in front of you.
This book teaches concurrency in Swift across both of its eras, the classic model built on Grand Central Dispatch and Operations, and the modern model of async/await, structured concurrency, and actors. Instead of treating the older approach as obsolete, it solves the same problem each way, so you feel the pains the modern tools were designed to relieve and learn when to reach for each.
Every concept comes with small, self-contained examples you can run, edit, and run again, watching concurrency happen in real time: ordering, timing, cancellation, and data races as they actually occur. You build intuition by predicting the output and then seeing exactly where your mental model bends.
Starting from threads, queues, and the hazards that trip everyone up, you work all the way to actors, Sendable, and Swift's modern data-race safety, and come away knowing not just how each tool works, but which one to trust for the job in front of you.
Previews