Swift Thread-Safe Arrays

Be careful! This applies to value types!

Photo by amirali mirhashemian on Unsplash

Prerequisites:

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.

Conclusion

You need to be careful even with value types when in a multi-threaded environment. This article has given a rather brief introduction and I hope you’ve enjoyed it.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store