有人可以向我解释一下主线程和 NSThread 之间的调度是如何工作的吗?

发布于 2025-01-02 15:06:07 字数 199 浏览 4 评论 0原文

例如,它是否从 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文