Notes of operating system
topic: process sheduling
As we start our first question is What is process??.. as if we see in real life it is the sequencial work that we need to prform is the process as in the real life we start with the 5 stages of life that is
1. the baby born
2. childhood
3. young age
4. old age
5. dead
The same is with the essence of os processess, the start with new and end with termination.. the processes are:
1. New- the starting of process
2. ready- the process is ready to run
3. Run- the process enters in the scheduling queue
4. waiting- whn the higher job comes in the queue than another one get into the waiting state
5. Termination- thats the last one when the job(process) has to execute
As we know there are 3 types of prior programmes they are:
a. System programs
b. Application programs
c. user programs
here there are the priority of each of the programs in the operating system as it is essential for the OS to which program is to execute first and who must hav the less proior to the other.
so the operating system had made the system program with the high priority as if we dont make the system program to run than how could our system will work.
so we had given it as the highest priority and then the application program have the less prior than the system program as when the system will work then only the application will get the permission to run the program then the most less prior is the user program as after the execution of the system and application programs the user will give the command whic given the name user programs.
So as such i accept that u mst be setting allicket first the points regarding the programms....
now as such in The Operationg system we are given many processess as to be executed and now we need some medium that could handle them inthe good and effecient way
in the operating sysytem the process are beeng executed in the following ways as per the user's needs and also as per the are folllowing operating system requirments. There are following sheduling :
1). FCFS- first come first serve:
The FCFS is the short term of 'First come First serve' as such the name itself tells us that com first and get first as in the railways queue as if we move first in the queue than we will get the tickcet first as such we see in daily life..
So it could be treated as the queue of the processess in which all the prosessess comes to be executed....
Now as the funda of the above types of programs that are system, apllication and user came in the view so we get too know that they need some royality as if they are the more prior option..
so to make them loyal and royal we find two states in FCFS they are:
a. preemptive
b. non primptive
here preemptive means the processs which understand this algorithm and works according to it..
ex.
burst time process name
1. application process
2. system P~
3. user
4. user
5. system
so here it will execute as like
1..2..3..4..5..6.......and so on.
that means it excutes according to its numbering..
where as..
The non preemptive dont understand any law and order and just make the most prior process to execute first and then less prior and than more less prior to it and so on..
so here in the above example if we apply the following non preemptive algorithm..
so here firstly the systemm process will execute that application than user...
so it will execute like this..
2..5..1..3..4..and so onn..
suddenly in non preemptive got met with the problem called 'STARVATION'
the starvation is the problem that occer in the FCFS algorithm as if we have the many processess in the queue and the highest priorty job comes in the queue so this non preemptive make execute it and than if another job of more priority comes in than it will again execute the most prior one and if this conditioin comes again and again than the waiting state process comes under the starvation condition..
to overcome this condition we use the soln naming 'AGING' as if the aging already means that to make the one aged or in the language of computer we could say that the age of process is increased by 1 or the priority is increased by 1 so it hence execute after the priority of the above jobs finishes...
2). SJF- it is the short term of 'Shortest Job First'
According to this sheduling the process run in accordance to its burst time the process having the shortest burst time will execute first here..
This sheduling compromises with the preemptive condition in which the jobs are being executed in the order in which the SJF wants them to...
ex.
burst time process name
1. application process
2. system P~
3. user
4. user
5. system
so it willl execute according to its burst time..
that is 1..2..3.4..5..and so onn..
3). ROUND ROBIN-
In this shedulin we are given the queue .
This type of sheduling performs its execution in a given instance of time that is the time will be given to it to be perform the execution if it take more than that time than it return and put the remaining process in the queue..
ex
burst time process name
4. application process
3. system P~
3. user
4. user
2. system
and max time of each job is 2..
so now this process make the queue such the processes are arranged there now as the chance of first process of execution comes and the burst time is given is 4 and the maximum time for each job is 2 than the process will run till the max time reaches and than the other process will allow to come and rthe left process will made to move back in the queue of all the processsess.. and this process makes the same again and again..
topic: process sheduling
As we start our first question is What is process??.. as if we see in real life it is the sequencial work that we need to prform is the process as in the real life we start with the 5 stages of life that is
1. the baby born
2. childhood
3. young age
4. old age
5. dead
The same is with the essence of os processess, the start with new and end with termination.. the processes are:
1. New- the starting of process
2. ready- the process is ready to run
3. Run- the process enters in the scheduling queue
4. waiting- whn the higher job comes in the queue than another one get into the waiting state
5. Termination- thats the last one when the job(process) has to execute
As we know there are 3 types of prior programmes they are:
a. System programs
b. Application programs
c. user programs
here there are the priority of each of the programs in the operating system as it is essential for the OS to which program is to execute first and who must hav the less proior to the other.
so the operating system had made the system program with the high priority as if we dont make the system program to run than how could our system will work.
so we had given it as the highest priority and then the application program have the less prior than the system program as when the system will work then only the application will get the permission to run the program then the most less prior is the user program as after the execution of the system and application programs the user will give the command whic given the name user programs.
So as such i accept that u mst be setting allicket first the points regarding the programms....
now as such in The Operationg system we are given many processess as to be executed and now we need some medium that could handle them inthe good and effecient way
in the operating sysytem the process are beeng executed in the following ways as per the user's needs and also as per the are folllowing operating system requirments. There are following sheduling :
1). FCFS- first come first serve:
The FCFS is the short term of 'First come First serve' as such the name itself tells us that com first and get first as in the railways queue as if we move first in the queue than we will get the tickcet first as such we see in daily life..
So it could be treated as the queue of the processess in which all the prosessess comes to be executed....
Now as the funda of the above types of programs that are system, apllication and user came in the view so we get too know that they need some royality as if they are the more prior option..
so to make them loyal and royal we find two states in FCFS they are:
a. preemptive
b. non primptive
here preemptive means the processs which understand this algorithm and works according to it..
ex.
burst time process name
1. application process
2. system P~
3. user
4. user
5. system
so here it will execute as like
1..2..3..4..5..6.......and so on.
that means it excutes according to its numbering..
where as..
The non preemptive dont understand any law and order and just make the most prior process to execute first and then less prior and than more less prior to it and so on..
so here in the above example if we apply the following non preemptive algorithm..
so here firstly the systemm process will execute that application than user...
so it will execute like this..
2..5..1..3..4..and so onn..
suddenly in non preemptive got met with the problem called 'STARVATION'
the starvation is the problem that occer in the FCFS algorithm as if we have the many processess in the queue and the highest priorty job comes in the queue so this non preemptive make execute it and than if another job of more priority comes in than it will again execute the most prior one and if this conditioin comes again and again than the waiting state process comes under the starvation condition..
to overcome this condition we use the soln naming 'AGING' as if the aging already means that to make the one aged or in the language of computer we could say that the age of process is increased by 1 or the priority is increased by 1 so it hence execute after the priority of the above jobs finishes...
2). SJF- it is the short term of 'Shortest Job First'
According to this sheduling the process run in accordance to its burst time the process having the shortest burst time will execute first here..
This sheduling compromises with the preemptive condition in which the jobs are being executed in the order in which the SJF wants them to...
ex.
burst time process name
1. application process
2. system P~
3. user
4. user
5. system
so it willl execute according to its burst time..
that is 1..2..3.4..5..and so onn..
3). ROUND ROBIN-
In this shedulin we are given the queue .
This type of sheduling performs its execution in a given instance of time that is the time will be given to it to be perform the execution if it take more than that time than it return and put the remaining process in the queue..
ex
burst time process name
4. application process
3. system P~
3. user
4. user
2. system
and max time of each job is 2..
so now this process make the queue such the processes are arranged there now as the chance of first process of execution comes and the burst time is given is 4 and the maximum time for each job is 2 than the process will run till the max time reaches and than the other process will allow to come and rthe left process will made to move back in the queue of all the processsess.. and this process makes the same again and again..
Multi-level feedback queues (MLF)
n
priority levels — priority scheduling between levels, roundrobin
within a level
Quantum size decreases with priority level
Jobs are demoted to lower priority levels if they don’t
complete within the current quantum
P
a
C
CPPUU
P
3 P2 P1
P
x Py ...
...
Level 1
Level 2
Level
n
q
= t0
q
= 2t0q = 2n-1 t0for more about the processs sheduling methods and ways query try this
http://www.cs.utexas.edu/~lorenzo/corsi/cs372/03F/notes/10-09.pdf
No comments:
Post a Comment