title: what is the purpose of tasks member of 'struct pid' defined in Linux/include/linux/pid.h?
body: <p>Im trying to understand better how the kernel implement pid namespace .
  One of the basic structure that is being used is <code>struct pid</code> :</p>
  <pre><code>struct pid { 
        atomic_t count;
        unsigned int level;
        /* lists of tasks that use this pid */
        struct hlist_head tasks[PIDTYPE_MAX];
        struct rcu_head rcu;
        struct upid numbers[1]; }
  </code></pre>
  <p>Now from what I understand numbers array keeps track of the process different pids in different pid namespaces.</p>
  <p>What I dont understand is the purpose of <code>tasks</code> member.
  It says here: <a href="https://stackoverflow.com/questions/26779416/what-is-the-relation-between-task-struct-and-pid-namespace">(LWN)</a> :</p>
  <blockquote>
  <p>..&quot; This structure contains the ID value, the list of <strong>tasks</strong> having this ID..&quot;</p>
  </blockquote>
  <p>So I understand from this that the <strong>same</strong> pid is <strong>shared</strong> between couple of proccess/tasks .
  Now, different proccess/threads can share same tpid/gpid but not the same pid!
  So how come there are list of tasks having the same PID? What am I missing?</p>
  <p>Thanks</p>