I am using GCD in my IOS app. I have threes threads: the main thread, thread 2, and thread 3.
The following code is executed on thread 2,
dispatch_async(dispatch_get_main_queue(), ^{ code block 1 ...
so code bock 1 will be executed on the main thread. What happens if the following code is executed in thread 3 before code bock 1 finish running:
dispatch_async(dispatch_get_main_queue(), ^{ code block 2 ...
will bock2 wait until bock1 terminates?
How can I find answers of such questions? Shall I read APPLE's documents or do some experiments myself? What kind of experiments can I do?