Distinction between processes and threads in Linux

后端 未结 3 1876
甜味超标
甜味超标 2020-12-02 17:48

After reading up on this answer and \"Linux Kernel Development\" by Robert Love and, subsequently, on the clone() system call, I discovered that processes and t

3条回答
  •  鱼传尺愫
    2020-12-02 18:13

    On Linux, every thread gets a thread ID. The thread ID of the main thread serves double duty as the process ID (and is rather well-known in the user interface). The thread ID is an implementation detail of Linux, and unrelated to the POSIX ID. For more details, refer to the gettid system call (not available from pure Python since it's system-specific).

提交回复
热议问题