Process 0 MH
Process 0 MH
Process
Lecture topics
Process introduction.
Process state.
Process control Block.
Context Switch.
Operations on processes.
Scheduling Queues.
Process introduction
A process is a program in execution. For example,
when we write a program in C or C++ and compile it,
the compiler creates binary code. The original code
and binary code are both programs. When we actually
run the binary code, it becomes a process.
A process is an ‘active’ entity instead of a program,
which is considered a ‘passive’ entity.
Process introduction
Sometimes we use the terms job and process almost
interchangeably.
Process – A program in execution;process execution
must progress in sequential fashion.A process
includes:
program counter.
Stack.
Data section.
Process state
As a process executes, it changes state.
The state of a process is defined in part by the current
activity of that process.
Each process may be in one of the following states:
1. New: The process is being created.
2. Running: instructions are being executed.
3. Waiting: the process is waiting for some event to occur(such
as I/O completion or reception of a signal.)
4. Terminated: the process has finished execution.
Diagram of Process State
Process Control Block
Each process is represented in the operating system by
process control block(PCB)- also called a task control
block.
PCB includes:
Process state.
The state may be new , ready, running ,waiting, halted, and so on
Program counter indicates the address of the next instruction to
be executed for this process.
CPU registers.
The registers vary in number and type, depending on the
computer architecture.
Process Control Block
They include accumulators, index registers, stack pointers, and
general-purpose registers, plus any condition code information.
Along with the program counter, this state information must be
saved when an interrupt occurs, to allow the process to be
continued correctly afterward.
CPU- scheduling information
This information includes a process priority, pointers to sched -
uling queues, and any other scheduling parameters.
Memory –management information.
this information may include such information as the value of the
base ,or the segment tables, depending on the memory system used
by operating system.
Process Control Block
Accounting information
This information includes the amount of CPU and real time used,
time limits, account members, job or process numbers and so on.
I/O status information.
This information includes the list of I/O devices allocated to the
process ,a list of open files, and so on.
In brief, the PCB simply serves as the repository for any
information that may vary from process to process.
Process Number(or Process ID)