View Single Post
  #4  
Old Wednesday, March 26, 2008
Janeeta's Avatar
Janeeta Janeeta is offline
Member
 
Join Date: Dec 2006
Location: Karachi
Posts: 96
Thanks: 26
Thanked 121 Times in 39 Posts
Janeeta is on a distinguished road
Default Process

Process State

The process state consist of everything necessary to resume the process execution if it is somehow put aside temporarily. The process state consists of at least following:

*)Code for the program.
*)Program's static data.
*)Program's dynamic data.
*)Program's procedure call stack.
*)Contents of general purpose registers.
*)Contents of program counter (PC)
*)Contents of program status word (PSW).
*)Operating Systems resource in use.

Process state:

A process goes through a series of discrete process states.
New State: The process being created.

Running State: A process is said to be running if it has the CPU, that is, process actually using the CPU at that particular instant.

Blocked (or waiting) State: A process is said to be blocked if it is waiting for some event to happen such that as an I/O completion before it can proceed. Note that a process is unable to run until some external event happens.

Ready State: A process is said to be ready if it use a CPU if one were available. A ready state process is runable but temporarily stopped running to let another process run.

Terminated state: The process has finished execution.


Process table

To keep track of all the processes that are running on the system. To do this, the operating system maintains a process table.

The process table is very simple data structure: It's a large array of structures. Each structure containts several pieces of data. Some of the
pieces of data associated with a process include:

*)The last values observed in the registers while the process was running.
*)The last value observed in the program counter while the process was running.
*)The state of the process (Is it ready to go?)
*)The current working directory of the process
*)The user ID of the user running the process
Reply With Quote