1

In Linux, a kernel thread have a PID:

enter image description here

Why is that? Is a kernel thread considered to be a process? And does a "normal" thread also have a PID?

5

They are poorly named. Kernel threads in linux are processes (not actual threads) that run in kernel space rather than user space.

|improve this answer|||||
  • A process have many threads, does a kernel thread have many threads also? – paul Jun 20 '17 at 2:55
  • @paul Related: stackoverflow.com/q/34959506/4941495 – Kusalananda Jun 20 '17 at 6:09
  • Kernel threads do not run in their own address space. Since the usual definition of a thread (vs. a process) is that related threads are executed in a shared address space, I think thread is a more appropriate term than process here. – Johan Myréen Jun 20 '17 at 7:08
  • @Johan Myréen A kernel thread has a PID as I have shown, but does a "normal" thread also have a PID? – paul Jun 20 '17 at 18:19

Not the answer you're looking for? Browse other questions tagged or ask your own question.