top of page

Swift Concurrency Blog

Each article describes a shared pain in learning modern concurrency

Learn Swift Concurrency through practical online tutorials and downloadable Xcode playgrounds. Each tutorial explains a real problem found in modern iOS development, then walks you through the code used to solve it.

Dark mode · Clear diagrams · Focused explanations · Less distraction.

Tutorial Thumbnal w360-tiny.png

Article

1

What is Concurrency?

Understand concurrency in Swift: how tasks make progress, how the runtime schedules work, and why suspension and cooperation keep iOS apps responsive.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

2

What is the Main Thread?

Understand the iOS main thread: how app execution begins, why UI work belongs there, and how blocking it prevents the interface from updating.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

3

Race Conditions

Learn how race conditions arise when concurrent operations share mutable state, how they differ from data races, and how serialization prevents lost updates.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

4

The Swift Concurrency Runtime

Explore how the Swift Concurrency runtime schedules tasks, jobs and executors, manages suspension and resumption, and cooperates with operating-system threads.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

5

Can I Delay Learning Swift Concurrency?

Learn why iOS developers need to understand Swift Concurrency now, how it fits with SwiftUI and existing code, and how to plan a safe, gradual migration.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

6

What is a Task in Swift?

Understand what a Swift Task represents, how it executes in periods, suspends at await, inherits context, and differs fundamentally from a thread.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

7

What Does Async Mean in Swift?

Learn exactly what async means in Swift, how it changes a function's contract, when suspension can occur, and why async does not create a task or thread.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

8

What Does Await Mean in Swift?

Understand what await means in Swift, how a task may suspend without blocking its thread, and why await is neither a pause nor a background-thread command.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

9

Blocking vs Suspension Points

Compare blocking and suspension in Swift, see how each affects threads and interface responsiveness, and learn why async code can still block an application.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

10

What is Cooperative Scheduling in Swift?

Learn how Swift's cooperative scheduler runs eligible jobs, why suspension creates scheduling opportunities, and how long synchronous work delays other tasks.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

12

What Is MainActor in Swift?

Learn how MainActor protects main-facing state, how isolation is inherited and crossed, and when to use type annotations or MainActor.run in Swift.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

13

What Is an Actor in Swift?

Learn how Swift actors protect mutable state through isolated access, why external calls require await, and why an actor is neither a task nor a thread.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

14

What is Actor Isolation in Swift?

Understand actor isolation in Swift: who may access protected state, when await marks a boundary crossing, and why isolation is about permission, not threads.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

15

What Is Sendable in Swift?

Learn how Sendable identifies values that can safely cross Swift concurrency boundaries, including value types, reference types and compiler enforcement.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

17

What Is @Sendable in Swift?

Learn how @Sendable marks closures that can safely cross concurrency boundaries, what they may capture, and how compiler checks prevent unsafe transfers.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

18

What Is Structured Concurrency in Swift?

Understand Swift structured concurrency, task trees, async let, parent-child lifetimes, cancellation, error propagation and bounded concurrent work.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

19

What Is a Task Group in Swift?

Learn how Swift task groups create a dynamic number of structured child tasks, return results in completion order and handle errors and cancellation.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

20

What Is Task Cancellation in Swift?

Understand cooperative task cancellation in Swift, how code observes cancellation, when to check before publishing results and who should own task lifetime.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

21

What Is an Unstructured Task in Swift?

Learn how unstructured Swift tasks created with Task {} outlive their scope, inherit context and require explicit ownership of results and cancellation.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

22

What Does Task Inheritance Mean in Swift?

Understand what Task {} inherits in Swift, including actor isolation, priority and task-local values, and why inherited context does not create a child task.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

23

What Is Task.detached in Swift?

Learn what Task.detached does in Swift, what context it does not inherit, how cancellation works, and when a detached task is the right tool.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

24

Does Task Run on a Background Thread in Swift?

Discover why Task does not automatically run on a background thread, how actor isolation and executors determine execution, and when synchronous work blocks.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

25

What Is Task Priority in Swift?

Understand Swift task priority as a scheduling hint, how priority is inherited or escalated, and why it cannot guarantee execution order or choose a thread.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

26

What Is a Child Task in Swift?

Learn how Swift child tasks are created with async let and task groups, remain bounded by their parent scope, and inherit cancellation, priority and context.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

27

What Are Task-Local Values in Swift?

Learn how Swift task-local values carry contextual information through async calls and child tasks, support tracing, and restore previous values after a scope.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

28

What Is Actor Reentrancy in Swift?

Understand actor reentrancy in Swift, how state can change across await despite data-race safety, and how to prevent stale assumptions when an actor resumes.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

29

What is a Logical Race in Swift Concurrency?

