Question

Please answer the following question in C++ language Consider the following set of processes, with the...

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 priority (a smaller priority number implies a higher priority), and RR (quantum = 2).

FCFS: Enter the order of the processes

Enter times for above chart starting with 0

SJF: Enter the order of the processes

Enter the times for the above chart starting with 0

Priority: Enter the order of the processes

Enter the times for the above chart starting with 0

Round Robin: Enter the order of the processes

Enter the times for the above chart starting with 0

b. What is the turnaround time of each process for each of the scheduling algorithms in part a?

x FCFS SJF PRI RR
P1
P2
P3
P4
P5

c. What is the waiting time of each process for each of these scheduling algorithms?

X FCFS SJF PRI RR
P1
P2
P3
P4
P5

d. Which of the algorithms results in the minimum average waiting time (over all processes)?

The following processes are being scheduled using a preemptive, roundrobin scheduling algorithm. Each process is assigned a numerical priority, with a higher number indicating a higher relative priority. In addition to the processes listed below, the system also has an idle task (which consumes no CPU resources and is identified as I ). This task has priority 0 and is scheduled whenever the system has no other available processes to run. The length of a time quantum is 5 units. If a process is preempted by a higher-priority process, the preempted process is placed at the end of the queue.

a. Show the scheduling order of the processes using a Gantt chart.

Enter the times for the above chart starting with 0

b. What is the turnaround time for each process?

TAT
P1
P2
P3
P4
P5
P6

c. What is the waiting time for each process?

WT
P1
P2
P3
P4
P5
P6

d. What is the CPU utilization rate? Round of to two decimal places.

Thread Priority Burst Arrival
P1 20 30 0
P2 30 20 20
P3 20 10 50
P4 35 25 65
P5 5 5 95
P6 15 10 105
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Since the gantt chat can't be typed here so I have attached handwritten notes

Add a comment
Know the answer?
Add Answer to:
Please answer the following question in C++ language Consider the following set of processes, with the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • QUESTION 1 Consider the following set of processes, with the length of the CPU burst time...

    QUESTION 1 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 priority (a smaller priority number implies a higher priority), and RR (quantum = 2). b. What...

  • 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: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...

  • 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 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...

  • Cpu scheduling

    Consider the following set of processes, with the length of the CPU burst times given in milliseconds:a. Draw four Gantt charts illustrating the execution of the processes using FCFS, Preemptive SJF, a non-preemptive priority, and a RR (quantum=2) scheduling. (30 pts)Note: for the RR consider that the arriving time is 0 for all processesb. What is the average waiting time of each process for of the above scheduling algorithms? (10 pts)P1 8 2 0 P2 5 36P3 1 1 8...

  • 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: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...

  • Computer Science Help Instructions Consider the following set of processes, with the length of the CPU-burst...

    Computer Science Help Instructions Consider the following set of processes, with the length of the CPU-burst time given in milliseconds: Burst Time Process P1 P2 Priority 10 4 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, a nonpreemptive priority (a smaller priority number implies a higher priority), and RR (quantum 1) scheduling. b. What is the...

  • Given the following set of processes with corresponding execution times (in ms), arrival times and priority...

    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...

  • C language show all work 1. [50 pts] Given the following set of processes, with arrival...

    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...

  • The following processes P1, P2, P3, P4 and P5 arrive at the same time (t =...

    The following processes P1, P2, P3, P4 and P5 arrive at the same time (t = 0). Establish a timeline of the process scheduling for the following scheduling algorithms while also identifying start times for each process. FCFS (first come, first serve; assume order of P1, P2, P3, P4 and P5) SJF (shortest job first) Priority iv Round Robin (quantum = 1, assume order of P1, P2, P3, P4 and P5) Determine the average waiting time for each algorithm.

  • The following processes are being scheduled using a preemptive, roundrobin scheduling algorithm. Each process is assigned...

    The following processes are being scheduled using a preemptive, roundrobin scheduling algorithm. Each process is assigned a numerical priority, with a higher number indicating a higher relative priority. In addition to the processes listed below, the system also has an idle task (which consumes no CPU resources and is identified as I ). This task has priority 0 and is scheduled whenever the system has no other available processes to run. The length of a time quantum is 5 units....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT