# proc_thread-self - thread information - man(5) - [phpMan]

[_proc_pid_task_(5)](https://www.chedong.com/phpMan.php/man/procpidtask/5/markdown)                         File Formats Manual                        [_proc_pid_task_(5)](https://www.chedong.com/phpMan.php/man/procpidtask/5/markdown)

## NAME
       /proc/pid/task/, /proc/tid/, /proc/thread-self/ - thread information

## DESCRIPTION
       _/proc/_pid_/task/_ (since Linux 2.6.0)
              This  is  a  directory  that contains one subdirectory for each thread in the process.
              The name of each subdirectory is the numerical thread ID (_tid_) of the thread (see **get‐**
              [**tid**(2)](https://www.chedong.com/phpMan.php/man/tid/2/markdown)).

              Within each of these subdirectories, there is a set of files with the same  names  and
              contents  as  under  the _/proc/_pid directories.  For attributes that are shared by all
              threads, the contents for each of the files under the _task/_tid subdirectories will  be
              the  same  as  in the corresponding file in the parent _/proc/_pid directory (e.g., in a
              multithreaded process, all of the _task/_tid_/cwd_ files will have the same value  as  the
              _/proc/_pid_/cwd_  file  in  the  parent  directory, since all of the threads in a process
              share a working directory).  For attributes that are distinct  for  each  thread,  the
              corresponding  files under _task/_tid may have different values (e.g., various fields in
              each of the _task/_tid_/status_ files may be different for each thread), or they might not
              exist in _/proc/_pid at all.

              In a multithreaded process, the contents  of  the  _/proc/_pid_/task_  directory  are  not
              available   if   the   main  thread  has  already  terminated  (typically  by  calling
              [**pthread_exit**(3)](https://www.chedong.com/phpMan.php/man/pthreadexit/3/markdown)).

       _/proc/_tid_/_
              There  is a numerical subdirectory for each running thread that is not a thread  group
              leader  (i.e., a thread whose thread ID is not the same as its process ID); the subdi‐
              rectory is named by the thread ID.  Each one of these  subdirectories  contains  files
              and  subdirectories exposing information about the thread with the thread ID _tid_.  The
              contents of these directories are the same as the corresponding _/proc/_pid_/task/_tid di‐
              rectories.

              The _/proc/_tid subdirectories are _not_ visible when iterating through  _/proc_  with  **get‐**
              [**dents**(2)](https://www.chedong.com/phpMan.php/man/dents/2/markdown) (and thus are _not_ visible when one uses [**ls**(1)](https://www.chedong.com/phpMan.php/man/ls/1/markdown) to view the contents of _/proc_).
              However,  the pathnames of these directories are visible to (i.e., usable as arguments
              in) system calls that operate on pathnames.

       _/proc/thread-self/_ (since Linux 3.17)
              This directory refers to the thread accessing the _/proc_ filesystem, and  is  identical
              to  the _/proc/self/task/_tid directory named by the process thread ID (_tid_) of the same
              thread.

## SEE ALSO
       [**proc**(5)](https://www.chedong.com/phpMan.php/man/proc/5/markdown)

Linux man-pages 6.7                          2023-08-15                             [_proc_pid_task_(5)](https://www.chedong.com/phpMan.php/man/procpidtask/5/markdown)
