Question

In: Computer Science

Scheduling Algorithms Part 1 First Come First Serve Consider the following processes along with their burst...

Scheduling Algorithms

Part 1

First Come First Serve

Consider the following processes along with their burst time (in Calculate the average waiting time if the processes arrive in the following order

Process

Burst Time in Ms

P1

20

P2

10

P3

5

Calculate the average waiting time if the processes arrive in the following order

(i)P1, P2, P3

(ii)P2, P3, P1

(i) Case 1: Consider a case if processes P1, P2, P3 arrive at the same time say 0 ms in the system in the order P1, P2, P3. The arrival of processes is represented in the Gantt chart as shown below.

Gantt chart

P1

P2

P3

                                          20                                             30                                            35

Process

Waiting Time

Turnaround Time

P1

0

20

P2

20

30

P3

30

35

Therefore, average waiting time =

Turnaround Time =

Case 2: Processes arrive in order P1, P2, P3, let us assume at 0 ms, 2 ms and 4 ms, respectively.

Arrival Time: Time at which the process arrives in the ready queue.

Process

Burst Time

Arrival Time

P1

20

0

P2

10

2

P3

5

4

Gantt chart: Draw the Gantt Chart

Waiting time for process P1 = 0 ms

Waiting time for process P2 = 20 ms – 2 ms = 18 ms

Waiting time for process P3 = 30 ms- 4 ms = 26 ms

Calculate the average waiting time

Calculate the Turnaround Time

Solutions

Expert Solution


Related Solutions

in C++ We are going to implement the following scheduling algorithms 1. First-Come First-Served (FCFS) 2....
in C++ We are going to implement the following scheduling algorithms 1. First-Come First-Served (FCFS) 2. Shortest Remaining Time First (SRTF) 3. Highest Response Ratio Next (HRRN) 4. Round Robin, with di_erent quantum values (RR) We are interested to compute the following metrics, for each experiment: _ The average turnaround time _ The total throughput (number of processes done per unit time) _ The CPU utilization _ The average number of processes in the ready queue The simulator needs to...
List of six process scheduling algorithms (for operating systems): First-Come, First-Served (FCFS) Scheduling Shortest-Job-Next (SJN) Scheduling...
List of six process scheduling algorithms (for operating systems): First-Come, First-Served (FCFS) Scheduling Shortest-Job-Next (SJN) Scheduling Priority Scheduling Shortest Remaining Time Round Robin(RR) Scheduling Multiple-Level Queues Scheduling Compare and contrast the algorithms against one another here. You have at least six algorithms, so this should be an extensive part of the project, and all research based.
A set of processes along with their burst time in milliseconds is given below. The processes...
A set of processes along with their burst time in milliseconds is given below. The processes should execute in First Come First Served order. Assume that the quantum (q) is 3: Process Burst Time P1 22 P2 4 P3 12 P4 15 P5 2 Find the average waiting time using the Round Robin algorithm. Round your answer to 2 decimal places
1. Consider the following set of processes, with the length of CPU burst and arrival time...
1. Consider the following set of processes, with the length of CPU burst and arrival time given in milliseconds.                                                              Process            Burst time       Priority            Arrival Time             P1                         10                    3                              0 P2                          1                     1                              2 P3                          2                     4                              4 P4                          5                     2                              8 a) Draw the Gantt chart that illustrates the execution of these processes using the preemptive priority scheduling algorithm (a smaller priority number implies a higher priority). b) What...
Draw six Gantt charts that illustrate the execution of these processes using the following scheduling algorithms:
Draw six Gantt charts that illustrate the execution of these processes using the following scheduling algorithms: 
An operating system uses the First-Come, First-Served (FCFS) CPU scheduling algorithm. Consider the following set of...
An operating system uses the First-Come, First-Served (FCFS) CPU scheduling algorithm. Consider the following set of processes in this OS, with the length of the CPU burst time given in milliseconds, and the shown priority. A larger priority number implies a higher priority. There is no pre-emption. The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0. Process Burst Time Priority P1 2 2 P2 1 5 P3 4 1 P4...
Consider the following set of processes, with the length of the CPU burst given in milliseconds:...
Consider the following set of processes, with the length of the CPU burst given in milliseconds: Process Burst Time Priority P1 2 2 P2 1 1 P3 8 4 P4 4 2 P5 5 3 The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0. Draw four Gantt charts that illustrate the execution of these processes using the following scheduling algorithms: FCFS, SJF, non preemptive priority (a smaller priority number implies...
Consider the following set of processes, with the length of the CPU burst given in milliseconds...
Consider the following set of processes, with the length of the CPU burst given in milliseconds       Process            Burst Time      Priority       P1                    2                      2       P2                    1                      1       P3                    8                      4       P4                    4                      2       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...
Compare First Come First Served Scheduling, and Round Robin Scheduling. In your comparison, include discussions of...
Compare First Come First Served Scheduling, and Round Robin Scheduling. In your comparison, include discussions of their potential advantages and disadvantages, and which scheduling scheme performs better under what job load conditions. (You need to give proper reasons.)
Consider the following set of processes, with the length of the CPU-burst time given in milliseconds:...
Consider the following set of processes, with the length of the CPU-burst time given in milliseconds: Process          Burst Time     P1                             5         P2                             3             P3                             1           P4                             7            P5                             4            The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0. If FCFS scheduling is used, what is the average turnaround time of these processes? Answer: Consider the following set of processes, with the length of the CPU-burst time given in milliseconds: Process          Burst Time     P1                             5         P2                             3             P3                             1           P4                             7            P5                             4           ...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT