The Linux kernel uses struct pid to represent PID in kernel space.The C code is below.
struct pid
{
atomic_t count;
/* lists of tasks that use this pid */
struct hlist_head tasks[PIDTYPE_MAX];
int level;
struct upid numbers[1];
};
I can not really understand why the member tasks can represent "the lists of tasks".Since task_struct is the kernel internal representation of task,and one task only uses one task_struct.Why can more than one task share a "struct pid"?