I have a need to create serial queue in our iPhone app. I use dispatch_queue_t in our code like this:
dispatch_queue_t MyQueue = dispatch_queue_create("My Queue", DISPATCH_QUEUE_SERIAL);But I want to know the difference between dispatch_sync and dispatch_async.
Can anyone explain me both differences? and which will be the best to use in our code.
Thank you.
Tarun Kumar
20-Feb-2016dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void) { // this is the background thread dispatch_async(dispatch_get_main_queue(), ^(void){ // here you can display the updates of the progress bar }); });