10.5 · Region-based isolation, sending, and migrating to Swift 6

Swift 6 turns data races from a debugging session into compile errors. The language gives you three tools for crossing boundaries safely: Sendable, regions and sending.

Mental model. A data race needs shared mutable state across domains. The compiler proves that either nothing is shared, or nothing is mutable, or someone is in charge.

Crossing boundaries

Region-based isolation and <code>sending</code>.

  1. How does region-based isolation work, and what does the sending keyword add on top of Sendable? 10.5.1 · L5
    Plain Sendable is a type property: “values of this type are safe to share”, and most classes are not. That was too strict: passing a freshly created object to…

Migrating

Adopting strict concurrency in a real app.

  1. How do you migrate an existing app to Swift 6 and strict concurrency without breaking it? 10.5.2 · L8
    Swift 6 mode turns the concurrency checks that were warnings into errors, so you migrate in steps instead of flipping a switch. The checking level can be…

More in Concurrency