Re: Kernel and other Threads

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hello....

> 1) A kernel thread is actually a process (task), isn't it? Then
> what's the difference between a kernel thread and a normal task?
yes, you are correct, kernel thread is a process because a task_struct 
is created to represent it. However.....

Kernel thread is a process without a unique process address space 
specifically assigned to it. It is also created for single purpose...to 
execute specific function, e.g on pdflush, to flush out dirty page.

> 2) In the structure task_struct, which represents a task, there is a
> member "struct thread_struct". Does it have anything with threads as
> light weigth processes (LWPs) to do?

No. thread_struct is a structure to save hardware context during context 
switching. For example, it records eip (current instruction address), 
gs, fs (segment registers). I also found out that thread_struct records 
TLS entry related to the task. it is the TLS which has relation to LWP, 
but thread_struct is not....

regards

Mulyadi


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux