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

Questions Cloud

About embedded sub-processes and global sub-processes : Which of the following statements about embedded sub-processes and global sub-processes are true?
How do companies share the love with their customers : How do companies “share the love” with their customers? Summarize the case and identify the dilemma facing Subaru.
Find the average friction factor if the flow is choked : Air flows down a 20-mm-diameter pipe that has a length of 0.8 m. If the velocity at the inlet to the pipe is 200 m/s and its temperature is 30°C.
Break even-incur an economic loss : Refer to the above data. If the product price is $100 at its optimal output, will the firm realize an economic profit, break even, or incur an economic loss?
Implement a framework for cpu scheduling : 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.
About the independent agency system : All of the following statements about the independent agency system are true EXCEPT
Determine the pressure and temperature at the duct exit : A convergent-divergent nozzle supplies air to a well-insulated constant area duct. At the inlet to the duct the Mach number is 2, the pressure is 140 kPa.
Unemployment rate in the united states : Refer to the data in the above scenario. What is the unemployment rate in the United States for the given year?
Positive change in government spending that equals : You are told that 80 cents out of every extra dollar pumped into the economy goes toward consumption (as opposed to saving).

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

Operating System Questions & Answers

  Explain memory, time, build-in-function

I have two programs(Java and C++). They looks similar. But I need to explain why C++ is longer than java and what else to explain such as memory, time, build-in-function and so on...

  Create a directory to serve as the mount point

CIS 240: Assignment - How many possibilities would there be if you had to consider uppercase characters, digits, and other printable symbols from the keyboard?

  Write a non-threaded program to simulation heat dissipation

CSC314 Operating Systems - Write a non-threaded program to simulation heat dissipation on the surface of a cylinder. You can model a cylinder using a 2D HxC array of cells - Implement a multithreaded version of the Sieve of Eratosthenes.

  Create stockio class that is used to read from and write to

Create a StockIO class that is used to read from and write to a text file using an ArrayList. Make sure to use a delimiter between the fields; it does not have to be the # character.

  What is a structural hazard in operating systems

What is a structural hazard in operating systems?

  Value in managing security and risk

Explain ISO 27001's value in managing security and risk. What are the drawbacks and benefits for obtaining ISO 27001 certification?

  Consider a demand-paging system

Consider a demand-paging system with the following time-measured utilizations

  Advantage or a disadvantage of open-source operating system

Discuss an advantage or a disadvantage of open-source operating system.

  Compute time to read whole disk if read head is-first sector

If entire disk was full of data stored consecutively, how much time would it take to read whole disk if read/write head is already positioned on first sector of first track of first cylinder of the disk?

  Ethernet or token ring protocol

Saguaro Federal has mainframes for all of its banks and businesses. Should the corporations use the Ethernet or Token Ring protocol? Describe your choice. Discuss why is this choice appropriate?

  Write a recursive descent parser

Perform the pairwise disjointness test for each rule to show that this grammar allows top-down parsing.

  Questiona furniture manufacturer produces two types of

questiona furniture manufacturer produces two types of desks standard and executive. these desks are then sold at rs

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