Concurrency by Tutorials: Multithreading in Swift with GCD and Operations
โ Scribed by Scott Grosch
- Publisher
- Razeware LLC
- Year
- 2019
- Tongue
- English
- Leaves
- 116
- Edition
- 2
- Category
- Library
No coin nor oath required. For personal study only.
โฆ Synopsis
Dive into Concurrency in iOS apps!
Concurrency is the concept of multiple things, or pieces of work, running at the same time. With the addition of CPU cores in our devices, knowing how to properly utilize your customer's hardware to the maximum is absolutely a must. However, proper concurrency in iOS apps is one of the lesser-known topics that every developer wants to (and should) understand properly, but is usually intimidated by. This is where Concurrency by Tutorials comes to the rescue! In this book, youโll learn everything there is to know about how to write performant and concurrent code for your iOS apps.
Who This book Is For
This book is for intermediate iOS developers who already know the basics of iOS and Swift development but want to learn how to make their app efficiently perform tasks without affecting performance, and how to properly divide work to utilize hardware to the fullest extent.
What & Why: Learn what is Concurrency and why would you even want to utilize it in your apps?
Grand Central Dispatch: Learn about Apple's implementation of C's libdispatch, also known as GCD, it's one of the simplest ways to queue up tasks to be run in parallel.
Operations & Operation Queues: When GCD doesn't quite cut it, you'll learn how to further customize and reuse your concurrent work using Operations and Operation Queues.
Common Concurrency Problems: Learn about some of the problems you could face while developing concurrent applications, such as Race Conditions, Deadlocks, and more.
Threads & Thread Sanitizer: Understand various threading-related concepts and how these connect to the knowledge you've accumulated throughout this book. You'll also learn how to use Thread Sanitizer to ease your debugging when things go wrong.
This book is sure to make you a pro in building concurrent and performant appllications, and finally understanding how these lower-level APIs work to the fullest, pushing your app to the top!
About Scott Grosch
Scott Grosch has been involved with iOS app development since the first release of the public SDK from Apple, and spends his days as a Solutions Architect at a Fortune 500 companyin the Pacific Northwest.
โฆ Table of Contents
About the Cover
About the Author
About the Editors
About the Artist
Acknowledgements
What You Need
Book License
Book Source Code & Forums
Chapter 1: Introduction
What is concurrency?
Why use concurrency?
How to use concurrency
Where to go from here?
Chapter 2: GCD & Operations
Grand Central Dispatch
Operations
Which should you use?
Where to go from here?
Chapter 3: Queues & Threads
Threads
Dispatch queues
Image loading example
DispatchWorkItem
Where to go from here?
Chapter 4: Groups & Semaphores
DispatchGroup
Semaphores
Where to go from here?
Chapter 5: Concurrency Problems
Race conditions
Deadlock
Priority inversion
Where to go from here?
Chapter 6: Operations
Reusability
Operation states
BlockOperation
Subclassing operation
Chapter 7: Operation Queues
OperationQueue management
Fix the previous project
Where to go from here?
Chapter 8: Asynchronous Operations
Asynchronous operations
Networked TiltShift
Where to go from here?
Chapter 9: Operation Dependencies
Modular design
Specifying dependencies
Watch out for deadlock
Passing data between operations
Updating the table view controller
Where to go from here?
Chapter 10: Canceling Operations
The magic of cancel
Cancel and cancelAllOperations
Updating AsyncOperation
Canceling a running operation
Where to go from here?
Chapter 11: Core Data
NSManagedObjectContext is not thread safe
Importing data
NSAsynchronousFetchRequest
Sharing an NSManagedObject
Where to go from here?
Chapter 12: Thread Sanitizer
Why the sanitizer?
Getting started
Enabling sanitization
Itโs not code analysis
Xcode keeps getting smarter
Where to go from here?
Conclusion
๐ SIMILAR VOLUMES
C++ Concurrency in Action is a reference and guide to the new C++ 11 Standard for experienced C++ programmers as well as those who have never written multithreaded code. This book will show you how to write robust multithreaded applications in C++ while avoiding many common pitfalls.<br>Multiple pro
C++ Concurrency in Action is a reference and guide to the new C++ 11 Standard for experienced C++ programmers as well as those who have never written multithreaded code. This book will show you how to write robust multithreaded applications in C++ while avoiding many common pitfalls.<br>Multiple pro
ๅ ๅฎน็ฎไป ยท ยท ยท ยท ยท ยท HIGHLIGHT C++ Concurrency in Action is the first book to market to show how to take advantage of the new C++ Standard and how to write robust multi-threaded applications in C++. DESCRIPTION With the new C++ Standard and Technical Report 2 (TR2), multi-threading is coming to C++ in
With the new C Standard and Technical Report 2 (TR2), multi-threading is coming to C in a big way. TR2 will provide higher-level synchronization facilities that allow for a much greater level of abstraction, and make programming multi-threaded applications simpler and safer.</p> <p>As a guide an
Without assuming you have a background in the subject, C++ Concurrency in Action gradually enables you to write robust and elegant multithreaded applications in C++11. You'll explore the threading memory model, the new multithreading support library, and basic thread launching and synchronization fa