Understanding Pthreads

前端 未结 4 1212
隐瞒了意图╮
隐瞒了意图╮ 2020-12-16 20:07

I came across a concept in Advanced Linux Programming. Here\'s a link: refer to 4.5 GNU/Linux Thread Implementation.

I\'m clear wit

4条回答
  •  悲哀的现实
    2020-12-16 20:47

    In linux, as the author pointed out, threads are light-weight processes sharing the same address space. Each process has a unique PID, while each thread has a thread id TID. The thread ID of the main thread serves a dual purpose as its processId also. To get the threadID of the calling thread, you can use the pthread_self() function.

提交回复
热议问题