Isolation domain
In Swift concurrency, the region that owns some mutable state: an actor, the main actor, or nonisolated code.
Definition
Each actor, including the main actor, owns its state and runs one piece of its code at a time; code outside must await to reach it. Values that move from one domain to another must be Sendable. Choosing the isolation of each type is the core design decision when adopting the Swift 6 language mode.
In practice
View models live on the main actor, the image cache is its own actor, and models are Sendable structs that move between them.
Learn it in context
Lessons that use this term.
Related terms
- ActorA Swift type that protects its mutable state by running only one of its methods at a time.
- SendableA Swift protocol that marks values as safe to pass between concurrently running tasks and actors.
- Data raceTwo threads accessing the same memory at the same time, at least one of them writing, without synchronization.