Program to be implemented in c language - operating system

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

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: EM13347645

Questions Cloud

Describe the design tests of controls substantive tests of : describe the design tests of controls substantive tests of transactions and analytical procedures for the warehousing
Memorandumtonbspnbspnbspnbspnbspnbsp nbspnbsp management : memorandumtonbspnbspnbspnbspnbspnbsp nbspnbsp management analystfromnbspnbsp nbspnbsp beverly bunchbb budget
Objective 1 understand the effect that country and regional : objective 1 understand the effect that country and regional culture ethics and law have on the business practices of
Simulation of elevator and shortest seek time first sstf : simulation of elevator and shortest seek time first sstf disk scheduling algorithmrequirements must be implemented in c
Program to be implemented in c language - operating system : program to be implemented in c language - operating system and cpu scheduling and linux schedulerspurposethe purpose of
Backgroundsupervalu inc a large us retail grocer had 361 : backgroundsupervalu inc. a large us retail grocer had 36.1 billion in sales for its fiscal year ended february 25 2011.
Question 1 identify any organization with which you are : question 1. identify any organization with which you are familiar and provide a swot analysis.question 2. using the
Part-aq1 suppose the scenario of library management system : part-aq1 suppose the scenario of library management system. in it there are a. book no. b. name of the book. c.
Objectives to apply certain steps in the audit planning : objectives to apply certain steps in the audit planning process with emphasis on risk identification and audit response

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Design a program that asks for the number of fat grams

Starting out with Programming logic and design 3rd Author Tony Gaddis - Pg 279, PE 3 Fat Grams Calculator

  Write a program for keeping a course list

Write a program for keeping a course list for each student in a college. The information about each student should be kept in an object that contains the student's name and a list of courses completed by the student.

  C program to compute parking fare for customers

Write C program to compute parking fare for customers who park their cars in parking lot when following information is provided: A character showing type of vehicle: C for car, B for bus and T for truck

  Creates a bus class

write a program that creates a bus class. create a constructor that initializes the number of passengers and number of seats. declare four objects. use the default copy constructor to initialize two of the objects.

  Program to tell you how many months it will take to pay off

write a program to tell you how many months it will take to pay off any loan, as well as the total amount of interest paid over the life of the loan.

  Computer programming using c language lab

Computer programming using c language lab

  Model-view-controller

Explain Model-View-Controller paradigm

  Random permutations

Write a program in C++ that gives a prompt to the users, asking for an integer M.It then prints out a M different random permutations, one on each of M lines, of the numbers 1, 2, ... , 10, separated by spaces or tabs.

  A class is derived from another one

In C++, when a class is derived from another one, you can specify the inheritance relationship as public, private or even protected. What are the main differences a between these types of inheritance in C++? How does a public inheritance differ from ..

  Explain initialize variables counting the lines and letters

If the output file cannot open, exit the program. Initialize variables counting the lines and letters. Write a program that reads a given text file, outputs the text file as is, and also prints the number of lines and the number of times each lette..

  Two for loops that will calculate the sum of all even number

Write a program using two for loops that will calculate the sum of all even numbers between 2 and 100,

  Amanda and tyler opened a business

Amanda and Tyler opened a business that specializes in shipping liquids, such as milk, juice, and water, in cylinderical containers. The shipping charges depend on the amount of liquid in the container. (For simplicity, you may assume that the con..

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