Thursday, March 05, 2020

Process Scheduling and Schedulling queues in Operating System

Process Scheduling

B
efore directly jumping into the concepts and definitions of process scheduling I would like to make a base so you can understand the concepts the way one never forgets.
Suppose you are living in the joint family system and you have only landline telephone in your home. No one have personal phone (Mobile) so when ever someone want to make call uses the only landline phone.

Now if one family member wants to make a call He will go and simply make the call but what if more than one family member wants to make the call at the same time?
Answer is simple, the one who think to make the call first will make the call and the 2nd one will wait for the turn while 2nd one is waiting and the 3rd family member also want to make call He will go and wait for his turn which is on 3rd number.

What the 2nd and 3rd member did?
They schedule themselves into the queue and start waiting for their turn.
Same thing happens in the Operating System. Operating system have limited number of resources (Processer in this case) same as you have only phone in your home. Now if more than one process wants to use that processer, they will make queue and wait for their turn.
But like you and your family members the processes are not smart enough to make their queue by themselves so OS (Operating System) takes the responsibility to do this.
Operating Systems always use algorithms to perform such kind of tasks, Here Operating system use the scheduling algorithms.

Scheduling Algorithms: responsible for scheduling the process and assigning the process to processor on the turn or may be priority basis (How priority basis we will cover it soon keep reading)

Scheduling Queues: The places where the processes wait to get the resources are known as scheduling queues.

We have 3 different kind of scheduling queues. Why?
Because there is not only one process which will wait not only two but many. We cannot accommodate all the processes into the main memory because the main memory is always small in the amount.
We make a queue of process into the main memory the size of queue depends upon how much space we have into the main memory and we make another queue of remaining processes into the secondary memory so

Job Queue:  The queue of process that we will made in the secondary memory will be the job queue.

Ready Queue: The queue which we will made in the main memory will be the ready queue.

Where is the 3rd one? We said, “we have 3 different kind of queues”. The 3rd one is the waiting queue. The names tell its purpose clearly the process which are in waiting state waits in this queue but wait for what?
Process goes through different states in their life, one of them is waiting state where the wait for some I/O Operations.
Don’t forget to check out Process States lecture

The process waiting for the I/O Operating get settles into the queue.

Waiting Queue:  The queue where process wait for the I/O operations known as the waiting queue.
The waiting queue is always in the secondary memory as we don’t have enough space to accommodate large amount of process into the main memory.

No comments:

Post a Comment