UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

understanding global queues

Forums > Swift

I have read that there is one global queue (provided by the system rather than created by you) for each of the supported quality of service (QoS) values. That implies there are six since the QoS values are userInteractive, userInitiated, default, utility, background, and unspecified. I see that each queue is either serial or concurrent. I also read that there are four global concurrent queues ... default, high, low, and background and that serial queues must be explictly created. So it seems not all of these sources are correct.

I think getting answers to these questions would clear everything up.

  • Is the userInitiated queue the same as the main queue?
  • Is the main queue serial or concurrent?
  • Which QoS corresponds to "high"?
  • Which QoS corresponds to "low"?
  • Is the userInitiated queue serial or concurrent?
  • Is the unspecified queue serial or concurrent?

2      

im also quite interested in multithreading, waiting for someone to clear it up for both of us

2      

This seems like it should answer your questions: Ultimate Grand Central Dispatch tutorial in Swift - The.Swift.Dev., specifically the section on dispatch queues.

2      

@roosterboy Thanks so much for the article link! That did answer all of my questions which I will summarize below. It's an excellent article, but readers should bear in mind that it predates the async/await system, so some things it describes might be considered the old way of doing things. But I believe the queue descriptions in the article are accurate and that's what I was after.

Is the userInitiated queue the same as the main queue? No, it is the same as the "high" global queue

Is the main queue serial or concurrent? It is a serial queue.

Which QoS corresponds to "high"? userInitiated

Which QoS corresponds to "low"? utility

Is the userInitiated queue serial or concurrent? It is concurrent.

Is the unspecified queue serial or concurrent? It is concurrent.

2      

Hacking with Swift is sponsored by Essential Developer

SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until April 28th.

Click to save your free spot now

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.