Member-only story
Swift Thread-Safe Arrays
Be careful! This applies to value types!
Difficulty: Beginner | Easy | Normal | Challenging
This article has been developed using Xcode 11.7, and Swift 5.2.4
Prerequisites:
- You will be expected to make a Single View SwiftUI Application in Swift.
Terminology
Array: An ordered series of objects which are the same type
Concurrency: means that two tasks can start, run and complete in overlapping time periods
Parallelism: is about performing work at the same time
The motivation
Concurrency is a big part of programming, and this article covers where you may actually encounter this in your day-to-day work as an iOS programmer.
Since many devices (including iOS devices) embrace the principles of parallelism (that is, executing on many threads at the same time).
There is a special type of problem in Computer Science — The Readers-Writers problem.