Sitemap
iOS IC Weekly

Record my iOS IC d2d work on millions user-base applications and my love for Swift.

Executors vs. Actor Isolation in Swift Concurrency — Understanding the Difference

15 min readJun 6, 2025

--

Swift’s modern concurrency model introduces two closely related concepts — executors and actor isolation — which together ensure thread-safe, efficient asynchronous code. However, these concepts serve distinct purposes. Recent Swift Evolution proposals (notably SE‑0420: Inheritance of Actor Isolation) refine how executors and isolation interact, allowing functions to explicitly inherit an actor context. This article dives into the relationship between executor suspension behavior and actor isolation, explaining why we still need to explicitly mark actor isolation (e.g. via an isolated parameter or the new #isolation macro) even if using the same executor avoids a thread hop. We’ll explore the language design rationale and practical implications for advanced Swift developers, including:

  • The role executors play in scheduling and suspension.
  • Why actor isolation remains crucial independent of executor mechanics.
  • Details of the SE‑0420 proposal on inheriting actor isolation.
  • Examples of when not specifying isolation can lead to unintended behavior or bugs.
  • Impact on performance (avoiding extra context switches), correctness (reentrancy), and concurrency safety.

The Role of Executors in Swift Concurrency

Executors are the pieces of Swift’s concurrency runtime that manage how and where asynchronous…

--

--

iOS IC Weekly
iOS IC Weekly

Published in iOS IC Weekly

Record my iOS IC d2d work on millions user-base applications and my love for Swift.

Xiangyu Sun - 孙翔宇
Xiangyu Sun - 孙翔宇

Written by Xiangyu Sun - 孙翔宇

Share my experience in iOS and swift domain and talk about mobile architecture, testing, and engineering stuff.

No responses yet