Kernel Threads
Kernel threads are used to implement background tasks inside the kernel. They are similar to user processes, but live in kernel address space. Here’s how to use them.
Thursday, September 15th, 2005
Threads are programming abstractions used in concurrent processing. A kernel thread is a way to implement background tasks inside the kernel. A background task can be busy handling asynchronous events or can be asleep, waiting for an event to occur. Kernel threads are similar to user processes, except that they live in kernel space and have access to kernel functions and data structures. Like user processes, kernel threads appear to monopolize the processor because of preemptive scheduling.
In this month’s “Gearheads,” let’s discuss kernel threads and develop an example that also demonstrates such as process states, wait queues, and user-mode helpers.
Built-in Kernel Threads
To see the kernel threads (also called kernel processes) running on your system, run the command ps –ef. You should see something similar to Figure One.