Run Loops
A run loop is an event processing loop that you use to schedule work and coordinate the receipt of incoming events. The purpose of a run loop is to keep your thread busy when there is work to do and put your thread to sleep when there is none.
Your application does not need to create these run loop objects explicitly; each thread, including the application’s main thread, has an associated run loop object. Only secondary threads need to run their run loop explicitly, however. In both Carbon and Cocoa applications, the main thread automatically sets up and runs its run loop as part of the general application startup process.
RunLoop是用于调度工作和协调事件接收的事件处理循环。它让应用线程保持忙碌直至有工作可做,并在无工作时使线程进入睡眠状态。在Carbon和Cocoa应用中,主线程自动设置并运行其RunLoop作为应用启动过程的一部分。
343

被折叠的 条评论
为什么被折叠?



