Skip to content

Commit 137d653

Browse files
committed
Provide more context about data races in the introduction.
1 parent 0f3f6dc commit 137d653

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

_posts/NNNN-NN-NN-swift-5.10-released.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ title: Swift 5.10 Released
66
author: [hborla]
77
---
88

9-
Swift 5.10 is now available!
9+
Swift was designed to be safe by default, preventing entire categories of programming mistakes at compile time. Sources of undefined behavior in C-based languages, such as using variables before they're initialized or a use-after-free, are defined away in Swift.
10+
11+
A major goals of Swift's concurrency model is to define away the undefined behavior that results from accessing memory from one thread at the same time that another thread is writing to the same memory. This kind of unsafety is called a _data race_, and data races make concurrent programs exceptionally difficult to write correctly. Swift solves this problem through _data isolation_, which requires your code to have mutually exclusive access to shared mutable state. Data isolation enforcement has been under active development since the initial release of Swift concurrency.
1012

1113
Swift 5.10 accomplishes full data isolation in the concurrency language model. This important milestone has taken years of active development over many releases. The concurrency model was introduced in Swift 5.5 including `async`/`await`, actors, and structured concurrency. Swift 5.7 introduced `Sendable` as the fundamental concept for thread-safe types whose values can be shared across arbitrary concurrent contexts without introducing a risk of data races. And now, in Swift 5.10, full data isolation is enforced at compile time in all areas of the language when the complete concurrency checking option is enabled.
1214

0 commit comments

Comments
 (0)