Question: write the following code in python given 5 tasks : [task name] [priority] [CPU burst] T1 4 20 T2 2 25 T3 3 25 T4

write the following code in python

given 5 tasks :

[task name] [priority] [CPU burst]

T1 4 20

T2 2 25

T3 3 25

T4 3 15

T5 10 10

And try to implementing different process scheduling algorithms a) FCFS b)SJF c) priority scheduling d) RR scheduling

Priorities range from 1 to 10, where a higher numeric value indicates a higher relative priority. For round-robin scheduling, the length of a time quantum is 10 milliseconds.

It is assumed that all tasks arrive at the same time, so your scheduler algorithms do not have to support higher-priority processes pre-empting processes with lower priorities. In addition, tasks do not have to be placed into a queue or list in any particular order. The result of the scheduling code should be a list indicating the start time and duration of the CPU burst. For example, a FCFS output for the example tasks would be: T1, 0, 20 T2, 21, 25 T3, 46, 25 T4, 71, 15 T5, 86, 10

There are a few different strategies for organizing the list of tasks.One approach is to place all tasks in a single unordered list, where the strategy for task selection depends on the scheduling algorithm. For example, SJF scheduling would search the list to find the task with the shortest next CPU burst. Alternatively, a list could be ordered according to scheduling criteria (that is, by priority). One other strategy involves having a separate queue for each unique priority. It is also worth highlighting that we are using the terms list and queue somewhat interchangeably.However, a queue has very specific FIFO functionality, whereas a list does not have suchstrict insertion and deletion requirements. You are likely to find the functionality of a general list to be more suitable when completing this project.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!