pthread_yield和p_thread_may产量的差异是什么?
发布于 2016-06-20 06:38:01
pthread_yield()使调用线程立即放弃CPU。
然而,如果当前线程用完了给定的量程,pthread_may_yield()就会产生结果。
pthread_may_yield ()
{
/* Whether this thread has used up its allocated time slice?
Set Variable to True if yes. */
if (thread has used up given quantum) {
pthread_yield();
}
}https://stackoverflow.com/questions/35054624
复制相似问题