Operating system and cpu scheduling

Assignment Help C/C++ Programming
Reference no: EM131578

Program to be implemented in C++ language - Operating System and CPU Scheduling and Linux Schedulers

Purpose:

The purpose of this project is to provide insight into the Linux Process Scheduling Algorithm by simulating a simplified version of the CPU scheduler.

Background:

The Linux Process Scheduler divides CPU time into epochs. In a single epoch, every process has a specified time slice. In a single epoch, the CPU's job is to schedule contending processes to use the CPU in a fair and efficient manner.

Time slice, priority, nice value and bonus:

The Linux Process Scheduler uses time slice to prevent a single process from using the CPU for too long. A time slice specifies how long the process can use the CPU. In our simulation, the minimum time slice possible is 10ms and the maximum time slice possible is 300 ms. The scheduler assigns higher time slices to processes that are more interactive and lower time slices to processes that are more CPU intensive. Note that time slice is a positive integer in this range [10, 300]. To calculate the time slice, we use this formula:

Each process is supplied with a priority level that ranks a process based on their worth and need for processor time. The priority levels range from 100 to 140 [100,140]. Processes with a lower priority will run before a process with a higher priority. Process with a lower priority level also receives a longer time slice. A process's initial priority (sometimes called static priority) is calculated based on its nice value. Nice values range from -20 to +19 [-20, 19] indicating how nice the process is. Larger nice values correspond to a lower priority. CPU intensive processes typically have higher nice values while IO bound processes have lower nice values. Nice values are provided with the input file. Note that a priority value is a positive integer in this range [100,140]. To calculate the initial (or static) priority we use this formula:

924_Operating System and CPU Scheduling1.png

After a process exhausts its time slice, it will join the expired queue or go back to the active queue. Before doing that, it has to calculate its new priority (sometimes called the dynamic priority). This is the formula used to calculate the dynamic priority:

priority = original priority + bonus:

223_Operating System and CPU Scheduling3.png

Bonus points are given to processes that either use too much or too little CPU time. Bonus points are integers range from -5 to +5 ([-5, 5]). Here are the guidelines to calculating bonus points:

 

1148_Operating System and CPU Scheduling2.png

 

Note : Here total IO mean the total time spent in the IO queue to this point and total CPU mean the total time spent in the CPU to this point.

Run queues/Priority Array:

The runqueue is the list of runnable processes on a given processor. There is only one runqueue per processor. Each runqueue contains two priority arrays: Active and Expired. Each priority array contains one queue of runnable processes per priority level. Each array has 140 levels, thus 140 queues. A process with priority level 125 will go to the _125th _ queue. In this project, we will not implement all 140 queues. We will only implement a single queue. In the real Linux scheduler, each queue represents one priority level. In our project, we will have a single data structure. The active array contains processes that have yet to exhaust their time slice. Once their time slice is exhausted, it will go to the expired array. There is also an  IO queue. This queue is used to hold processes that are using IO. There will be no waiting for access to IO devices.

Thus, all the processes in the IO queue can decrease their IO burst in each clock tick.

Reference no: EM131578

Questions Cloud

Analytical procedures for the cash cycle : Analytical procedures for the cash cycle
Prepare a line graph : Prepare a line graph showing the budgeted total revenues and total expenditures
Assess risks and opportunities in terms of economic : Assess risks and opportunities in terms of economic. A analysis of the case study "AccuForm: Ethical leadership and its challenges in the era of globalization"
Disk scheduling algorithm : Simulation of Elevator and Shortest Seek Time First
Operating system and cpu scheduling : Operating System and CPU Scheduling
Identify a list of matters for consideration : The approach the controller recommended is to compare SUPERVALU's revenue recognition accounting policies to three similar companies, one reporting under US GAAP ( Safeway ) and two reporting under IFRS ( Ahold and Loblaw Companies ).
Prepare a swot analysis : Identify any organization with which you are familiar and provide a SWOT analysis.
Library management system : Prepare a module which can exhibit the Library Management System
Balance sheet and income statement of the company : A preliminary analytical review of the company's most recent balance sheet and income statement

Reviews

Write a Review

C/C++ Programming Questions & Answers

  C++ programming uml diagrams

The goal of this lab is to better familiarize you with polymorphism and the factory design pattern, two key components in Assignment

  Write the code

Write a program that allows an instructor to keep a grade book. Each students has scores for exams, homework assignments, and quizzes.

  Write a program to read a data file and extract parameters

Write a C/C++ program to read a data file and extract parameters. The program must obtain the filename via a command-line argument.

  Develop a simple poker game

Develop a simple poker game

  Implementation of sorting technique

Implementation of sorting technique

  Describe the probability of the moves

Write a program in C++ to describe the Probability of the moves

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Write two short c programs and solve exam-style problem

Write two short C programs and solve four exam-style problems.

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

  Uml diagram of all the classes

Speaking of converting into the correct object-type, the goal of the factory is to abstract away object creation.

  Model-view-controller

Explain Model-View-Controller paradigm

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