CPU scheduling algorithm in bash script shell
Budget: $10 – $30 USD
You will write a shell script that will accept the number of process in queue and the CPU burst for each of the processes. It should allow user to select the option form the menu for the scheduling algorithm to be used. It should display the order in which the processes will be scheduled and the start time for each process and the average wait time for the processes. The tasks should be accomplished using arrays and at least two user defined functions.
Below is an example of how your program should interact with the user.
For example
No of processes : 4
CPU burst Time for processes in nano second
5 3 7 6
It will display the following CPU scheduling options to the user
1. Shortest Job First
2. Round Robin
If user chooses option1
Output for the given example will be
Scheduling order: P2 P1 P4 P3
Start time for each process: 0 3 8 14
Average wait time : (0+3+8+14)/4 = 25/4=6
If user chooses option2
Enter the quantum time: 4
Output for the given example will be
Scheduling order: P1 P2 P3 P4 P1 P3 P4
Start time for each process: 0 4 7 11 15 16 19
Average first service time : ( 0+ 4+7+11) /4 = 22/4= 5
*It should work on ubuntu
*You may add average wait time and turn-around time too.
Below is an example of how your program should interact with the user.
For example
No of processes : 4
CPU burst Time for processes in nano second
5 3 7 6
It will display the following CPU scheduling options to the user
1. Shortest Job First
2. Round Robin
If user chooses option1
Output for the given example will be
Scheduling order: P2 P1 P4 P3
Start time for each process: 0 3 8 14
Average wait time : (0+3+8+14)/4 = 25/4=6
If user chooses option2
Enter the quantum time: 4
Output for the given example will be
Scheduling order: P1 P2 P3 P4 P1 P3 P4
Start time for each process: 0 4 7 11 15 16 19
Average first service time : ( 0+ 4+7+11) /4 = 22/4= 5
*It should work on ubuntu
*You may add average wait time and turn-around time too.