Home Science & Technology Modern Parallelism in Swift | Kodeco

Modern Parallelism in Swift | Kodeco


This section covers a few things you need to know before you get started, such as what you’ll need for hardware and software, where to find the project files for this book, and more.

Learn about Swift’s modern parallelism model, then dive deep into asynchronous code while working on a real-time stock trading project.

Learn more about how the async/await syntax and shared asynchronous execution work. In addition, it introduces the use of “async let” to develop concurrent code and the “Task” type, which encapsulates asynchronous execution in the modern parallel execution model.

Work with async sequences in more detail by proxying Combine for async/await code and managing async tasks.

Create custom async sequences using AsyncStream, which lets you wrap existing async work in your application into an async sequence without spending a lot of time.

Learn about resumes, which are a way to manually manage suspended features. You’ll use them to transition between existing async/await code and modern concurrent APIs.

Develop an asynchronous testing infrastructure and learn the ins and outs of testing asynchronous code in the new parallelism model. You’ll finish by adding unit tests to the Blabber project you worked on in the previous chapters.

Create dynamic parallelism with task groups that allow any number of tasks to run concurrently and offer a natural sequencing interface to access and iterate over the results of those tasks.

Actor is a new Swift type that transparently protects its mutable state from data races in a synchronized container, making parallel programming much safer.

Now that you know actors, you’ll learn about a special subset of them—global actors—that allow easy and secure access to shared resources from anywhere in your application.

Create a distributed system that uses actors to execute tasks simultaneously on multiple devices over a local network.

Previous articlePixel 7 and Pro display jitter is finally fixed
Next articleThe iPhone 15 Pro is recommended for thinner and curved frames