GCD 并行子线程

1. 创建一个线程

  dispatch_queue_t globalQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);

2. 将任务放进该线程

  dispatch_async(globalQueue, ^{

    NSLog(@"并行子线程任务1 -- %@",[NSThread currentThread]);

  });

  dispatch_async(globalQueue, ^{

    NSLog(@"并行子线程任务2 -- %@",[NSThread currentThread]);

  });

   

本内容来自: 超越昨天(学无止境) - http://www.cnblogs.com/xvewuzhijing/
原文地址:https://www.cnblogs.com/xvewuzhijing/p/4898296.html