title: Linux thread implementation
body: <p>I was reading about thread implementation in linux. It seems that linux infact models threads as &quot;special&quot; processes (using <strong>clone</strong> system call) passing appropriate flags to it so that address space is shared.</p>
  <p>Multiple threads that spawned this way would have separate <strong>pid</strong> (process id - logical thread id) but same <strong>tgid</strong> (thread group id - logical process id). How would thread spawning be quicker than process spawning (since threads are modelled as process)?</p>
  <p>How would operations like <strong>TLB</strong> flushes work? Would context switch between (logical) threads still be be cheap?</p>