Menu
Apple proposes actor model for Swift concurrency

Apple proposes actor model for Swift concurrency

Swift language proposal would add actors as a way to prevent data races and other common bugs in concurrent programming

Credit: Dreamstime

Apple has published a proposal to add an actor model to the Swift programming language. The goal is to provide a mechanism that prevents data races in the Swift concurrency model.

A Swift evolution proposal in the active review stage, posted on GitHub, notes that the actor model would provide the ability to use shared mutable state while providing static detection of data races and other common concurrency bugs.

An actor is a reference type (introduced by the keyword actor :) that protects access to its mutable state. In response to messages, an actor can make local decisions, send more messages, create more actors, and decide how to respond to the next message received.

Actors can modify their own private state but only affect each other indirectly through messaging, thus eliminating the need for lock-based synchronisation.

A concurrency roadmap for the Swift language published last fall included a proposal for actors and actor isolation. A structured concurrency proposal for Swift introduces concurrent tasks and provides data race safety for functions and closures.

While this model is suitable for some design patterns, including parallel maps and concurrent callback patterns, it is limited to working with state captured by closures. Although Swift includes classes that provide a mechanism for declaring mutable state that is shared across a program, classes are difficult to use within concurrent programs.

The actor proposal is set to be reviewed until March 29. The review process was opened on March 15.


Follow Us

Join the newsletter!

Or

Sign up to gain exclusive access to email subscriptions, event invitations, competitions, giveaways, and much more.

Membership is free, and your security and privacy remain protected. View our privacy policy before signing up.

Error: Please check your email address.

Tags AppleSwift

Events

Why experience is the new battleground for partners

Join us for an exclusive webinar, in association with Hewlett Packard Enterprise and Technology Services Industry Association (TSIA) and learn about the latest industry insights and how technology services continue to evolve to deliver differentiated value, and how partners can be successful in 2021 and beyond.

Featured

Slideshows

Channel kicks 2021 into gear as After Hours returns to Auckland

Channel kicks 2021 into gear as After Hours returns to Auckland

After Hours made a welcome return to the channel social calendar with a bumper crowd of partners, distributors and vendors descending on The Pantry at Park Hyatt in Auckland to kick-start 2021.

Channel kicks 2021 into gear as After Hours returns to Auckland
The Kiwi channel gathers for the 2020 Reseller News Women in ICT Awards

The Kiwi channel gathers for the 2020 Reseller News Women in ICT Awards

Hundreds of leaders from the New Zealand IT industry gathered at the Hilton in Auckland on 17 November to celebrate the finest female talent in the Kiwi channel and recognise the winners of the Reseller News Women in ICT Awards (WIICTA) 2020.

The Kiwi channel gathers for the 2020 Reseller News Women in ICT Awards
Leading female front runners honoured at the 2020 Reseller News Women in ICT Awards

Leading female front runners honoured at the 2020 Reseller News Women in ICT Awards

The leading female front runners of the New Zealand ICT industry joined together for the annual Reseller News Women in ICT Awards event at the Hilton in Auckland, during which hundreds of guests celebrated 13 outstanding individuals who won awards, chosen from more than 50 finalists representing over 30 organisations.

Leading female front runners honoured at the 2020 Reseller News Women in ICT Awards
Show Comments