Only [self doSomething]
will be synchronized call and using dispatch_async
will be asynchronized call.
Statement A
[self doSomething]
Statement B
Above code will start executing Statement A, finish Statement A
, Start executing function doSomething
, finish function doSomething
and then start executing and finish Statement B
.
Statement A
dispatch_async(dispatch_get_main_queue(), ^{
[self doSomething]
})
Statement B
Above block will start and finish execution of Statement A
, then it adds doSomething
function call in the queue (it may or may not start immediately) then it will start execution of Statement B
without waiting to finish execution of function doSomething
.
So, if Statement B
(and other statements which are after your function call) is independent of result of function doSomething
, then you can do async call.