Diagrams

Global state diagram

Typical Unix state diagram

There are two run states, kernel running and user running, associated to the processor running mode, supervisor and user, respectively.

The ready state is also split in two states, ready to run in memory and preempted, but they are equivalent, represented by the dashed line.

When a user process leaves supervisor mode, it can be preempted (because a higher priority process is ready to run).

The time-out transition is covered by the preempt one.

Traditionally, execution in supervisor mode could not be interrupted (thus UNIX does not allow real time processing)

In current versions, namely from SVR4, the problem was solved by dividing the code into a succession of atomic regions between which the internal data structures are in a safe state and therefore allowing execution to be interrupted.

This corresponds to a transition between the preempted and kernel running states, that could be called return to kernel.

Last updated