As I understand there are 3 types of DispatchQueue in swift:
- Main (serial) (Main Thread)
- Global (Concurrent) (Background Threads working in parallel)
- Custom (Concurrent or serial)
And each one maybe work (asynch or synch)
First question:
Is it main queue working on UI thread only and not working on another thread?
If the answer yes , how DispatchQueue.Main.async
not blocking UI thread.
If the answer No , what is the benefit of using DispatchQueue.global
as long as DispatchQueue.Main.async
work in another thread.
Second question:
what is deference between DispatchQueue.global (async) and DispatchQueue.global (sync) as long as this queue working Concurrent and where to use each one?
Third question:
what is defference between
- (serial and sync)
- (Concurrent and async)