Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Marketing The Ultimate Marketing Tool

Authors: Edward L. Nash

1st Edition

0070460639, 978-0070460638

More Books

Students also viewed these Databases questions

Question

Why do mergers and acquisitions have such an impact on employees?

Answered: 1 week ago

Question

2. Describe the functions of communication

Answered: 1 week ago