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  
Jobs arrive at a single-CPU computer facility with interarrival times the are IID exponential random variables...
Jobs arrive at a single-CPU computer facility with interarrival times the are IID exponential random variables with mean 1 minute. Each job specifies upon arrival the maximum amount of processing time it requires, and the maximum times for successive jobs are IDD exponential random variable with mean 1.1 minutes. However, if m is the specified maximum processing time for a particular job, the actual processing time is distributed uniformly between 0.55m and 1.05m. The CPU will never process a job...
Consider the set of processes shown in the table above, with the length of the CPU-burst...
Consider the set of processes shown in the table above, with the length of the CPU-burst time given in milliseconds. The processes are assumed to have arrived in the order P5, P4, P3, P2 , and P1, all approximately at time 0. Draw three Gantt charts illustrating the execution of these processes using SJF, Round-Robin (quantum size = 3), and a non-preemptive priority (a smaller priority number implies a higher priority) scheduling. Calculate average waiting time of each scheduling. Calculate...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT