Friday, September 5, 2014

Linux Process States



  • TASk_RUNNING - process is runnable (on the run queue) but not necessarily running.
  • TASK_INTERRUPTIBLE - process is sleep waiting for some condition to happen.  The process may also be waken up by a signal.
  • TASK_UNINTERRRUPTIBLE - similar to TASK_INTERRUPTIBLE except it does not wake up by a signal.  This is used when the task must wait without interruption or expects the event will occurs quickly.  Process in this state cannot be killed.
  • TASK_ZOMBIE - process has exited but the task_struct is lefted over to wait for the parent process to call wait4().
  • TASK_STOPPED - process stops because it receives SIGSTOP, SIGTSTO, SIGTTIN OR SIGTTPU or it receives any signal while it is being debugged.


The process sstate is set using the set_task_state(task,state) function which also create a memory barrier to force ordering on other processors

No comments: