title: TASK_UNINTERRUPTIBLE and process threads in linux kernel development using C
body: <p>I have a running process which has created multiple user mode threads. If the kernel changes the state of the process to <code>TASK_UNINTERRUPTIBLE</code> (or <code>TASK_INTERRUPTIBLE</code>) do the threads created by the process automatically get suspended?</p>
  
  <p>This is not a homework question. I'm reading an operating systems book which describes how a semaphore is implemented. In their implementation the semaphore struct maintains a linked list of processes currently waiting for the semaphore. From what I've learned so far, such a semaphore could only be used to synchronize processes, not threads. Correct? The threads in the linked list are put into a <code>TASK_INTERRUPTIBLE</code> state until the semaphore is available, at which point one process is woken up by setting its state to <code>TASK_RUNNING</code>.</p>