The highest priority eligible to run will be scheduled

Assignment Help Basic Computer Science
Reference no: EM13304387

The XINU Operating System currently implements a Pre-emptive Priority Scheduling Algorithm. It follows the idea: 'At any point in time, the highest priority eligible to run will be scheduled'. As you now know, process priority is part of the process table and this priority is used to order the processes in the ready queue. When it is time to schedule a process to run, the highest priority process from the ready queue is chosen for execution. Even though there may be other processes in the system with higher priorities than the currently running process, they may be waiting for a message, or waiting on a semaphore, and hence are not eligible to run. If an ineligible process becomes eligible, this process is placed in the ready queue according to its priority and the reschedule function is invoked. If the priority of this process is lower than that of the currently executing process, then the current process will continue to run. The XINU Scheduling algorithm is pre-emptive, which means that although the highest priority process could possibly run for a longer time, a regular clock interrupt will pre-empt the process to check if there is any new higher priority process. Note that in such a scenario, the NULLPROC runs only when there are no other process to run, as NULLPROC's priority is the lowest possible priority the system supports.
One major problem with the above scheduling algorithm is that a high priority process may never let a lower priority process run. This is called starvation. The two-level round robin scheduling algorithm is one way to solve this problem.

In the two-level round robin scheme, each process belongs to a paticualar group. As part of the periodic timer interrupt, the scheduler context switches out the existing process and picks a different process to run according to the following algorithm:

step #1: At group level, the scheduler should decide one group via round robin algorithm. It indicates each group should be chosen one after another. If one group has no process in ready queue, the scheduler just skips it.
step #2: Within the group chosed in step #1, the scheduler picks up one process, which is in ready queue, via round robin algorithm. Then this process is scheduled to run.
However, if there is only one process in ready queue, the same process is scheduled to run again. The specific variant of the two-level round robin scheme we will use is detailed below as part of the tasks.

4. What to do ?

Task 1:

Explain and code a simple main program to illustrate starvation in the existing XINU Scheduling algorithm. You need not submit the output of this code, but rather, a text document called "report.txt" with a written explanation of the method and the corresponding code, with an explaination of why your program simulates starvation.

Task 2: Implement Two-level Round Robin Scheme

As part of this task you will incorporate code to implement a a Two-level Round Robin Scheme. The following explains the scheme:

Each process is given a group name when it's created via create system call. Please adding an new argument after argument priority. The group name is a char array defined by users, which is similar as process name. And you could assume the group name is no more than 20 chars. Processes with the same group name belong to one group.
The scheduler chooses the process according to the algorithm above. And only processes in ready queue could be scheduled.
Process priority has no effect. All groups should be given equal importance and all ready processes in the same group should also be given equal importance
Newly created processes should be scheduled after all existing processes which are in the ready queue and belong to the same group.
Newly created group should be chosen after all existing groups.
When a new group or new process is created, you needn't reschedule processes immediately.
There are some default processes (main, null etc.) in XINU system. Please mark them with group name "SYSTEM PROCESS" and then they could be scheduled under our new scheduling policy.
The new algorithm should not replace the exisiting scheme. Rather, maintain a global flag as a boolean variable 'ROUND_ROBIN'. (Do not use #define) If ROUND_ROBIN = true, then the OS should follow Round Robin scheduling scheme. Else, it follows the original scheme. Note that the value of the variable will not change during run time.

Reference no: EM13304387

Questions Cloud

Accepts two int arguments and returns their sum : Assume the availability of a class named Arithmetic that provides a static method , add , that accepts two int arguments and returns their sum .
Utilizing supporting documentation obtained : Please provide a one page response to the following topic utilizing supporting documentation obtained from your textbooks and the Internet.
Decryption algorithm: reverse the encryption algorithm : Decryption algorithm: Reverse the encryption algorithm. The permutation, however, should (circular) shift the bit pattern by 1 bit to the right
An analysis of the security issues associated with batch fil : For this writing assignment you will be required to provide an analysis of the Security issues associated with batch files, Visual Basic and other forms of scripting.
The highest priority eligible to run will be scheduled : The XINU Operating System currently implements a Pre-emptive Priority Scheduling Algorithm. It follows the idea: 'At any point in time, the highest priority eligible to run will be scheduled'
Contrast, and summarize the most common procurement documen : Define, compare, contrast, and summarize the most common procurement documents used in industry.
Both the discussion and in the assignment tool : Post your response to the following questions in both the discussion and in the assignment tool. Name your assignment in the following manner: LastName_4A
Mechanism that supports process dispatching : The X25-Demodulator machine does not provide a mechanism for interrupts; any process in the X25 OS is non-preemptive. In addition, the OS does not provide a means for selecting the next job to run. Provide the design and justification for your..
The execution of the preceding two processes : Show all the possible interleaving of the execution of the preceding two processes.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  What ip range would an isp provide to a customer

Using the IP ranges below: a) What IP range would an ISP provide to a customer, if the customer wanted a range of Public IP's for use on theInternet? Explain your choice and why you feel the other choices are not adequate ?

  Function that finds the smallest element

Function that finds the smallest element in an array of double values using the following header: double min(double array[], int size)

  Class polygon which draws a hexagon for a set of numbers

Write a class Polygon which draws a hexagon for a set of numbers given by the user. You must only use method drawLine of class Graphics (other fill or draw methods won't be accepted).

  What are the modes

What are the modes, the conceptual models of transfer, the advantages, and the disadvantages of pass-by-value, pass-by-result, pass-by-value result, and pass-by-reference parameter-passing methods?

  Better software tool internet explorer or mozilla firefox

There are several Internet browsers available today, and many people select which to use without giving it consideration. Explain which is better software tool: Internet Explorer, Mozilla Firefox, or Google Chrome?

  Explaining gui differences and security differences

With that being said, its great that each of you pointed out the GUI differences. What about the Security differences?

  Indentify a network topology

indentify a network topology that would best suit each of the following environments and explain why: dormitory floor univeristy campus airport state of province

  Find the number of steps per revolution.

If a given stepper motor has a step angle of 5 degrees, find the number of steps per     Revolution.

  Secure protocol

Assume that Alice shares a secret s with her company's server computer.

  Related to web services

A review paper usually should include multiple (about 5) references. I would like to see references from referred conference proceedings or journals.

  Write a program using c language that converts gps cordinate

I want to write a simple program using C language that converts GPS coordinates between three different notational forms

  Write a scheme funtion that takes a list

Write a Scheme funtion that takes a list and an atom as parameters and returns a list identical to its parameter list except with all top level instances of the given atom deleted

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