Re: Kernel and other Threads

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

 



On Mon, 2005-08-08 at 18:25 +0700, Mulyadi Santosa wrote:
[...]
> > 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?

Depends on the thread implementation you use - see below.

> 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....

(Old - 2.4 and before) LinuxThreads: This is a user-space library. One
(user-space) process is exactly one (kernel-space) task.

(Current - 2.6 or 2.4+NPTL-patch) NativePosixLinuxThreads: One
(user-space) thread is one (kernel-space) task. One to many threads,
which share the same memory areas, are called a "process".

With the trivial problem that the process-id must actually be split into
a "task-id" (which is different for all tasks) and a "process-id" (which
is identical for all threads within one process). And no, there is no
*clean* solution since one has to get this separation into several
standards like SuSv3 etc.

	Bernd
-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services




--
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