Chinaunix

标题: 求问task_struct结构中的tgid和group_leader->pid的区别 [打印本页]

作者: ptostrike    时间: 2013-09-10 13:42
标题: 求问task_struct结构中的tgid和group_leader->pid的区别
current->tgid
current->group_leader->pid
线程组的第一个线程的PID和线程组的ID不一样吗?
作者: 瀚海书香    时间: 2013-09-12 10:56
本帖最后由 瀚海书香 于 2013-09-12 11:17 编辑

回复 1# ptostrike
current->tgid
current->group_leader->pid
线程组的第一个线程的PID和线程组的ID不一样吗?


Kernel 3.0 version:

current->tgid ==  current->group_leader->pids[PIDTYPE_PID].pid->numbers[0].nr  //For the global namespace

If on the child namespace

Maybe you need to take a look:

getpid-->task_tgid_vnr-->pid_vnr

   




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2