Skip to content

swift-miami/Concurrency101

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 

Repository files navigation

Concurrency101

Gio + Iván holiday special: Concurrency

Playground Pages:

  • Sync vs Async
  • Serial vs Concurrent
  • DispatchGroup
  • DispatchQueue
  • Thread-Safe Data Structure
  • OperationQueue
  • Semaphore
  • Deadlock

Resources:

General Advice:

  • Avoid using concurrent queues at all cost.
    • Instead use a serial queue per sub system and use a target queue if you need subsystems to interact.
    • Reader/writer locks tend to be a source of great complexity and hard to get right, specially in Swift which is bad at atomic access. If needed it’s better to use os_unfair_lock
  • Combine helps handling concurrency with its stream of events API.
  • Don’t use GlobalQueues.
  • Shouldn’t need to specify QoS unless for example you start a process in the main queue and want it to go in the background specifically. Otherwise let the system determine the QoS for you.

Releases

No releases published

Packages

No packages published

Languages