Wednesday, March 22, 2023

Swift Atomics 1.1

Karoy Lorentey (Mastodon):

This change will finally enable widespread use of atomic strong references in Swift code.


ManagedAtomic will finally become conditionally Sendable when its Value is Sendable. This has proved to be a constant pain point for users, especially when first trying out the package, or in the simplest production use cases.


Non-copiable types are quickly approaching, and they are an important step towards modeling synchronization primitives such as atomics as Swift native constructs.


I expect Swift Atomics 1.2 will introduce Atomic<Value> soon after the language matures enough to support it, if and when that happens. (I also expect the Standard Library to start providing the same or (similar) construct at that point, eventually replacing the need for this package altogether.)


Comments RSS · Twitter · Mastodon

Leave a Comment