Reputation: 417
I have a module which creates a kthread. I want this kthread to record some statistics, then yield the cpu. It will record statistics when it runs again. What is the correct way to do this? Is
set_tsk_need_reched(task);
schedule();
the right way to do this? (It seems not to do what I expect)
Upvotes: 4
Views: 1981
Reputation: 3630
If I correly remember Linux kernel have a yield() function that can be used to voluntarily pass processor control to some another thread in the system (kernel will decide itself what thread will be running next). Some notes:
Upvotes: 1