Two kinds of functions :
1>sync sync function ,
2>Async async function ,
Four types of queues :
1>main queue home row
2> manually created serial queues
3> Global concurrency queue
4> manually created concurrent queues
The program verifies that the two functions work together with four types of queues : A total of eight . Global concurrent queues and created concurrent queues perform the same effect, not given.
Results :
1> deadlock , the previous article has been introduced , add one thing is : The main thread in the current queue adds a task to deadlock , add to another queue does not
2> synchronization function with four queues does not open a new thread
The 3> async function does not open a new thread when mated to the home column , and other cases open the thread .
4> in the serial execution of tasks, or concurrent execution of tasks , to clarify which queue , refers to the queue after switching .
Here are eight cases of code :
The following code is the serial queue asynchronous execution, the output forgot to change:
Analysis of different queues in gcd with different functions