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

New
First poster: bot
Apple has acquired about 100 companies over the last six years, the company’s chief executive Tim Cook has revealed. That works out at a...
New
First poster: bot
Safari supports WebGPU experimentally with WSL kernels. I wrote a simple tuner that tries to optimize matrix multiplication. If you have ...
New
First poster: bot
mathiasbynens/dotfiles. :wrench: .files, including ~/.macos — sensible hacker defaults for macOS - mathiasbynens/dotfiles This threa...
New
First poster: bot
Malicious hackers have been exploiting a vulnerability in fully updated versions of macOS that allowed them to take screenshots on infect...
New
First poster: OvermindDL1
Meet Safari 15: redesigned and ready to help people explore the web. Discover how you can approach designing websites and apps for Safari...
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
CommunityNews
This article is about how I found a vulnerability on Apple forgot password endpoint that allowed me to takeover an iCloud account. The vu...
New
First poster: bot
First Look: macOS Monterey Public Beta. If there’s a theme of Apple’s operating-system releases in 2021, it’s platform unification. This...
New
First poster: bot
I recently received a tantalizing email from a reader I’ve never met: Sam Henri-Gold. Sam showed me how you can key in a couple write co...
New

Other popular topics Top

New
wolf4earth
@AstonJ prompted me to open this topic after I mentioned in the lockdown thread how I started to do a lot more for my fitness. https://f...
New
DevotionGeo
I know that -t flag is used along with -i flag for getting an interactive shell. But I cannot digest what the man page for docker run com...
New
AstonJ
Curious to know which languages and frameworks you’re all thinking about learning next :upside_down_face: Perhaps if there’s enough peop...
New
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
AstonJ
Inspired by this post from @Carter, which languages, frameworks or other tech or tools do you think is killing it right now? :upside_down...
New
New
PragmaticBookshelf
Author Spotlight: Peter Ullrich @PJUllrich Data is at the core of every business, but it is useless if nobody can access and analyze ...
New
New