Difference between PID and TID

后端 未结 4 667
刺人心
刺人心 2020-11-30 22:42

What is the difference between PID and TID?

The standard answer would be that PID is for processes while TID is for threads. However, I have seen that some commands

4条回答
  •  遥遥无期
    2020-11-30 23:31

    Just to add to other answers, according to man gettid:

    The thread ID returned by this call is not the same thing as a POSIX thread ID (i.e., the opaque value returned by pthread_self(3)).

    So there are two different things one could mean by TID!

提交回复
热议问题