Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PROGRAM DESCRIPTION: In this programming assignment, you will write a complete C program that implement a simulation for the Shortest Remaining Time First (SRTF) preemptive

image text in transcribedimage text in transcribed

PROGRAM DESCRIPTION: In this programming assignment, you will write a complete C program that implement a simulation for the Shortest Remaining Time First (SRTF) preemptive CPU scheduling algorithm. Note that in this exercise, we know the burst time of each process. You will read input using a file (you must prompt for the name of the file) where the input will be formatted as follows on each line (using whitespace as a delimiter) ProcesSID ArrivalTimeBurstTime where ProcessID is a C-string up to 6 characters (5 with a NULL terminator) and the ArrivalTime and BurstTime are integers, representing units of time. See the SAMPLE OUTPUT for examples of some input files. There is no limit to the number of processes supported by your CPU scheduler, so you will need to read the file to determine how many processes are specified (note that each process must be specified in the file on a separate line) Based on the SRTF algorithm, you will calculate the finish and wait times for each process as well as the average throughput, waiting time, and turnaround time for the processes. REQUIREMENTS .Your code should be well documented in terms of comments. For example, good comments in general consist of a header (with your name, course section, date and brief description), comments for each variable, and commented blocks of code Your program should be named "minor4.c", without the quotes. . Your program will be graded based largely on whether it works correctly on the CSE machines (e.g., cse01, cse02, ..., cse06), so you should make sure that your program compiles and runs on a CSE machine individual student SAMPLE OUTPUT (user input shown in bold green): more pDatal.txt Pl 0 11 P2 72 P3 55 $./a.out

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

More Books

Students also viewed these Databases questions

Question

What are the penalties for not making timely payroll deposits?

Answered: 1 week ago

Question

2. Discuss various aspects of the training design process.

Answered: 1 week ago

Question

Describe Table Structures in RDMSs.

Answered: 1 week ago