Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this project you will implement a program to compare the performance of some CPU scheduling algorithms that we discussed in class. Your program should

image text in transcribed

In this project you will implement a program to compare the performance of some CPU scheduling algorithms that we discussed in class. Your program should get a file (e.g., "jobs.txt") as the command-line input, and read the contents of the file. This file contains a set of processes. For example, consider the file with the following content: 1:(45,15);(16,20);(80,10);(40,-1)2:(15,10);(60,15);(90,10);(85,20);(20,-1)3:(30,15);(40,20);(5,15);(10,15);(15,1) In this example we have 3 processes, each process is represented in a separate line. The general format of a line is as follows: The first token is the unique process id. After process-id you have a colon (:) delimiter. Then you will see a list of tuples separated by semi-colons (;). Each tuple indicates the next cpu-burst and io-burst lengths of the process. The cpu and io burst length in terms of milliseconds. If the last io-burst is -1 , then it means that the process terminates without making an I/O. - Note that this input is just an example, I may use a different input file having a different content for testing your codes, but the format of the file will be same. ( Be careful on duplicate last line issue when reading from the input file) - You will assume that all the jobs arrive at the same time (t=0), the order of arrival is the same as the order of process-ids (i.e., smaller ids arrive earlier). You will also assume that, the process never waits at the device queues and I/O starts immediately. First Come First Served (FCFS) Algorithm Implement FCFS scheduling policy. You should print the following a. Average turnaround time: The average of the turnaround times of all process b. Average waiting time: The average of the total waiting time for all processes. Submission Guidelines: You can implement this project in C. Make sure that compilation is error-free and warning-free. In the beginning of codes write the name and student ids of the authors as a comment For C: You should rename your file as "group_yourgroupid.c", Your codes will be compiled using gec on an Ubuntu 22.04 (kernel 4.4.0) as follows: gcc --std=c99 -Wall -02 -o GroupXX.exe group_yourgroupid.c and executed as follows: ./ GroupXX.exe jobs.txt

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

Handbook Of Relational Database Design

Authors: Candace C. Fleming, Barbara Von Halle

1st Edition

0201114348, 978-0201114348

More Books

Students also viewed these Databases questions

Question

Acceptance of the key role of people in this process of adaptation.

Answered: 1 week ago

Question

preference for well defined job functions;

Answered: 1 week ago