Process
Process
What is Process?
●W
ready running
Program Number
CPU Register
Memory Limits
● Registers
is defined as the internal processor memory where data
and instructions are kept temporarily during the execution of the
program.
● When processes enter the system, they are put in a “Job Queue”.
● The processes that are Ready and Waiting to be executed are kept
in a list termed as “Ready Queue”.
● Each process has its own Process Control Block.
● The Ready Queue Header has a pointer to the first and last Process
Control Blocks in the list.
● Each Process Control Block has a pointer that points to the next
process in the ready queue.
● Device Queue: When a process is allocated the CPU, it executes for
a while and eventually quits, is interrupted or waits for the
occurrence of a particular event like completion of an I/O request
etc. For this an I/O request has been made.
Child
Terminates
Child
Executes
Fork a Child
● Terminate
● Time quantum expires
● Creation of sub process i.e. child process i.e. Forking
● I/O
● When a high priority job arrives
● Selects processes from the pool and loads them into memory for
execution.
● Executes less frequently.
● Controls degree of multiprogramming. If degree of
multiprogramming is stable, then the average rate of process
creation must be equal to the average departure rate of processes
leaving the system.
● May need to be invoked only when a process leaves the system.
● Selects from among the processes that are ready to execute and
allocate the CPU to one of them.
● Must select new process frequently.
● A process may execute for only a few milliseconds before waiting
for an I/O request.
● Executes frequently can be at interval of say 100 milliseconds.
● CPU Bound
● I/O Bound
Applications
Kernel
● Executing Processes
● Handling Interrupts
● To mediate access to the computer resources
● Process Synchronization
● Inter Process Communication
● Using Interrupt
● Using “call gate”
● Call Gate is a special address stored by the kernel in a list in
kernel memory at a location known to the processor.
● When the processor detects a call to that address, it redirects
to the target location without causing an access violation.
● Using Special System Call Instruction
Data Files
Code
Code
Process Thread
● Process is heavy weight or ● Thread is light weight, taking
resource intensive. lesser resources than a
process.
● Process switching needs ● Thread switching does not
interaction with operating need to interact with
system. operating system.
Process Thread
● Multiple processes without ● Multiple threaded processes
using threads use more use fewer resources.
resources.
● In multiple processes each ● One thread can read, write or
process operates change another thread's data.
independently of the others.