The idle state indicates that the kernel is in the middle of initializing a process/thread run environment. The thread can't be placed on a run queue, yet but soon it will be ready to compete with other threads for scheduling consideration. The amount of time a process/thread spends in the idle state is very short, and it is rare to see this state reported by a ps command. The common process table states, p_stat, are: SUNUSED = 0 | table entry unused (on the free list) | SWAIT = 1 | entry abandoned | SIDL = 2 | intermediate state during creation | SZOMB = 3 | intermediate state during deconstruction | SINUSE = 5 | entry in use |
Prior to the advent of kernel threads, a process could also be in the state SRUN, waiting on an active run queue; SSLEEP, blocked or sleeping; or SSTOP, halted. With the introduction of kernel threads, these three scheduling-oriented process states were replaced with the inclusive SINUSE state designator for the process. As the current scheduler works directly with kernel threads, the TSRUN, TSSLEEP, and TSSTOP states are set at the thread level and recorded in the kt_stat field. Figure 9-4 abstracts the overall process life cycle and the relationship between the various states. Figure 9-4. Process Life Cycle
The common thread table states are: TSUNUSED | = 0 | table entry unused (on the free list) | TSSLEEP | = 1 | thread is on a sleep queue | TSRUN | = 2 | thread is on a run queue | TSIDL | = 3 | intermediate state during construction | TSZOMB | = 4 | intermediate state during deconstruction | TSSTOP | = 5 | thread is halted |
The state TSSUSP is also defined but is not currently used. Threads that have been halted by either a debugger or by job control are reporting the TSSTOP state at this time. |