Basic state of the process

1. Three basic states of the process

1.1 Three basic states of the process
  1. Ready state
    When the process has been allocated all necessary resources except the CPU, it can be executed immediately as long as the processor is obtained. The state of the process at this time is called the ready state.
  2. Running state
    When a process has acquired a processor and its program is being executed on the processor, the process state at this time is called the running state.
  3. Blocking state
    When a process that is being executed cannot execute because it is waiting for an event to occur, it abandons the processor and is in a blocked state. There can be many events that cause process blocking, for example, waiting for I/O to complete, requesting a buffer that cannot be satisfied, waiting for a signal, and so on.
1.2 The transition between the three states of the process
  1. Ready → Running
    A process in the ready state. When the process scheduler allocates processor resources to it, the process changes from the ready state to the execution state.
  2. Running → Ready
    A process in the execution state has to give up the processor because a time slice allocated to it has been used up during its operation, so the process changes from the running state to the ready state.
  3. Running → Blocking
    When the executing process cannot continue to execute because it is waiting for some kind of event (such as IO request), it changes from the running state to the blocking state.
  4. Blocking → Ready
    A process in a blocked state, if the event it is waiting for has been completed (such as the end of IO), then the process changes from the blocked state to the ready state.

2. Linux process status (ps aux)

  1. R: Executable state.
  2. S: Interruptible sleep state.
  3. D: Uninterruptible sleep state.
  4. T: Paused state.
  5. Z: Zombie state, the process becomes a zombie process.
  6. X: Exit status, the process is about to be destroyed.

supplement:

  1. s: Conversation leader
  2. +: foreground process
  3. l: Multithreaded program
  4. <: Higher priority than the default (the smaller the number, the higher the priority. The nice/renice command can adjust the priority)
  5. N: Lower priority than the default
  6. t: being tracked by (such as a debugger)

Guess you like

Origin blog.csdn.net/qq_43579888/article/details/113575124