Learn how logical races occur when safe concurrent operations finish out of order, why actors do not prevent them, and how to enforce latest-result policies.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

30

What Does nonisolated Mean in Swift?

Learn what nonisolated means in Swift, which actor members can opt out of isolation, what state they may access and how it supports synchronous protocols.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

31

What Is a Global Actor in Swift?

Understand Swift global actors, how they isolate declarations across types and files, how to define one and when crossing the boundary requires await.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

38

How to Learn Swift Concurrency

Learn Swift Concurrency from the ground up by understanding processes, threads, race conditions and the problems the modern concurrency runtime was designed to solve. Build the mental model first, then move into tasks, actors, executors and cooperative code.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

39

What is a Process?

Understand what an iOS app process actually is, where the main thread lives, how threads access shared memory, and how your code ultimately reaches the processor. Build the foundation you need before moving into threads, race conditions and Swift Concurrency.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

40

How Does the OS Switch Between Threads?

Learn how the operating system switches between threads, what a context switch actually does, and why thread execution can interleave unpredictably. Build the mental model that connects OS scheduling, race conditions and Swift Concurrency’s cooperative approach.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

41

How Does the CPU Process One Thread of Machine Instructions?

Learn how Swift code becomes machine instructions, how a CPU core executes work from a scheduled thread, and why one line of Swift is not necessarily one indivisible operation. Build the hardware-level mental model that makes race conditions and Swift Concurrency much easier to understand.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

42

How Many Threads Can Each iOS App Create?

GCD global queues can grow to approximately 64 worker threads — but that is not the same as saying an iOS process can contain only 64 threads. Learn what the 64-thread figure actually means, why threads consume resources, how thread explosion happens, and why Swift Tasks provide a better model for large amounts of asynchronous work.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

43

Does My App Process Provide a Default Thread?

Yes. Every iOS application begins execution with an initial thread — the main thread. Learn where the main thread comes from, how it fits inside your app's process, why UI work is associated with it, what the main run loop does, and how DispatchQueue.main and @MainActor relate to the same underlying execution architecture.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

44

What Plugs Into the Processor: a Process or the Thread?

A thread — not an entire process — provides the execution context that the OS schedules onto a CPU core. Learn how processes provide an app's memory environment, how threads execute within that process, what the OS actually schedules, and where GCD queues and Swift Tasks fit above the underlying processor architecture.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

45

Are Threads Grouped Together Globally in the OS or Are They Confined Inside Each App?

Threads belong to individual app processes, but the operating system schedules runnable threads from across the entire system onto available CPU cores. Learn how process ownership, shared memory, system-wide scheduling and Swift Concurrency fit together in one complete execution model.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

46

Why Does Swift Concurrency Need a Runtime?

Swift Concurrency needs a runtime because Tasks are not threads. Learn why the OS thread scheduler alone cannot provide Swift's Task, suspension, executor and actor-isolation model, and see how Swift's cooperative concurrency system fits above threads, the OS scheduler and CPU cores.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

47

What Actually Happens When a Swift Task Suspends?

Swift Concurrency changes how we think about progress. Learn why finishing one operation as quickly as possible can still produce a slow, jerky app, how suspension lets Tasks remain unfinished without blocking a thread, and why cooperative code is about allowing the whole application to keep making progress together.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

48

What Is an Executor in Swift Concurrency?

An executor is the Swift Concurrency service that executes eligible jobs. Learn how executors connect Tasks to system threads, why actors use serial executors, how MainActor reaches main-thread execution, and why an executor is not simply another thread or dispatch queue.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

49

How Does an Actor Execute Multiple Tasks Safely?

An actor safely handles multiple Tasks by serialising its actor-isolated jobs so that only one executes at a time. Learn what “serialise” actually means, why an actor is more than a lock around a stored property, and how await allows another Task to get a turn without sacrificing data-race safety.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

50

Does @MainActor Mean the Work Executes on the Main Thread?

Yes — MainActor-isolated work executes on the main thread. Learn how an async MainActor Task can execute on the main thread, suspend at await, free the main thread for other work, and later resume its MainActor-isolated continuation on the main thread again.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

51

What Are the Benefits of Swift Concurrency?

Swift Concurrency makes asynchronous iOS code safer, more structured and easier to reason about. Explore the benefits of Tasks, suspension, actors, MainActor, Sendable, structured concurrency, cancellation, compiler checking and cooperative execution.

Add a Title

Tutorial Thumbnal w360-tiny.png

Article

52

What is Modern iOS Architecture?

Learn how modern iOS architecture organises product features, observable state, dependencies and asynchronous work to create responsive, maintainable SwiftUI applications.

Add a Title

end of articles.

bottom of page