processes, threads and thread groups

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

 



  just to make *absolutely* sure that i'm using the terminology
correctly, here's how i understand processes and threads:

* threads are, of course, just another type of process -- these are
commonly referred to simply as "tasks"

* all processes have a process ID (PID), but related threads (those in
the same multithreaded application) have the *same* PID as returned by
getpid().  this is the PID of the "thread group leader" -- the initial
thread in that application.

* while each thread has its own unique PID represented by the variable
"pid", the routine getpid() returns instead the thread group leader
represented by the variable "tgid", the thread group leader.  (for
thread groups that consist of a single member, those two variables pid
and tgid will, naturally, contain the same value.)

* only the thread group leader of a multithreaded application is on
the system-wide task list.  the additional threads in that thread
group are on a separate list managed by the thread group leader.

  how am i doing so far?

rday
--

========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
    Have classroom, will lecture.

http://crashcourse.ca                          Waterloo, Ontario, CANADA
========================================================================

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at 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