Question

In: Computer Science

Consider the following set of jobs to be scheduled for execution on a single CPU system....

Consider the following set of jobs to be scheduled for execution on a single CPU system.

Job

Arrival Time

Burst (msec)

Priority

A

0

6

3 (Silver)

B

1

2

1 (Diamond)

C

3

5

3 (Silver)

D

5

3

4 (Bronze)

E

7

2

2 (Gold)

  

  1. Draw a Gantt chart showing First-Come-First-Served (FCFS) scheduling for these jobs.  
  2.     Draw a Gantt chart showing preemptive PRIORITY scheduling.
  3. Draw a Gantt chart showing Highest Response Ratio Next (HRRN) scheduling.
  4.     Draw a Gantt chart showing Round Robin (RR) (quantum = 4) scheduling.

Solutions

Expert Solution

Gantt chart showing First-Come-First-Served (FCFS):

F.C.F.S is non preemptive Algorithm

F.C.F.S Algorithm allows the process whichever arrived earlier.Here A comes at 0 th time so it is scheduled first.By the time A completed Execution B,C,D are in Ready Queue. From B,C,D B is Arrived Early so B is Scheduled next.By the time B is Completed C,D,E are in Ready Queue. From C,D,E, C is Arrived Early so C is scheduled next.then D then E

Gantt chart showing preemptive PRIORITY scheduling:

Here 1(Diamond) has higher priority ,4(Bronze) has Lower Priority

According to Premptive Priority Scheduling we should allow processes to preempt from execution if a process with highest priority comes .

At Arrival time 0 A comes First and has priority 3 .and it executed for 1 time

At Arrival time 1 B comes with the priority higher than A so A should be preempted ,put into ready Queue and allow B should be Executed next.As B is the Highest Priority among all other processes so it should be executed until it's completion.

At Arrival time 3 there are A and C processes are in Ready Queue.As A and C have same priorities so we should take the processes which is having lowest Arrival time..so we should take A as next One to be Executed.Until 7th time we allow A to be Executed because at 7th time E new process is coming into Ready Queue with highest Priority(2)

At Arrival time 7 there are 3 processes are in Ready Queue they are C,D and E. we preempt A from Execution as E has highest priority and allow E to be Executed completely as E has Highest Priority among remaining processes in Ready Queue

At Arrival time 9 there are 3 processes are in Ready Queue they are A,C,D .As A and C have same priorities and D has lower priority than A and C we allow the process A as it is arrived earlier and has higher priority than D

At Arrival time 9 there are 3 processes are in Ready Queue they are C,D .C has Higher Priority than D.So C should be allowed to execute next then D.

Final Gantt chart for Preemptive Priority Scheduling:

Gantt Chart For Highest Response Ratio Next:

In this Algorithm we alllow the first process which was arrived earlier to be Executed Smoothly and from next process  onwards we Calculate H.R.R.N .whichever process has highest H.R.R.N that is Scheduled first.

B's H.R.R.N is Highest so we allow B to Execution  

C and D both have Highest H.R.R.N but we select C because it is arrived earlier than D.So we schedule C next

As E's H.R.R.N is highest we should E next then D

Final Gantt Chart for H.R.R.N:

Gantt Chart For Round Robin:

RoundRobin is Premptive version of F.C.F.S

Given Time Quantum=4

After every 4th time the process gets preempted.

at Arrival time 0 A will enter into Execution so it will execute upto 4 and then preempts

By time 4 B,C are in ready Queue and A is pushed into Queue After B and C. B is allowed to Execute completely as it wants 2 units of Execution. Then C is Executed for another 4 units and C is preempted

By the time 10 A,D,E and C are in Queue.Next A is Allowed to Execute remaining 2 units(2)

D,E AND C are in queue. so D should be allowed to execute next

Next E as it is in first in queue

Next C's remaining Units(1) are Executed

Final Gantt Chart For Round Robin

  


Related Solutions

Consider the following set of jobs to be scheduled for execution on a single CPU system....
Consider the following set of jobs to be scheduled for execution on a single CPU system. Job Arrival Time Burst (msec) Priority A 0 6 3 (Silver) B 1 2 1 (Diamond) C 3 5 3 (Silver) D 5 3 4 (Bronze) E 7 2 2 (Gold)    (a)     Draw a Gantt chart showing First-Come-First-Served (FCFS) scheduling for these jobs. (b)     Draw a Gantt chart showing preemptive PRIORITY scheduling. (c)    Draw a Gantt chart showing Highest Response Ratio Next (HRRN) scheduling. (d)     Draw a...
Consider the following set of jobs to be scheduled for execution on a single CPU system....
Consider the following set of jobs to be scheduled for execution on a single CPU system. Job Arrival Time Burst (msec) Priority A 0 6 3 (Silver) B 1 2 1 (Diamond) C 3 5 3 (Silver) D 5 3 4 (Bronze) E 7 2 2 (Gold)    (a)     Draw a Gantt chart showing First-Come-First-Served (FCFS) scheduling for these jobs. (b)     Draw a Gantt chart showing preemptive PRIORITY scheduling. (c)    Draw a Gantt chart showing Highest Response Ratio Next (HRRN) scheduling. (d)     Draw a...
Consider the following set of jobs to be scheduled for execution on a single CPU system....
Consider the following set of jobs to be scheduled for execution on a single CPU system. Job Arrival Time Burst (msec) Priority A 0 6 3 (Silver) B 1 2 1 (Diamond) C 3 5 3 (Silver) D 5 3 4 (Bronze) E 7 2 2 (Gold)    (a) Draw a Gantt chart showing First-Come-First-Served (FCFS) scheduling for these jobs. [3 Marks] Answer (a) 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15...
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...
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...
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           ...
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 Arrival Time Burst Time P1 0 5 P2 2 3 P3 3 2 P4 4 4 P5 5 3 a. Draw Gantt charts illustrating the execution of these processes using SJF pre-emptive b. What is the turnaround time of each process for each of the scheduling algorithms c. What is the waiting time of each process for each of the scheduling algorithms  
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 Priority Arrival Time P1 10 3 0 P2 1 1 12 P3 2 4 0 P4 1 5 0 P5 5 2 0 In the above table, a smaller priority number implies a higher priority. Suppose that these processes are scheduled by the priority policy with preemption. Draw the Gantt chart (i.e., time chart) illustrating the execution of these processes. What...
There are 5 jobs that have to be scheduled in a two-machine job shop system. The...
There are 5 jobs that have to be scheduled in a two-machine job shop system. The processing time and the sequence of the required operations of these jobs on the two machines are shown in the table below. For example, job A needs 6 hours on machine 1 (M1) and 4 hours on machine 2 (M2), and it has to be processed on M1 and then M2. You have to use the shortest processing time (SPT) rule to schedule the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT