What is kthreadd process and children and how it is different from init and children

后端 未结 1 1721
盖世英雄少女心
盖世英雄少女心 2021-02-02 08:07

I wanted to know what is kthread and why it does not take any memory and has no open files. I wrote some code which will simply print the PID of the currently runni

相关标签:
1条回答
  • 2021-02-02 08:19

    Kernel threads are not children of init because they can be started before all the userspace processes.

    They are typically used to manage hardware that's why they are directly handled by the kernel and have high priority.

    For a process to be child of init it needs to be cloned from init and Kthreads aren't that's why their parent PID is 0 meaning "no-one".

    0 讨论(0)
提交回复
热议问题