美文网首页
神奇的"主线程主队列,异步提交任务"

神奇的"主线程主队列,异步提交任务"

作者: 大成小栈 | 来源:发表于2021-12-30 22:08 被阅读0次

    回想一下同步、异步,多线程,任务队列之间到底有何区别。

    NSLog(@"🔥🔥🔥🔥🔥");
        
    // 延迟锚中
    dispatch_async(dispatch_get_main_queue(), ^{
      [self handleHeaderSelected];
      NSLog(@"🐸🐸🐸");
    });
    
    //// Log
    2021-12-30 21:55:41.302260+0800[24264:9584922] 🔥🔥🔥🔥🔥
    2021-12-30 21:55:41.303565+0800[24264:9584922] 🔥🔥🔥🔥🔥
    2021-12-30 21:55:41.304549+0800[24264:9584922] 🔥🔥🔥🔥🔥
    2021-12-30 21:55:41.305520+0800[24264:9584922] 🔥🔥🔥🔥🔥
    2021-12-30 21:55:41.350821+0800[24264:9584922] 🐸🐸🐸
    2021-12-30 21:55:41.359901+0800[24264:9584922] 🐸🐸🐸
    2021-12-30 21:55:41.362789+0800[24264:9584922] 🐸🐸🐸
    2021-12-30 21:55:41.365382+0800[24264:9584922] 🐸🐸🐸
    

    相关文章

      网友评论

          本文标题:神奇的"主线程主队列,异步提交任务"

          本文链接:https://www.haomeiwen.com/subject/jsywqrtx.html