Skip to content

Instantly share code, notes, and snippets.

@asilturk
Created October 21, 2021 19:28
Show Gist options
  • Save asilturk/f4fba598b8748faa83cc932c062c36d9 to your computer and use it in GitHub Desktop.
Save asilturk/f4fba598b8748faa83cc932c062c36d9 to your computer and use it in GitHub Desktop.
DispatchQueue
// main queue
DispatchQueue.main
// high priority global queue
DispatchQueue.global(qos: .userInteractive)
// low priority global queue
DispatchQueue.global(qos: .background)
// private serial queue
let serialQueue = DispatchQueue(label: "private serial queue")
// private concurrent queue
let concurrentQueue = DispatchQueue(label: "concurrent queue", attributes: .concurrent)
// private serial queue with low priority
let serialQueueLowPriority = DispatchQueue(label: "serial queue lp", qos: .background)
// private concurrent queue with high priority
let concurrentQueueHighPriority = DispatchQueue(label: "concurrent hp", qos: .userInteractive, attributes: .concurrent)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment