Skip to Content
Modern Concurrency on Apple Platforms: Using async/await with Swift
book

Modern Concurrency on Apple Platforms: Using async/await with Swift

by Andrés Ibañez Kautsch
November 2022
Intermediate to advanced content levelIntermediate to advanced
213 pages
3h 46m
English
Apress
Content preview from Modern Concurrency on Apple Platforms: Using async/await with Swift
© Andrés Ibañez Kautsch 2023
A. I. KautschModern Concurrency on Apple Platformshttps://doi.org/10.1007/978-1-4842-8695-1_6

6. Actors

Andrés Ibañez Kautsch1  
(1)
La Paz, Bolivia
 

So far, we have covered about writing concurrent code in Swift using tasks that are independent of each other. You run some tasks, and oftentimes deliver the results to the main thread. But there are cases in which you need to have shared mutable state in your program – a common mutable source that your code can read from and write to. This source can be a simple variable, or it can be a file, or it can be any other kind of resource that is dangerous to access concurrently, yet it needs to be available to multiple tasks at the same time.

If you have multiple pieces of code ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Asynchronous Programming with SwiftUI and Combine: Functional Programming to Build UIs on Apple Platforms

Asynchronous Programming with SwiftUI and Combine: Functional Programming to Build UIs on Apple Platforms

Peter Friese
Concurrency in Go

Concurrency in Go

Katherine Cox-Buday

Publisher Resources

ISBN: 9781484286951Purchase LinkPublisher Website