Modern Concurrency on Apple Platforms: Using Async/Await with Swift

Kautsch, Andrés Ibañez

  • 出版商: Apress
  • 出版日期: 2022-11-15
  • 售價: $2,170
  • 貴賓價: 9.5$2,062
  • 語言: 英文
  • 頁數: 202
  • 裝訂: Quality Paper - also called trade paper
  • ISBN: 1484286944
  • ISBN-13: 9781484286944
  • 相關分類: Apple Developer
  • 海外代購書籍(需單獨結帳)

相關主題

商品描述

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.


商品描述(中文翻譯)

使用現代且安全的並發功能來構建可靠的軟件。並發是計算機科學中最困難的問題之一。多年來,計算機科學家和工程師已經開發了不同的策略來處理並發。然而,原始的並發原語復雜且難以理解,甚至更難實現。

使用 Swift 中的新的 async/await API,本書將解釋如何通過更簡單的接口抽象出很多複雜性,使您不再需要自己處理信號量、鎖和線程等並發原語。這將使您能夠編寫更易於閱讀、更易於編寫和更易於維護的並發代碼。這些新的 API 深深融入 Swift 中,提供了編譯級功能,可以防止您編寫危險的並發代碼。

您將首先探索為什麼在傳統系統中實現並發很困難。解釋並發的定義以及其原語將幫助您理解為什麼它們很難正確使用。通過進行示例項目的工作,這些概念將變得更加清晰。然後,本書的重點專門轉向新的 API,幫助您理解系統與語言本身的集成如何使您能夠在不超出並發安全區域的範圍內編寫並發代碼。

通過閱讀本書,您將建立起使用新的 async/await API 安全地處理並發代碼的堅實基礎。

您將學到以下內容:
- 理解並發及其傳統問題
- 使用新的 async/await API 及其所有功能,從基本用法和 await 關鍵字到任務組和異步序列
- 實現現代且安全的並發代碼,您可以立即開始使用

本書適合有一定經驗的 iOS 開發人員,處於半高級或高級水平。對 Grand Central Dispatch 的了解是一個加分項,但不是必需的。

作者簡介

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.

作者簡介(中文翻譯)

Andrés 'Andy' Ibañez於2011年成為一名年輕的大學生時開始撰寫iOS應用程式。他首次接觸並了解並行程式設計及其常見問題是在一門操作系統課程中,該課程介紹了撰寫並行程式碼的重要性(以及複雜性)。從那時起,他一直研究著如何在蘋果的平台上解決這個問題,包括iOS。Andy曾在使用並行技術維持其服務運行的機構工作,包括銀行,並將這些概念應用於他們的移動應用程式中。