Member-only story

The Complete Guide to Concurrency and Multithreading in iOS

Main thread vs. background thread. Async/await and Actor. GCD vs. OperationQueue. Group dispatch, how to empower background thread, and more

Varga Zolt
Better Programming
11 min readFeb 15, 2022
Multiple threads through a needle
Photo by John Anvik on Unsplash

Introduction

In this article, we will learn the following:

TABLE OF CONTENTSWhat Is Multithreading
Serial Queue vs. Concurrent Queue
Parallelism
Concurrency
Basics of Multithreading
Main Thread (UI Thread) vs. Background Thread (Global Thread)
GCD (Grand Central Dispatch)
DispatchGroup
DispatchSemaphore
DispatchWorkItem
Dispatch Barrier
AsyncAfter
(NS)Operation and (NS)OperationQueue
DispatchSource (How To Handle Files and Folders)
Deadlock (Issue What To Avoid)
Main Thread Checker (How To Detect Thread Issues)
Threads in Xcode (How To Debug Threads)
Async / Await / Actor Is iOS13+

I know there are lots of topics. If something is already familiar to you, skip it and read the unknown parts. There are tricks and tips.

Multithreading in Real-World Examples

Imagine you have a restaurant. The waiter is gathering the orders. The kitchen is preparing the food, the bartender is making the coffee and the cocktails.

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Varga Zolt
Varga Zolt

Written by Varga Zolt

 Mobile Tech Lead📱 🧑‍💻 Writing about new Technologies. Coding for fun since 2005, for food since 2008 🚀 Site: https://bit.ly/skyspiritlabs

Responses (4)

What are your thoughts?