有人可以向我解释一下主线程和 NSThread 之间的调度是如何工作的吗?
例如,它是否从 pthreads 执行类似 SCHED_FIFO 或 SCHED_RR 的操作?调度策略可以改变吗?可以为主线程和 NSThread 分配优先级吗?
最终我希望主线程使用 CADisplayLink 以 30 Hz 运行。此外,NSThread 将以较低的优先级运行。理想情况下,主线程会抢占 NSThread 以维持 30 Hz。我不知道这是否可能。
For example is it doing something like SCHED_FIFO or SCHED_RR from pthreads? Can the scheduling policy be changed? Can priorities be assigned to the main thread and an NSThread?
Ultimately I would like the main thread to run at 30 Hz with a CADisplayLink. In addition an NSThread would run at a lower priority. Ideally the main thread would pre-empt the NSThread to maintain the 30 Hz. I have no idea if this is possible.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论