Enter process memory available 2 Enter number of process for SPN: 2 Enter Servic
ID: 3841833 • Letter: E
Question
Enter process memory available 2 Enter number of process for SPN: 2 Enter Service time 1 1 Enter Service time 2- 2 not enough memory! Enter number of process for SPN: 1 Enter Service time 1 1 nter Arrival Time and Finish Time for Process Number 1 23 23 Process Arrival Time service Time Finish Time Turnaround Time P [11 23 23 Total Turnaround Time 1 Average Turnaround Time-1.000000 Enter number of process for RR 1 Enter Service time 1 1 nter Arrival Time and Finish Time for Process Number Process Arrival Time service Time Finish Time Turnaround Time PC11 Total Turnaround Time 1 Average Turnaround Time -1.000000 Press any key to continueExplanation / Answer
RR - Round Robin
SPN -Shortest Process Next
These are the types of OS Scheduling Policies. Before entering into example just look the below basic concepts in Scheduling policies.
Quantitative
Turnaround Time(TAT) – The time from when a process is first added to the group of ready executable processes to the time when it finishes executing and exits. Discussed in much greater detail below.
Response Time(RT) – The time from when the request is first made to the time when the response starts to be received. From a user’s point of view, response time is a better measure than turnaround
time because a process can produce feedback to the user while the process is still executing.
Turnaround Time (TAT) not normalized is the total time a process spends in a system;
this includes the time spent waiting for the processor and the time spent executing on the processor
Turnaround Time (TAT) = Waiting Time + Service Time
Normalized Turnaround Time (NTAT) = TAT / Service Time
Round Robin (RR):
Round Robin is a policy that uses preemption based on a clock interrupt at periodic intervals.
Let us take the following example.
RR (q=1)
Here we are calculating the TAT and NTAT based on the above formula.
Shortest Process Next (SPN)
SPN
Here, SPN penalizes long processes. Short processes are able to cut in line ahead of longer processes.
Response time for short processes is phenomenal. If you compare the NTAT value of the shortest process in our data set, process E, the NTAT value for SPN is 1.50 whereas the NTAT for process E in FCFS and RR is 6.00 and 3.50 respectively.
SPN has the drawback of increasing variability of response times, especially for longer processes. As a result, predictability is reduced.
Buddy System:
The buddy memory allocation technique is a memory allocation algorithm that divides memory into partitions to try to satisfy a memory request as suitably as possible. This system makes use of splitting memory into halves to try to give a best-fit.
Every memory block in this system has an order, where the order is an integer ranging from 0 to a specified upper limit. The size of a block of order n is proportional to 2n, so that the blocks are exactly twice the size of blocks that are one order lower. Power-of-two block sizes make address computation simple, because all buddies are aligned on memory address boundaries that are powers of two. When a larger block is split, it is divided into two smaller blocks, and each smaller block becomes a unique buddy to the other. A split block can only be merged with its unique buddy block, which then reforms the larger block they were split from.
Process A B C D E Mean Arrival Time 0 2 4 6 8 Service Time 3 6 4 5 2RR (q=1)
Finish Time 3 18 17 20 15 TAT 4 16 13 14 7 10.80 NTAT 1.33 2.67 3.25 2.80 3.50 2.71Here we are calculating the TAT and NTAT based on the above formula.
Shortest Process Next (SPN)
Process A B C D E Mean Arrival Time 0 2 4 6 8 Service Time 3 6 4 5 2SPN
Finish Time 3 9 15 20 11 TAT 3 7 11 14 3 7.60 NTAT 1.00 1.17 2.75 2.80 1.50 1.84Here, SPN penalizes long processes. Short processes are able to cut in line ahead of longer processes.
Response time for short processes is phenomenal. If you compare the NTAT value of the shortest process in our data set, process E, the NTAT value for SPN is 1.50 whereas the NTAT for process E in FCFS and RR is 6.00 and 3.50 respectively.
SPN has the drawback of increasing variability of response times, especially for longer processes. As a result, predictability is reduced.
Buddy System:
The buddy memory allocation technique is a memory allocation algorithm that divides memory into partitions to try to satisfy a memory request as suitably as possible. This system makes use of splitting memory into halves to try to give a best-fit.
Every memory block in this system has an order, where the order is an integer ranging from 0 to a specified upper limit. The size of a block of order n is proportional to 2n, so that the blocks are exactly twice the size of blocks that are one order lower. Power-of-two block sizes make address computation simple, because all buddies are aligned on memory address boundaries that are powers of two. When a larger block is split, it is divided into two smaller blocks, and each smaller block becomes a unique buddy to the other. A split block can only be merged with its unique buddy block, which then reforms the larger block they were split from.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.