Tuesday, October 13, 2009

Linux

Data Structure in Linux Kernel

Process Management:
Process State:

During the lifecycle of a process, process can migrate into a number of states. Each state describes particular properties of a process at that instant by means of some attributes. These attributes are defined in the process descriptor. An array of flags is used to describe the state of a process. These states are mutually exclusive, any process can be in one of these states at a particular time. Each state is represented by a flag in the state, which is set. All other flags are cleared. Different possible states of a process are as follows.

TASK_RUNNING

A process is either running or is ready to run.

TASK_INTERRUPTIBLE

The process is blocked on a particular event, but it can wake up by delivering a signal to it An event can be input from user, disk I/O etc. On wake up it gets it state back to TASK_RUNNING.

TASK_UNINTERRUPTIBLE

In this state also the process is blocked, but it cannot be interrupted by delivering a signal to it. If at all it gets a signal it ignores it.

TASK_STOPPED

A process gets this state when its execution is stalled. E.g. when a process is being monitored by another such as a debugger. a process can be stopped by delivering a SIGSTOP, SIGTSTP, SIGTTIN, or SIGTTOU signal.

TASK_ZOMBIE

A process enters this state when it is terminated. After termination of the process kernel cannot just discard the data structures of the process because the parent process may need it when it executes a wait() call on any of its children.


Followers