Priority Based Scheduling

 

 

 

Introduction: CPU scheduling is the process of scheduling the CPU to the jobs present in the memory. The CPU scheduler selects among the processes in memory that are ready to execute and allocates the CPU to one of them.

 

The following are different CPU scheduling algorithms

 

1.First Come First Serve

2.Shortest Job First

3.Priority Scheduling

4.Round Robin scheduling

5.Multilevel Queue Scheduling

6.Multilevel Feedback Queue Scheduling

7Multiple-Processor Scheduling

 

Objective: To demonstrate the preemptive priority based scheduling algorithm

 

Description: -The project can be described as following

 

 Consider there are three processes (programs), each are associated with certain priority (integer). Each process will try to access a file (basically write into a file) and use it for certain amount of time. Depending on the priority and the time at which they have arrived, they should be given access to the file. Preemption is allowed i.e. if the file has been given to a process and during its execution if another process of higher priority asks for the file, then the process with lower priority must be preempted and the file should be given to the new higher priority process.

 

Preemption will do the following

1. Save the data written by the process into the file.

2. Place the process at the end of the queue (only if the required time of the process is not completed).

3. Give the access of the file to the higher priority process

 

Write a program to handle the requests of three processes, and schedule them properly. Use priority queues.

 

Input: - A file containing the information about different processes. The information will be of the form

 

<Process id, Arrival Time, Burst Time, Priority>

Click here to download a sample input file

 

Output: - Each process should be given access to the file according to the algorithm described. When a process is given access to the file it write its information (process id, Arrival time, Burst time, priority) into the file.

 

The final data in the file will be checked to evaluate your assignment.

 

References: -

 

For more information on the scheduling algorithms refer to the following

 

Operating System Concepts by Silberschatz, Galvin, Gagne. Pages 157 to 170

 

 

For more details, mail to, abhilash@cse.iitm.ernet.in