The answers for your question given below. If any doubts let me know.
a) FCFS Scheduling Algorithm
P1 |
P2 |
P3 |
P4 |
0 3 5 15 16
b) Non Pre-emptive Priority Scheduling Algorithm
P1 |
P2 |
P4 |
P3 |
0 3 5 6 16
c) Round Robin Scheduling Algorithm
P1 |
P2 |
P3 |
P4 |
P3 |
P3 |
P3 |
0 3 5 8 9 12 15 16
d)
Turnaround Time = Completion time – Arrival time
P1 = 3 – 0 = 3
P2 = 5 – 1 = 4
P3 = 15 – 1 = 14
P4 = 16 – 1 = 15
Waiting Time = Turnaround Time – Burst Time
P1 = 3 – 3 = 0
P2 = 4 – 2 = 2
P3 = 14 – 10 = 4
P4 = 15 – 1 = 14
Average = (0 + 2 + 4 + 14) / 4 = 20 / 4 = 5
e)
Turnaround Time = Completion time – Arrival time
P1 = 3 – 0 = 3
P2 = 5 – 1 = 4
P3 = 16 – 1 = 15
P4 = 9 – 1 = 8
Waiting Time = Turnaround Time – Burst Time
P1 = 3 – 3 = 0
P2 = 4 – 2 = 2
P3 = 15 – 10 = 5
P4 = 8 – 1 = 7
Average = (0 + 2 + 5 + 7) / 4 = 14 / 4 = 3.5
5. [27pts.] Given the following set of processes, with arrival times, priorities, and the length of...
Opearting system 5. [27pts.] Given the following set of processes, with arrival times, priorities, and the length of the CPU burst in ms: Process Arrival Time Burst time Priority P1 P2 P3 2 10 P4 (Note: a lower number means higher priority; processes P2- P4 arrive at the same time, in the given order) a. Draw a Gantt chart showing a FCFS scheduling algorithm. b. Draw a Gantt chart showing a non-preemptive Priority scheduling algorithm. Draw a Gantt chart showing...
C language show all work 1. [50 pts] Given the following set of processes, with arrival times, priorities, and the length of the CPU burst in ms: Priority Arrival Time Burst time Process P1 P2 P3 P4 4. 3 2 0 0 10 (Note: lower number means higher priority, processes P1, P2, P3, and P4 arrive at the same time, in the given order). a. Draw a Gantt chart showing a FCFS scheduling algorithm. b. Draw a Gantt chart showing...
Given the following set of processes---with the specified length of the CPU burst, arrival time, and priority---compute response time for P1-P5 with round-robin scheduling with time quantum of 10 units. Also compute average response time. Assume that a newly arriving process arrives first at time T- and a process that is preempted due to the completion of its quantum arrives at time T+ in the waiting queue. (Note: Show the Gantt chart and other working details in your worksheet.) Process...
Consider the following set of processes, with the length of the CPU-burst time given in milliseconds:Processburst TimePriorityP1103P211P323P414P552For each of the scheduling algorithms, FCFS, Shortest-Job-First (SJF, non-preemptive), Priority (smaller priority number implies higher scheduling priority), and RR (quantum = 1) do the following.Draw a Gantt chart to show how these processes would be scheduled.Give the turnaround time (total time from the first arrival into ready state until CPU-burst is completed) of each process.Give the waiting time (total time spent in the Ready state) of each process.Give...
Consider the following set of processes, with the length of CPU burst in milliseconds. Process PI P2 P3 P4 P5 Arrival time 00 02 03 06 30 Burst time 10 12 14 16 05 Draw a Gantt chart that illustrates the execution of these processes using the preemptive shorte st job first (SJF) algorithm. Hence find the average waiting time. Draw a Gantt chart that illustrate the execution of these processes using preemptive priority scheduling algorithm. Given priority of each...
Please answer the following question in C++ language Consider the following set of processes, with the length of the CPU burst time given in milliseconds: Process Burst Time Priority P1. 7 5 P2 2 4 P3 11 3 P4 9 1 P5 5 3 The processes are assumed to have arrived in the order P1,P2, P3, P4, P5, all at time 0. a. Draw four Gantt charts that illustrate the execution of these processes using the following scheduling algorithms: FCFS, SJF, nonpreemptive...
Given the following set of processes with corresponding execution times (in ms), arrival times and priority (1 – highest). For each scheduling algorithm: Construct a table showing which process is active and for how long until all processes are completely serviced (as done in class). Calculate the average waiting time and turnaround time. Process ID Burst (ms) Arrival time P1 9 0 P2 12 0 P3 3 0 P4 30 0 P5 20 0 P6 10 0 First Come First Serve...
2. Consider the following processes with the arrival time, burst time, and priority. Draw Gantt chart for a priority-based preemptive CPU scheduling algorithm (the highest number refers the highest priority, in case of same priority, follow FCFS) (4 points) Priority PIDATBT PI 0 10 P3 10 6 3
Consider the following set of processes, with the length of the CPU-burst time given in milliseconds: Process Burst Time Priority P1 10 3 P2 1 1 P3 2 3 P4 1 4 P5 5 2 The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0. a. Draw four Gantt charts illustrating the execution of these processes using FCFS, SJF (SPN), a...
Consider the following set of processes, with the length of the CPU burst given in milliseconds:ProcessBurst TimePriorityP1 54P231P312P472P543The processes are assumed to have arrived in the order P1 , P2 , P3 , P4 , P5 , all at time 0. a. Draw four Gantt charts that illustrate the execution of these processes using the following scheduling algorithms: FCFS, SJF, nonpreemptive priority (a larger priority number implies a higher priority), and RR (quantum = 2). b. What is the turnaround time of each...