67

被遗弃的线程

 6 years ago
source link: http://sindrilin.com/note/2018/04/14/abandoned_thread/?
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
main函数作为程序运行的入口,正常情况下,函数会执行毫秒级别的操作,然后返回一个0表示程序正常终止。为了避免应用启动即终止,苹果设计了runloop机制来维持线程的生命,runloop在每一次的循环当中不断的去处理事件,或控制线程的休眠和唤醒。runloop还结合了libdispatch的任务派发机制,可以循环地处理async到队列中的任务

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK