title: If threads share the same PID, how can they be identified?
body: <p>I have a query related to the implementation of threads in Linux.</p>
  
  <p>Linux does not have an explicit thread support. In userspace, we might use an thread library (like NPTL) for creating threads. Now if we use NPTL it supports 1:1 mapping.</p>
  
  <p>The kernel will use the <code>clone()</code> function to implement threads.</p>
  
  <p>Suppose I have created 4 threads. Then it would mean that:</p>
  
  <ul>
  <li>There will be 4 <code>task_struct</code>. </li>
  <li>Inside the <code>task_struct</code>, there will be provision of sharing resources as per the arguments to clone <code>(CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND)</code>.</li>
  </ul>
  
  <p>Now I have the following query:  </p>
  
  <ol>
  <li>Will the 4 threads have the same PID? If someone can elaborate, how the PIDs are shared.  </li>
  <li>How are the different threads identified; is there some TID (thread ID) concept?</li>
  </ol>