Among some other ways, there are these two ways to get queues in GCD:
dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
dispatch_g
Yes. You can run code like this on a device to test it:
dispatch_async(
dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSLog(@"Block 1a");
NSAssert(![NSThread isMainThread], @"Wrong thread!");
NSLog(@"Block 1b");
});
dispatch_async(
dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
dispatch_async(dispatch_get_main_queue(), ^{
NSLog(@"Block 2a");
NSAssert([NSThread isMainThread], @"Wrong thread!");
NSLog(@"Block 2b");
});
});