主队列(主线程串行)
dispatch_async(dispatch_get_main_queue(), ^{
});
全局队列(非主线程并行)
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0),^{
});
DISPATCH_QUEUE_PRIORITY_HIGH
DISPATCH_QUEUE_PRIORITY_DEFAULT
DISPATCH_QUEUE_PRIORITY_LOW
DISPATCH_QUEUE_PRIORITY_BACKGROUND
自定义队列(非主线程)
(串行)
dispatch_async(dispatch_queue_create("xxxx", DISPATCH_QUEUE_SERIAL), ^{
});
(并行)
dispatch_async(dispatch_queue_create("xxxx", DISPATCH_QUEUE_CONCURRENT), ^{
});