Open in app

Sign In

Write

Sign In

Alex Shchukin
Alex Shchukin

49 Followers

Home

About

May 5

GCD Primitives in Depth: Serial Queue

In the previous article, we implemented DispatchSemaphore and DispatchGroup ourselves. Today, we will develop a simplified version of DispatchQueue, called SerialQueue. This solution focuses on two basic methods: sync and async. The sync method executes a task on the calling thread and awaits its completion, whereas the async method carries…

IOS

12 min read

GCD Primitives in Depth: Serial Queue
GCD Primitives in Depth: Serial Queue
IOS

12 min read


Dec 14, 2022

Lock-free algorithms using Swift. Part 1: Fundamentals.

I want to start another series of articles about lock-free algorithms and how we can implement them using swift atomics framework. It’s a very complicated topic with a lot of hidden stones there. I want to mention that it’s very difficult to debug and find mistakes. Sometimes algorithms can behave…

Swift

19 min read

Lock-free algorithms using Swift. Part 1: Fundamentals.
Lock-free algorithms using Swift. Part 1: Fundamentals.
Swift

19 min read


Oct 19, 2022

GCD Primitives in Depth: Semaphore and Group

In this article, we will implement some of the GCD classes using low-level primitives to understand how GCD is actually functioning. Semaphore We’re going to begin with DispatchSemaphore, although what we’ll be implementing is a simplified version. The real DispatchSemaphore has a much more specific set of functionalities. …

Gcd

6 min read

GCD Primitives in Depth: Semaphore and Group
GCD Primitives in Depth: Semaphore and Group
Gcd

6 min read


Apr 18, 2022

GCD Part 5: DispatchSource and Target Queue Hierarchy

In this article, we will discuss some niche concepts such as DispatchSource and target queue hierarchy. DispatchSource DispatchSource is the fundamental type that handles system events. It can be an event listener for different types like file system events, signals, memory warnings and etc. I don’t think we often use this…

IOS

4 min read

IOS

4 min read


Nov 19, 2021

GCD Part 4: Synchronization

The topic of today’s article is synchronization. It’s one of the most important concepts in multithreading. And we will see how we can provide thread safety using GCD primitives. Semaphore And the first primitive we will consider is DispatchSemaphore. I guess you’ve heard about mutex before. Briefly, it’s a construction that…

IOS

4 min read

IOS

4 min read


Sep 16, 2021

GCD Part 3: DispatchGroup and concurrentPerform

Today we will consider one of the most useful GCD components DispatchGroup and also we will take a look at the concurrentPerform method and dispatch precondition. DispatchGroup In some cases, we need to follow a certain order of our tasks. To solve these issues we can use DispatchGroup. As you remember…

IOS

4 min read

IOS

4 min read


Jul 2, 2021

GCD Part 2: DispatchWorkItem and Quality of Service

This is the second part of the GCD series and here we will discuss QoS and DispatchWorkItem. DispatchWorkItem There is a way to add a task to the queue through a special class called DispatchWorkItem instead of direct passing the closure to async or sync methods. This class provides additional methods…

IOS

6 min read

IOS

6 min read


May 26, 2021

GCD Part 1: Queues and methods

I would like to start a series of articles about Grand Central Dispatch (GCD). GCD or libdispatch is one the most popular instruments for multithreading programming in iOS and macOS. It’s a library written in C to ease thread management. …

IOS

5 min read

GCD Part 1: Queues and methods
GCD Part 1: Queues and methods
IOS

5 min read

Alex Shchukin

Alex Shchukin

49 Followers

iOS Engineer

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech

Teams