【发布时间】:2012-01-16 01:07:29
【问题描述】:
Linux内核使用struct pid来表示内核空间的PID。C代码如下。
struct pid
{
atomic_t count;
/* lists of tasks that use this pid */
struct hlist_head tasks[PIDTYPE_MAX];
int level;
struct upid numbers[1];
};
我真的不明白为什么成员任务可以表示“任务列表”。由于task_struct是任务的内核内部表示,一个任务只使用一个task_struct。为什么多个任务可以共享一个“struct pid” “?
【问题讨论】: