Implement a framework for cpu scheduling

Assignment Help Operating System
Reference no: EM131467224

Problem Statement:

You will implement a framework for CPU scheduling with three scheduling algorithms: FIFO, round robin, and shortest job first (SJF). Jobs arrive at the CPU scheduler at arbitrary times. When a job arrives, its computation time is known. Assume that all jobs involve only computation, and perform no Input/Output. Jobs thus need to run on the CPU for a total duration equal to their known computation times. When they complete, they leave the system.

FIFO

Jobs are processed on a first-in-first-out basis.

Round-robin time-slicing

Pick head of queue, run a job for a time quantum, preempt it, run the next one and so on. A new job goes at the tail of the queue and so does a preempted one. If a new job arrives at the same time as a time quantum completes, the new job goes at the end of the queue.

Shortest Job First - Preemptive version (Shortest Remaining Time First)
If there is more than one job, select the one with the shortest execution time. If a new job has shorter REMAINING time, preempt current job and switch to new one.

Solution Specification: The input to your program will be a file containing job IDs with their arrival times and required computation times.

Input Format
The input command line format should be as follows (where sched is the name of your executable):

sched -[Rk|S|F] <filename>

Where the command-line flag:
- R is round robin, k is an integer specifying the time-slice
- S is shortest job first
- F is FIFO
- <filename> is the name of the input file whose format is described below

Format of the input file
You must use the following format for your input to enable us to grade your project easily. The file must contain the description of one process per line where each line has the following fields (all fields are integers separated by ",") in the following order:

id: The id of the job
arrival time: Arrival time of the job after start of simulation
comptime: Computation time

A sample input file looks like this:
0,9,25
1,17,10
2,32,7
3,35,20

The output consists of the completion time of each job. Below is the corresponding output for the test input above. The first column represents id of the job and the second column represents the completion time:

sched -F <filename> for FIFO
0 34
1 44
2 51
3 71

sched -S <filename> for SJF-preemptive
0 51
1 27
2 39
3 71

sched -R8 <filename> for RR with k = 8 (time-slicing begins at 9 in this case because that is when the first job arrives)

0 59
1 50
2 48
3 71

NOTE: If the quantum expires on an old job and a new job arrives at the same time in RR, put the new job at the end of the queue, after the old one.

Write-up:

Your write-up should include any known bugs and limitations in your programs. If you made any assumptions, document what you decided. This write-up should be in text format and should be submitted along with your code.

Reference no: EM131467224

Implement for the efficient data structure

You might need queue to implement for the efficient data structure and perform some operations on that. Please don't use any library for that. Please implement queue by your

Generate a random reference string of length

Generate a random reference string of length - Run FIFO page replacement algorithm. ?Draw a graph and show the relationship between number of frames vs number of page fault

Explain why using h-mac is more secure than mac

Compare the differences between MAC and H-MAC. Explain why using H-MAC is more secure than MAC? Be prepared to fully support your argument. Give examples of commonly used MACs

How are the two types of operating systems similar

What are the differences between a Windows operating system and a Linux operating system? What inherent security controls are included with each operating system? How are the

Implement the first come first serve scheduling algorithm

COSC 3406 (Programming: Java or C++) Assignment. Implement the following scheduling algorithms and report the average waiting time for all these cases. First Come First Serve

Discuss at least two different types of operating systems

Write an essay using Microsoft Word identifying and discussing at least two different types of operating systems. Include the advantages, disadvantages, and security concern

Discussing at least two different types of operating systems

Write an essay using Microsoft Word identifying and discussing at least two different types of operating systems. Include the advantages, disadvantages, and security concern

Discussing at least two different types of operating systems

Write an essay using Microsoft Word identifying and discussing at least two different types of operating systems. Include the advantages, disadvantages, and security concern

Reviews

len1467224

4/19/2017 3:07:44 AM

Grading: 25 points: FIFO works correctly 25 points: SJF works correctly 25 points: RR works correctly 15 points: Proper output, according to guideline above 5 points: “Write up” document with proper instructions 5 points: Comments in code 5 (Extra) points: LAB done in GUI To receive full credit for comments in the code you should have headers at the start of every module/ subroutine/ function explaining the inputs, outputs and function of the module. You should have a comment on every data item explaining what it is about. (Almost) every line of code should have a comment explaining what is going on. A comment such as /* Add 1 to counter */ will not be sufficient. The comment should explain what is being counted.

len1467224

4/19/2017 3:07:15 AM

You will submit your program via blackboard (Lab 2) on or before the due date. You should ZIP your source files and write-up into a single file and submit. You should test your programs on a variety of test data. Be sure that you include everything necessary to unzip this file on another machine and compile and run it. Pleaseinclude the executable. The name of your submitted zip file should be your campus login.Make sure your name and your student ID are listed in your write-up, and in a comment in your source code. Late submissions will be accepted at a penalty of 10 points per day. If your program is not working by the deadline, send it anyway for partial credit. Do not take a zero on any lab just because the program isn't working yet.

Write a Review

 
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd