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
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".