Question

Consider a multilevel feedback queue shown below. Assuming that the following processes are the only ones that exist, determiquantum 8 16 quantum FCFS

Consider a multilevel feedback queue shown below. Assuming that the following processes are the only ones that exist, determine the finish time for each of the processes. Assume that each queue is following FCFS scheduling policy. CPU first schedules all processes in the top queue (Quantum-8) before scheduling processes in queue 2 (Quantum 16), and only then it will schedule processes in queue 3 (FCFS). CPU Burst time Arrival time Priority Process P1 8 15 1 P2 10 15 2 P3 25 5 P4 32 20 5 P5 15 25 4
quantum 8 16 quantum FCFS
0 0
Add a comment Improve this question Transcribed image text
Answer #1

In FCFS (First come, First Serve), a process is run till completion in order which they arrive and only then the next process is undertaken.

In Multilevel Feedback Queue, if a process exceeds the quantum limit, it gets demoted to the lower queue. All processes in a higher priority queue are executed before any of the lower priority queues are touched. The last queue has no quantum limit, it processes each process till completion (FCFS).

This is the sequence flow: (For simplicity, whenever I mention a number, assume it's time)

P3 arrives at 5, and runs for 8. Demotes to queue2 P3: 5 - 13 (remaining 17)

P2 was already in the queue at 10, it starts at 13 and runs for 8. Demotes to queue2 P2: 13 - 21 (remaining 7)

P1 was already in the queue at 15, it starts at 21 and runs for 8. As it only required 8, it exits P1: 21 - 29 (exits)

P4 was already in the queue at 20, it starts at 29 and runs for 8. Demotes to queue2 P4: 29 - 37 (remaining 24)

P5 was already in the queue at 25, it starts at 37 and runs for 8. Demotes to queue2 P5: 37 - 45 (remaining 7)

.................................................................................................................................................................................

Now the first queue is empty, the second queue looks like this: P3 -> P2 -> P4 -> P5

.................................................................................................................................................................................

P3 continues execution at 45, runs for 16 (quantum=16). Demotes to queue3 P3: 45 - 61 (remaining 1)

P2 continues at 61, runs for 7 (as only 7 remaining). Exits P2: 61 - 68 (exits)

P4 continues at 68, runs for 16. Demotes to queue3 P4: 68 - 84 (remaining 8)

P5 continues at 84, runs for 7 (as only 7 remaining). Exits P5: 84 - 91 (exits)

.................................................................................................................................................................................

Now the first and the second queues are empty, the third queue looks like this: P3 -> P4

.................................................................................................................................................................................

P3 continues at 91, runs for 1. Exits P3: 91 - 92 (exits)

P4 continues at 92, runs for 8. Exits P4: 92 - 100 (exits)

.................................................................................................................................................................................

Now to determine the finish times, see where each process exited.

P1: 29

P2: 68

P3: 92

P4: 100

P5: 91

.................................................................................................................................................................................

If you have any doubts, feel free to comment and I'll be happy to respond!

Add a comment
Know the answer?
Add Answer to:
Consider a multilevel feedback queue shown below. Assuming that the following processes are the only ones...
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
  • 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...

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

  • Given the following set of processes---with the specified length of the CPU burst, arrival time, and...

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

  • 4. Consider a ready queue with four processes :- Process Arrival Time Burst Time (ms) P1...

    4. Consider a ready queue with four processes :- Process Arrival Time Burst Time (ms) P1 Priority P2 P3 P4 P5 For each of the following CPU scheduling algorithms, determine the turnaround and average waiting time for each of the process :- a. Shortest remaining Time First b. Shortest Job First C. Priority Scheduling (Both pre-emptive and non-preemptive) d. Round Robin (quantum is 1 ms)

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

  • 8. Consider the following 5 processes in the ready queue: Process Burst Priority Arrival time n...

    8. Consider the following 5 processes in the ready queue: Process Burst Priority Arrival time n w P1 P2 w N P3 P P - W WE O P4 N P5 N A O Draw Gantt charts illustrating the execution of these processes for each of the following algorithms: (a) preemptive SJF, (b) RR (with quantum = 1), (C) FCFS, and (d) preemptive priority, and calculate the respective turnaround and waiting times.

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

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

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

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