Swift.org Oct 1, 2020

Swift Atomics Library

Article Summary

Karoy Lorentey from Apple just dropped Swift Atomics, bringing C/C++ style low-level atomic operations directly into Swift. This changes the game for systems programmers who've been blocked from building concurrent data structures in pure Swift.

Apple's Swift team released an open source package enabling atomic operations in Swift code, based on the recently accepted SE-0282 proposal. The library provides the foundation for building synchronization constructs and concurrent data structures without resorting to other languages.

Key Takeaways

Critical Insight

Swift developers can now build concurrent data structures in pure Swift using carefully designed atomic APIs that were previously only accessible through C/C++.

The article reveals why atomic strong references might be the most interesting feature, and what double-wide primitives enable for solving common concurrency problems.

Recent from Swift.org

Related Articles