if (condition) { resched_task(); cond_resched();}
但是,我没有看到代码中有其他人这样做,让我觉得还有其他(更好的?)方式.有没有标准的方法来做到这一点?
解决方法 您可以使用 sched_yield()函数生成剩余的时间片 as discussed here.总结sched_yIEld() causes the calling thread to relinquish the cpu. The thread is moved to the end of the queue for its static priority and a new thread gets to run.
以上是内存溢出为你收集整理的从linux内核中产生全部内容,希望文章能够帮你解决从linux内核中产生所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)