Quantcast
Channel: User Zan Lynx - Stack Overflow
Viewing all articles
Browse latest Browse all 40

Comment by Zan Lynx on How to use sched_yield() properly?

$
0
0
On Linux sched_yield with SCHED_OTHER (ie normal processes) is not a good thing to use. It puts the thread at the very end of all process and thread priorities. Not just the threads in the process. Yes, even the nice 20 threads get to run before a yielded thread. And in your case there are plenty of available CPU cores so it gets bumped off and immediately rescheduled. In fact if it is the only thread on a core it never stops running.

Viewing all articles
Browse latest Browse all 40

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>