I'm attempting to load two sets of data in the background simultaneously through GCD in iOS. Currently, I built two distinct concurrent queues, in which I run each of the tasks. However, the delay between the completion of the first queue and the second queue (which run identically intensive tasks) is very large (so I assume that they are not running concurrently). Do you guys have any suggestions about how to fix this? I don't completely understand the correct way to approach this. Thanks!
dispatch_queue_t myQueue = dispatch_queue_create("com.a.identifier", DISPATCH_QUEUE_CONCURRENT);
dispatch_queue_t myQueue2 = dispatch_queue_create("com.a.identifier2", DISPATCH_QUEUE_CONCURRENT);
dispatch_async(myQueue, ^{
[self fetchDataWithDataFromUrl:[NSURL URLWithString:linkOne]];
dispatch_async(dispatch_get_main_queue(), ^{
[self.tableView reloadData];
});
});
dispatch_async(myQueue2, ^{
[self fetchDataWithDataFromUrl2:[NSURL URLWithString:linkTwo]];
dispatch_async(dispatch_get_main_queue(), ^{
[self.tableView reloadData];
});
});