Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1 Objectives This programming project is to simulate a few CPU scheduling policies discussed in the class. You will write a C/C++ program to implement
1 Objectives This programming project is to simulate a few CPU scheduling policies discussed in the class. You will write a C/C++ program to implement a simulator with different scheduling algorithms. The simulator selects a task to run from ready queue based on the scheduling algorithm. Since the project intends to simulate a CPU scheduler, so it does not require any actual process creation or execution. When a task is scheduled, the simulator will simply print out what task is selected to run at a time. It outputs the way similar to Gantt chart style. 2 Description The selected scheduling algorithms to implement in this project are 1) First Come First Serve (FCFS), 2) Round Robin (RR), and 3) Shortest Remaining Time First (SRTF). The detailed algorithms are already described in class slides and textbook Chapter 6. 2.1 Task Informatio The task information will be read from an input file. The format is pid arrival.time burst.time All of fields are integer type where pid is a unique numeric process ID arrival time is the time when the task arrives in the unit of milliseconds burst.time the is the CPU time reque sted by a task, in the unit of milliseconds The time unit for arrival.time, burst.time and interval is millisecond. 2.2 Command-line Usage and Examples Usage: proj2 input.file [FCFS RRISRTF] [time.quantum where input.file is the file name with task information. FCFS, RR, and SRTF are names of scheduling algorithms. The timequantum only applies to RR. FCFS is nonpreemptive, while RR and SRTF are all preemptive. The last argument is needed only for RR. (See following table for more ex amples) 1 Objectives This programming project is to simulate a few CPU scheduling policies discussed in the class. You will write a C/C++ program to implement a simulator with different scheduling algorithms. The simulator selects a task to run from ready queue based on the scheduling algorithm. Since the project intends to simulate a CPU scheduler, so it does not require any actual process creation or execution. When a task is scheduled, the simulator will simply print out what task is selected to run at a time. It outputs the way similar to Gantt chart style. 2 Description The selected scheduling algorithms to implement in this project are 1) First Come First Serve (FCFS), 2) Round Robin (RR), and 3) Shortest Remaining Time First (SRTF). The detailed algorithms are already described in class slides and textbook Chapter 6. 2.1 Task Informatio The task information will be read from an input file. The format is pid arrival.time burst.time All of fields are integer type where pid is a unique numeric process ID arrival time is the time when the task arrives in the unit of milliseconds burst.time the is the CPU time reque sted by a task, in the unit of milliseconds The time unit for arrival.time, burst.time and interval is millisecond. 2.2 Command-line Usage and Examples Usage: proj2 input.file [FCFS RRISRTF] [time.quantum where input.file is the file name with task information. FCFS, RR, and SRTF are names of scheduling algorithms. The timequantum only applies to RR. FCFS is nonpreemptive, while RR and SRTF are all preemptive. The last argument is needed only for RR. (See following table for more ex amples)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started