cocoa touch - Is the main Grand Central Dispatch queue serial or concurrent? -
suppose call dispatch_async() 3 times in order:
dispatch_async(dispatch_get_main_queue(), ^{ [self doone]; }); // code here dispatch_async(dispatch_get_main_queue(), ^{ [self dotwo]; }); // more code here dispatch_async(dispatch_get_main_queue(), ^{ [self dothree]; }); will executed like
[self doone], [self dotwo], [self dothree], or order guaranteed?
in case, question if main queue serial or concurrent.
from documentation:
dispatch_get_main_queuereturns serial dispatch queue associated application’s main thread.
so main queue serial queue, , [self doone], [self dotwo], [self dothree] executed sequentially in order.
Comments
Post a Comment