Processes or Threads (or daemons) ?

dsr at tao.merseine.nu dsr at tao.merseine.nu
Sat Mar 1 09:49:10 EST 2003


On Sat, Mar 01, 2003 at 09:39:51AM -0500, Paul Courchene wrote:
> 2. During this discussion reference was made to:
>  Kernel Processes or daemons such as:
>  ' kupdated ' or '  kidled '
> Also, someone said:
> >> I've heard of "kernel processes", but so far > everything I've read about
> them is mystical poetry.
> >> They apparently > don't work through the usual process hooks.
> >>They're technically threads which look like processes.
> >>They don't have to obey any normal rules.
> 
> Are this routines or daemons designed and coded as threads
> and use a threads library, or are they perceived as threads
> because of their behavior or
> since we are talking about generic Kernel functions, we take the practical
> context of ' kernel threads ' ...
> 
> could someone elaborate a little, for me,
> so that I better understand the notion of kernel threads ...
> I have never seen any 'code' for a daemon such as
>  ' kupdated ' or '  kidled ', so I am interested in this idea ...

Kernel threads are special.

They are created with kernel_thread() which invokes clone(2) in kernel
mode. There is no user address space associated with them. They get to
address kernel space directly. They run at highest privileges, and even
the scheduler cannot pre-empt them.

In short, consider them part of the kernel that show up as separate
processes, but aren't. 

-dsr-

-- 
Network engineer looking for work in Boston area.
Resume at http://tao.merseine.nu/~dsr/



More information about the Discuss mailing list