Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

First Come First Serve CPU scheduling algorithm in C programming using Linked Lists. The program will be invoked as follows: ./sched [limit] is the name

First Come First Serve CPU scheduling algorithm in C programming using Linked Lists.

The program will be invoked as follows:

./sched [limit]

is the name of a text file including the information about the processes to be scheduled and it will have the following format:

  • is a positive integer number representing the process id of the process

  • is a non-negative integer number given in milliseconds representing the arrival

    time of the process

  • is a positive integer number indicating the amount of CPU-time that the process

    requires

  • is a non-negative integer number indicating the priority of the process. Lower number indicates a higher priority.

For example, the following can be a sample input file:

 1 0 4 70 2 4 19 120 3 9 5 100 4 14 3 0 5 16 2 3 6 23 2 20 

Each line of the input file represents a different process, starts without any space, ends with a newline, and there is a single space (' ') in between each field in a line. Note that the example input file provided above is just for illustration purposes. Your program will be tested using input files containing much larger number of processes. Here is more information about the content of the input file:

All three fields are guaranteed to appear in the input file. Processes are sorted by their arrival times in increasing order. Processes have unique arrival times. Arrival time of the first process is guaranteed to be 0.

is the name of the text file including the result of the simulation. You will receive the name as a command line argument, create the file, and fill its content. Each line of the output file will contain the simulation result of a different process previously provided in the input file and the results will have the following format:

The results in the output file should appear in sorted (increasing) order with respect to their . Each line of the output file should start without any space and should end with a newline, where there is a single space (' ') in between each field in a line. Here is more information about the content of the output file:

  • is a positive integer number in milli seconds representing the completion time of the process with respect to its

  • is a non-negative integer number in milliseconds representing the total time that the process waited in the ready queue

  • [limit] is an optional command-line argument. If this argument is not provided, then you will simulate the whole input file until its end; otherwise, you will only simulate the first [limit] processes. For instance, if limit is given as 10, then you will only simulate the first 10 processes and you program will terminate without simulating the rest of the input file. [limit] is a positive integer less than or equal to the number of lines in the input file.

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

Concepts Of Database Management

Authors: Joy L. Starks, Philip J. Pratt, Mary Z. Last

9th Edition

1337093424, 978-1337093422

More Books

Students also viewed these Databases questions