LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Kernel threads vs. user threads implementation (kthreads vs. pthreads) (https://www.linuxquestions.org/questions/linux-kernel-70/kernel-threads-vs-user-threads-implementation-kthreads-vs-pthreads-4175567140/)

jnielsen7 01-22-2016 08:25 PM

Kernel threads vs. user threads implementation (kthreads vs. pthreads)
 
please delete

MensaWater 01-24-2016 11:36 AM

Rather than requesting deletion you should post your original question AND your solution. That way someone who has the same issue in the future as you had may be able to find a solution more quickly.

jnielsen7 01-25-2016 11:20 AM

The original post contained a link to Stack Exchange where I had asked a question which was large (10 paragraphs) and unwieldy (which no one replied to there) so I deleted it. To be fair I did rehash it afterward in a completely new question which was somewhat related, regarding threading in the kernel. Here it is for what it's worth: stackoverflow.com/questions/34959506/do-linux-kernel-processes-multithread

No one to date has replied to that post as to what the kthreadd process actually does, in contradistinction to init. I still have more questions than answers.

jnielsen7 01-25-2016 05:53 PM

I think I was thrown off by the fact that kthreadd and its children have PIDs (Process IDs), but they are all threads not processes. That made it very difficult to understand why ps displays things like it does. I threw up another stackoverflow question here about that: stackoverflow.com/questions/35004259/linux-assigns-pids-to-kernel-threads-and-not-only-processes

sundialsvcs 01-25-2016 07:45 PM

A "kernel thread" is a strategy that the kernel uses when parts of itself can be most-conveniently expressed as "independently-dispatchable things" that can "wait for" things to happen, and which can afford to be executed "in no particular order." In some ways, they are like user threads, but the fact remains that they are "part of the kernel." For instance, when they're ready to run, they get to run. There is no notion of "time slices" ... they get to run as long as they want to. And so on.

"User threads," like "user processes," execute within the environment created and maintained by the kernel. They run in virtual memory, they can be pre-empted at any time, and so on.


All times are GMT -5. The time now is 10:03 PM.