Professional Documents
Culture Documents
7. What is a process? Explain the process control block and the various
process states.
o A Process is anything that is currently being executed i.e., any active
program.
o Process control block is a data structure containing information of the
process related to it.
Process states include.
New state
The first state of a process where the process is created
Ready state
In this state the process is ready for execution by the CPU but it is waiting
for its turn to be executed
Ready suspended state
Here is where processes from ready state are placed if the memory is full
due to memory constraint.
Running state
Here a process from the ready state is chosen using CPU scheduling
algorithm and it is executed.
Waiting or blocked state
During execution of the process, if the process requires some input/output
operations, then the running process will go into this state as other process
come for execution.
Waiting suspended state
If the waiting queue is full then some processes will be sent here.
Terminated state.
When a process has been fully executed, it comes to this state where it is
terminated, and the information related to it is deleted.
8. Explain the various CPU scheduling algorithms?
i) First come first serve scheduling algorithm. (FCFS)
FCFS states that the process that requests the CPU first is allocated to the
CPU first and is implemented using FIFO queue.
ii) Shortest job next CPU scheduling algorithm (SJN)
It selects the waiting process with the smallest execution time to execute
next. It aims to minimize the average waiting time providing optimal results.
iii) Longest job first (LJF)
This process is the opposite of SJF. It is based upon the fact that the
process with the largest time is processed first.
iv) Priority CPU scheduling
The function is set to be important by the editor where the most important
process must be done first.
v) Round robin
Here each process is cyclically assigned a fixed time slot. If a process slot
expires, it is preempted and moved to the back of the ready queue.
vi) Multiple-level queues scheduling
They make use of another existing algorithm. Here processes are divided
into multiple priority queues, and each queue may have a different
scheduling algorithm.
vii)Shortest remaining time
It is pre-emptive version of the SJN. The processor is allocated to the job
closest to completion.