Context:
From my understanding, the Main DispatchQueue
only dispatch tasks on Main Thread
which is for UI mostly.
However the Main Thread
can also be used by non-main DispatchQueue
s.
Apple has QOS
to priorities the tasks:
User Interactive: Work that happens on the main thread, such as animations or drawing operations.
User Initiated: Work that the user kicks off and should yield immediate results. This work must be completed for the user to continue.
Utility: Work that may take a bit and doesn’t need to finish right away. Analogous to progress bars and importing data.
Background: This work isn’t visible to the user. Backups, syncs, indexing, etc.
My Question Is:
0, as title described, does thread only contain 2 types, which are Main Thread
and Background Thread
?
1, does Background Thread
mean that all the tasks executed won't block the UI ?
2, Since it mentions that the User Interactive
is the priority that the task will be executed on the main thread to avoid UI lags, does it mean all other types: User Initiated
, Utility
, Background
will make sure to have Background Thread
that does not block UI?
3, From the link, How to create dispatch queue in Swift 3.
It mentions a couple of different ways to create a Dispatch Queue, some are concurrent, some are serial. It also mentions that by assigning QOS with default
or background
, it guarantees that the Queue
accesses to background threads
. But nothing like this mentioned in the Serial
and Concurrent
. I wonder are those correct?