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

  Implementation of algorithms for process management

The Shortest Job Next (SJN) algorithm queues processes in a way that the ones that use the shortest CPU cycle will be selected for running rst.

  Develop a user mode command interpreter

Develop a user mode command interpreter which support list-short.

  Memory allocation in operating system

Analysis and implementation of algorithms for memory allocation in operating system, Explain First- t and best- t methods are used in memory allocation in operating systems.

  Stand alone child process

Forking the child process

  Write a multi-threaded program

Write a multi-threaded program to solve producer and consumer problem

  Marginal and average cost curves

n a competitive market place (pure competition) is it possible to continually sell your product at a price above the average cost of production.

  Simulating operating systems scheduling

Simulate the long-term scheduler, the short-term scheduler and the I/O scheduler of the computer using the First-Come-First-Serve algorithm.

  Issues with trusted platform module

Research paper discussing the issues with Trusted Platform Module (TPM)

  Threads

Explain a complication that concurrent processing adds to an operating system.

  Design and programming

Use the semaphore methods to control the concurrency of the solution

  Virtual machines

Virtual machines supported by a host operating system

  Discuss an application that benefits barrier synchronization

Discuss an application that would benefit from the use of barrier synchronization

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