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
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.
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.
Operating System Concepts by Silberschatz, Galvin, Gagne. Pages 157 to 170
For more details, mail to, abhilash@cse.iitm.ernet.in