Linux kernel output

I have a live stream in Linux (3.4). Under certain conditions, I want him to refuse to control other threads with the same priority, even if he has not finished using his current time interval. I thought to use the following code:

if (condition) {
    resched_task();
    cond_resched();
}

however, I don’t see anyone else in the code, making me think of a different (better?) way to do this. Is there a standard way to do this?

+4
source share
2 answers

You can use the sched_yield () function to get the rest of your temporary fragment, as discussed here .

sched_yield() CPU. .

+7

, , - sched_yield(). , ​​ : schedule()

+1

Source: https://habr.com/ru/post/1526778/


All Articles