CommunityNews

CommunityNews

Swift Evolution - Actors

The Swift concurrency model intends to provide a safe programming model that statically detects data races and other common concurrency bugs. The Structured Concurrency proposal introduces a way to define concurrent tasks and provides data-race safety for functions and closures. This model is suitable for a number of common design patterns, including things like parallel maps and concurrent callback patterns, but is limited to working with state that is captured by closures.

Swift includes classes, which provide a mechanism for declaring mutable state that is shared across the program. Classes, however, are notoriously difficult to correctly use within concurrent programs, requiring error-prone manual synchronization to avoid data races. We want to provide the ability to use shared mutable state while still providing static detection of data races and other common concurrency bugs.

The actor model defines entities called actors that are perfect for this task. Actors allow you as a programmer to declare that a bag of state is held within a concurrency domain and then define multiple operations that act upon it. Each actor protects its own data through data isolation, ensuring that only a single thread will access that data at a given time, even when many clients are concurrently making requests of the actor. As part of the Swift Concurrency Model, actors provide the same race and memory safety properties as structured concurrency, but provide the familiar abstraction and reuse features that other explicitly declared types in Swift enjoy…

This thread was posted by one of our members via one of our news source trackers.

Where Next?

Popular Macos topics Top

AstonJ
If you’ve been looking for a guide on how to a clean macOS install then you’re in luck! I used to do them religiously every major release...
New
First poster: bot
Apple’s Shifting Differentiation. Apple is about the integration of hardware and software, but the balance between the two has shifted o...
New
First poster: bot
The Swift concurrency model intends to provide a safe programming model that statically detects data races and other common concurrency b...
New
First poster: bot
Made a small video today showing the creation of a macOS Droplet using AppleScript. I made it just for fun, and because I realised that m...
New
First poster: bot
Apple Makes OS X Lion and Mountain Lion Free to Download. Apple recently dropped the $19.99 fee for OS X Lion and Mountain Lion, making ...
New
First poster: bot
The report speculates that Apple’s increased use of Google Cloud suggests the company’s rising cloud storage requirements have outpaced i...
New
First poster: Maartz
Until its recent demise, Internet Explorer was the browser hated most by web developers. Internet Explorer is now a thing of the past, r...
New
First poster: bot
I didn’t think this was possible: This App Store app [My Metronome - Tempo Keeper] immediately asks you for money and then disables the ...
New
First poster: bot
YouTuber strips old iMac of its components and turns it into a 5K monitor.
New
First poster: bot
macOS has a wonderful input mechanism where you press and hold a key on your keyboard to display the accent menu. It’s easy to internaliz...
New

Other popular topics Top

AstonJ
If it’s a mechanical keyboard, which switches do you have? Would you recommend it? Why? What will your next keyboard be? Pics always w...
New
Exadra37
I am thinking in building or buy a desktop computer for programing, both professionally and on my free time, and my choice of OS is Linux...
New
Rainer
My first contact with Erlang was about 2 years ago when I used RabbitMQ, which is written in Erlang, for my job. This made me curious and...
New
PragmaticBookshelf
Build highly interactive applications without ever leaving Elixir, the way the experts do. Let LiveView take care of performance, scalabi...
New
wmnnd
Here’s the story how one of the world’s first production deployments of LiveView came to be - and how trying to improve it almost caused ...
New
gagan7995
API 4 Path: /user/following/ Method: GET Description: Returns the list of all names of people whom the user follows Response [ { ...
New
PragmaticBookshelf
Author Spotlight James Stanier @jstanier James Stanier, author of Effective Remote Work , discusses how to rethink the office as we e...
New
AstonJ
Was just curious to see if any were around, found this one: I got 51/100: Not sure if it was meant to buy I am sure at times the b...
New
AstonJ
If you want a quick and easy way to block any website on your Mac using Little Snitch simply… File > New Rule: And select Deny, O...
New
New