{
    "mode": "man",
    "parameter": "proc_thread-self",
    "section": "5",
    "url": "https://www.chedong.com/phpMan.php/man/proc_thread-self/5/json",
    "generated": "2026-10-07T20:15:21Z",
    "sections": {
        "NAME": {
            "content": "/proc/pid/task/, /proc/tid/, /proc/thread-self/ - thread information\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "/proc/pid/task/ (since Linux 2.6.0)\nThis  is  a  directory  that contains one subdirectory for each thread in the process.\nThe name of each subdirectory is the numerical thread ID (tid) of the thread (see get‐\ntid(2)).\n\nWithin each of these subdirectories, there is a set of files with the same  names  and\ncontents  as  under  the /proc/pid directories.  For attributes that are shared by all\nthreads, the contents for each of the files under the task/tid subdirectories will  be\nthe  same  as  in the corresponding file in the parent /proc/pid directory (e.g., in a\nmultithreaded process, all of the task/tid/cwd files will have the same value  as  the\n/proc/pid/cwd  file  in  the  parent  directory, since all of the threads in a process\nshare a working directory).  For attributes that are distinct  for  each  thread,  the\ncorresponding  files under task/tid may have different values (e.g., various fields in\neach of the task/tid/status files may be different for each thread), or they might not\nexist in /proc/pid at all.\n\nIn a multithreaded process, the contents  of  the  /proc/pid/task  directory  are  not\navailable   if   the   main  thread  has  already  terminated  (typically  by  calling\npthreadexit(3)).\n\n/proc/tid/\nThere  is a numerical subdirectory for each running thread that is not a thread  group\nleader  (i.e., a thread whose thread ID is not the same as its process ID); the subdi‐\nrectory is named by the thread ID.  Each one of these  subdirectories  contains  files\nand  subdirectories exposing information about the thread with the thread ID tid.  The\ncontents of these directories are the same as the corresponding /proc/pid/task/tid di‐\nrectories.\n\nThe /proc/tid subdirectories are not visible when iterating through  /proc  with  get‐\ndents(2) (and thus are not visible when one uses ls(1) to view the contents of /proc).\nHowever,  the pathnames of these directories are visible to (i.e., usable as arguments\nin) system calls that operate on pathnames.\n\n/proc/thread-self/ (since Linux 3.17)\nThis directory refers to the thread accessing the /proc filesystem, and  is  identical\nto  the /proc/self/task/tid directory named by the process thread ID (tid) of the same\nthread.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "proc(5)\n\nLinux man-pages 6.7                          2023-08-15                             procpidtask(5)",
            "subsections": []
        }
    },
    "summary": "/proc/pid/task/, /proc/tid/, /proc/thread-self/ - thread information",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "proc",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/proc/5/json"
        }
    ]
}