Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The purpose of this project is to write a program that simulates an operating system scheduler and to compare each scheduler performance in a report.

The purpose of this project is to write a program that simulates an operating system scheduler and to compare each scheduler performance in a report. You can use Java or C++ but please do not use package names or namespaces. Do not use 3rd-party libraries. The program implements the following CPU scheduling algorithms: First-Come-First-Serve (FCFS) Shortest-Job-First (SJF) Round-Robin with time quantum = 20 Round-Robin with time quantum = 40 Lottery with time quantum = 40 Your program will read the processes, their burst times and their priority from test data file. The process files are located on Blackboard with this document. The input file will be in the following format : pid burst_time priority Where the first line is id of the process, the second is the burst time that the process requires, the third line will be the priority of the process. The priority is only to be used in the lottery scheduler. **Note: the scheduler takes 3 units of CPU time to switch a process (context-switching cost). You will need to add this to the runtimes that you track. Assume that, if the same process continues to run after a context switch, there will still be a context-switching cost. Note: You can make the following assumptions: Processes arrive in the order in which are read from the file. All processes are in the queue at CPU time = 0 Requirements output data: Output the details of each schedulers execution of each test file to a csv formatted file. You need to show The following columns: CpuTime, PID, StartingBurstTime, EndingBurstTime, CompletionTime The completion time should be zero unless the process has completed (EndingBustTime = 0). Name each output file: scheduler_name-testfile_name.csv Requirements for each scheduler: When all of the processes of a particular file complete, calculate and output the average turnaround times (completion times) of all processes for each scheduling algorithm. Your output must be as a CSV file.

Test Data 1:

1 624 2 2 488 15 3 231 16 4 337 7 5 222 3 6 130 17 7 317 11 8 439 8 9 942 10

Test data 2:

1 596 16 2 222 5 3 123 3 4 209 3 5 609 8 6 814 11 7 204 5 8 308 10 9 333 1

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

Step: 3

blur-text-image

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

Upgrading Oracle Databases Oracle Database New Features

Authors: Charles Kim, Gary Gordhamer, Sean Scott

1st Edition

B0BL12WFP6, 979-8359657501

More Books

Students also viewed these Databases questions