Zum Hauptinhalt springen Zur Suche springen Zur Hauptnavigation springen

Modern Concurrency on Apple Platforms

62,99 €

Sofort verfügbar, Lieferzeit: Sofort lieferbar

Format auswählen

Modern Concurrency on Apple Platforms, Apress
Using async/await with Swift
Von Andrés Ibañez Kautsch, im heise Shop in digitaler Fassung erhältlich

Produktinformationen "Modern Concurrency on Apple Platforms"

Build solid software with modern and safe concurrency features. Concurrency is one of the hardest problems in computer science. For years, computer scientists and engineers have developed different strategies for dealing with concurrency. However, the original concurrency primitives are complicated and difficult to understand, and even harder to implement.

Using the new async/await APIs in Swift, this book will explain how your code can abstract a lot of the complexity with a simpler interface so you never have to deal with concurrency primitives such as semaphores, locks, and threads yourself. This will allow you to write concurrent code that is easier to read, easier to write, and easier to maintain. These new APIs are deeply ingrained into Swift, offering compile-level features that will keep you from writing dangerous concurrent code.

You’ll start by exploring why concurrency is hard to implement in a traditional system. Explaining the definition of concurrency and what its primitives are will help you understand why they are hard to use correctly. These concepts will become clearer as you work through the sample projects. The book’s focus then shifts exclusively to the new APIs, helping you understand how the integration of the system with the language itself makes it easier for you to write concurrent code without overstepping the bounds of the concurrency safe zone.

By the end of the book, you’ll have a solid foundation for working safely with concurrent code using the new async/await APIs.

WHAT YOU'LL LEARN

* Understand concurrency and its traditional problems
* Work with the new async/await API and all its features, from the basic usage and await keywords, to task groups and async sequences.
* Implement modern and safe concurrent code that you can start using right away

WHO THIS BOOK IS FOR

Experienced iOS developers at a semi-senior or senior level. Knowledge on the Grand Central Dispatch is a bonus, but not required.

ANDRÉS “ANDY” IBAÑEZ started writing iOS apps as a young college student in 2011. His first introduction to concurrency programming and its common pitfalls was in an Operating Systems class that introduced the importance (and complexity) of writing concurrent code. Since then, he has studied how this problem is solved in Apple’s platforms, including iOS. Andy has worked in institutions that make use of concurrent technologies to keep their services running for their costumers, including banks, applying the concepts to their mobile applications. Chapter 1: Introduction to Concurrency

• What is concurrency?

• Why is concurrency hard to implement?

• Existing methods to implement concurrency in Apple Platforms (before async/await).

Chapter 2: Async/Await Basics

• The keywords and components that play a role in the new concurrency system

• Explaining the `async` keyword

• Explaining the `await` keyword

• Understanding tasks

• Understanding the meaning of Continuations.

Chapter 3: Introducing Structured Concurrency

• Understanding structured concurrency

• Using the `async let` construct to create concurrency.

• Migrating older delegate and callback-based code into async/await.

Chapter 4: The Task Tree

• The Task Tree structure

• Understanding Task cancellation

• What is cooperative task cancellation?

Chapter 5: Task Groups

• Understanding and implementing task groups.

• Implementing concurrency with `withThrowingTaskGroup`

• Understanding `withTaskGroup`.

Chapter 6: Unstructured Concurrency

• Launching concurrent tasks from non-concurrent contexts.

• Understanding detached tasks and how to use them.

Chapter 7: Actors and Global Actors

• Understanding actors as reference types.

• The purpose of state isolation.

• Understanding the purpose of global actors.

Chapter 8: Final Bits

• Understanding the @TaskLocal property wrapper

• Using the `AsyncSequence` protocol in Swift.

• Using AsyncStream to receive events in an awaited loop.

• Sendable types

Audience: Advanced

Artikel-Details

Anbieter:
Apress
Autor:
Andrés Ibañez Kautsch
Artikelnummer:
9781484286951
Veröffentlicht:
14.11.22

Barrierefreiheit

This PDF does not fully comply with PDF/UA standards, but does feature limited screen reader support, described non-text content (images, graphs), bookmarks for easy navigation and searchable, selecta

  • keine Vorlesefunktionen des Lesesystems deaktiviert (bis auf) (10)
  • navigierbares Inhaltsverzeichnis (11)
  • logische Lesereihenfolge eingehalten (13)
  • kurze Alternativtexte (z.B für Abbildungen) vorhanden (14)
  • Inhalt auch ohne Farbwahrnehmung verständlich dargestellt (25)
  • hoher Kontrast zwischen Text und Hintergrund (26)
  • Navigation über vor-/zurück-Elemente (29)
  • alle zum Verständnis notwendigen Inhalte über Screenreader zugänglich (52)
  • Kontakt zum Herausgeber für weitere Informationen zur Barrierefreiheit (99)