Actors are reference types, but why classes? The recently announced Swift Concurrency Roadmap includes the proposal of an Actor reference type, similar to a class type. In this whitepaper, Chris Lattner explores the behavior and requirements of actors and proposes that Actor types be modeled as a new kind of nominal reference type in Swift. Posted on December 16, 2020 #concurrency #evolution #actor
Swift Concurrency Proposal Dependencies The Swift Concurrency Roadmap was recently published, which outlined proposed additions and changes to the language to support concurrent programming. It's a great read, and very informative. However, if you are looking for a quick overview of the dependencies relating to the concurrency roadmap, this diagram from Doug Gregor is a good place to start. Posted on December 9, 2020 #concurrency #diagram
What went wrong with the libdispatch. A tale of caution for the future of concurrency. Apple's Grand Central Dispatch (GCD or libdispatch) provides support for concurrent code execution on multicore hardware. It aims to remove the need for developers to directly manage threads, enabling them to instead think in terms of queues of work. In this very interesting post, Thomas examines some of the problems of using libdispatch, offering words of caution for the future of concurrency in Swift. Posted on December 2, 2020 #concurrency
Combine and Swift Concurrency The Swift Core Team recently provided an excellent roadmap and series of language proposals outlining the future of concurrent programming in Swift. In this post, Joseph Heck looks at what the roadmap means for the Combine framework and how it might gain from the proposed concurrency concepts. Posted on November 26, 2020 #combine #concurrency
Swift Concurrency Roadmap This post from the official Swift forums outlines the Swift Concurrency Roadmap. The goal of this roadmap is to make concurrent programming in Swift convenient, efficient, and safe. There is a lot to unpack in this post, but it's definitely worth reading, and there are some great language features planned for the first phase of the roadmap. Posted on November 9, 2020 #concurrency #evolution
Introducing Swift Atomics Atomic operations are operations that run completely independently of other processes and will be fully executed without interruption. In this post on the official Swift blog, Karoy Lorentey from the Swift team announces Swift Atomics, a new open-source Swift package that enables low-level atomic Swift operations. Posted on October 9, 2020 #atomic #concurrency
Swift globals and static members are atomic and lazily computed A lazy stored property in Swift is a property whose initial value is not calculated until the first time it used. This is useful as it allows us to delay the initialization of a property that requires a computationally expensive setup until that property is actually needed. In this post, Jesse Squires reminds us that Swift globals and static members are also lazily initialized, and he explains how the concept of atomicity is distinct from the concept of thread-safety. Posted on July 26, 2020 #concurrency
Static Thread Safety This is an interesting Swift evolution draft proposal. In it, Guy Brooker proposes some small language changes which would allow the Swift compiler to spot basic concurrent programming errors. I like the syntax Guy proposes for specifying execution context. Posted on June 20, 2020 #evolution #concurrency
Atomic Properties in Swift Vadim Bulavin demonstrates how we can use locking APIs available in Apple frameworks to implement atomic properties in Swift. Vadim first describes the core concepts relating to concurrency and atomic properties, before providing code examples of Swift atomic properties. Posted on July 17, 2018 #concurrency #locking #atomic
Basics of parallel programming with Swift This is a great post from Jan Olbrich in which he covers the basics of concurrency and parallel programming in Swift. Jan starts by describing the difference between concurrency and parallelism, and then walks us through the various mechanisms available to us in Swift. Posted on January 28, 2018 #concurrency #parallelism