Can you please help me with this code because i am struggling on how to do this, this code has to be in C code. question that i need help with: Priority with round-robin schedules tasks in order of priority and uses round-robin scheduling for tasks with equal priority. There will be multiple queues in the system each representing one priority class. For ease of implementation, you need total 1 through max_priority numbers of queues. You should start scheduling job out of the max priority queue and serve the members of the queue following RR. The schedule of tasks has the form [task name] [priority] [CPU burst], with the following example format: T1, 4, 20 T2, 2, 25 T3, 3, 25 T4, 3, 15 T5, 10, 10 The output should look like this: Running task = [P1] [4] [5] for 5 units. Task P1 finished. Running task = [P5] [3] [4] for 4 units. Task P5 finished. Running task = [P4] [2] [7] for 1 units. Task P4 exhausted its Quantum hence will be Rescheduled. Running task = [P3] [2] [1] for 1 units. Task P3 finished. Running task = [P4] [2] [6] for 6 units. Task P4 finished. Running task = [P2] [1] [3] for 3 units. Task P2 finished.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
icon
Concept explainers
Question

Can you please help me with this code because i am struggling on how to do this, this code has to be in C code.

question that i need help with:
Priority with round-robin schedules tasks in order of priority and uses round-robin scheduling for tasks with equal priority. There will be multiple queues in the system each representing one priority class. For ease of implementation, you need total 1 through max_priority numbers of queues. You should start scheduling job out of the max priority queue and serve the members of the queue following RR.

The schedule of tasks has the form [task name] [priority] [CPU burst], with the following example format:

T1, 4, 20
T2, 2, 25
T3, 3, 25
T4, 3, 15
T5, 10, 10
The output should look like this:

Running task = [P1] [4] [5] for 5 units.

Task P1 finished.

Running task = [P5] [3] [4] for 4 units.

Task P5 finished.

Running task = [P4] [2] [7] for 1 units.

Task P4 exhausted its Quantum hence will be Rescheduled.

Running task = [P3] [2] [1] for 1 units.

Task P3 finished.

Running task = [P4] [2] [6] for 6 units.

Task P4 finished.

Running task = [P2] [1] [3] for 3 units.

Task P2 finished.

 
Expert Solution
steps

Step by step

Solved in 4 steps

Blurred answer
Knowledge Booster
Depth First Search
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education