<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 20, 2016 at 2:02 PM, Ran Shalit <span dir="ltr">&lt;<a href="mailto:ranshalit@gmail.com" target="_blank">ranshalit@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I am trying to understand if kernel thread are always higher priority<br>
then user thread.<br>
<br>
Say, a kernel thread (created with kthread_create with SCHED_FIFO and<br>
given priority x), and user thread (created with pthread_create was<br>
created with SCHED_FIFO and given priority y), and priority of pthread<br>
is higher than kthread, would still the kernel thread get into<br>
scheduler before the user thread ?<br>
How is the scheduler decides which get first into the running state ?<br>
<br>
Regards,<br>
Ran<br>
<br>
______________________________<wbr>_________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.<wbr>org</a><br>
<a href="https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" rel="noreferrer" target="_blank">https://lists.kernelnewbies.<wbr>org/mailman/listinfo/<wbr>kernelnewbies</a><br>
</blockquote></div><br></div><div class="gmail_extra">Dear Ran<br><br></div><div class="gmail_extra">Tough question, but let me clarify, when you mean higher, do you mean y &gt; x?<br><br></div><div class="gmail_extra">All in all, kernel thread and user thread is treated the same in the kernel&#39;s point of view. So in your case, unless one of them voluntarily give up his time slice, or preempted by certain case, thread with higher priority will be picked by scheduler first<br><br></div><div class="gmail_extra">CMIIW <br clear="all"></div><div class="gmail_extra"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">regards,<br><br>Mulyadi Santosa<br>Freelance Linux trainer and consultant<br><br>blog: <a href="http://the-hydra.blogspot.com" target="_blank">the-hydra.blogspot.com</a><br>training: <a href="http://mulyaditraining.blogspot.com" target="_blank">mulyaditraining.blogspot.com</a></div>
</div></div>