OBJECTIVE (AIM) OF THE EXPERIMENT
To write a ‘C’ program to perform priority scheduling.
FACILITIES REQUIRED AND PROCEDURE
a) Facilities required to do the experiment:
Sl.No. Facilities required Quantity
1 System 1
2 Tel net, UNIX OS -
b) Procedure for doing the experiment:
Step
no. Details of the step
1 Start the program.
2 Read burst time, waiting time, turn the around time and priority.
3 Initialize the waiting time for process 1 and 0.
4 Based up on the priority process are arranged.
5 The waiting time for other processes are calculated based on priority.
6 The waiting time of all the processes is summed and then the average waiting time is
calculated.
7 The waiting time of each process and average waiting time are displayed based on the
priority.
8 Stop the program.
Output:
enter the no of process:3
enter the burst time:2
enter the priority:3
enter the burst time:4
enter the priority:1
enter the burst time:6
enter the priority:2
process to bt wt tt
1 4 0 4 4
OBJECTIVE (AIM) OF THE EXPERIMENT
To write a program to implement cpu scheduling for Round Robin Scheduling.
FACILITIES REQUIRED AND PROCEDURE
a) Facilities required to do the experiment:
Sl.No. Facilities required Quantity
1 System 1
2 Tel net, UNIX OS -
b) Procedure for doing the experiment:
Step
no. Details of the step
1 Get the number of process and their burst time.
2 Initialize the array for Round Robin circular queue as ‘0’.
3 The burst time of each process is divided by quantum and the quotients are stored on the round
robin array.
4 According to the array value the waiting time for each process and the average time
are calculated as like the other scheduling.
5 The waiting time for each process and average times are displayed.
6 Stop the program.
Output:
enter the no of process3
enter the burst time3
enter the burst time5
enter the burst time7
enter the time slice: 2
process id wt tt
1 0 2
2 2 4
3 4 6
1 6 7
2 7 9
3 9 11
2 11 12
3 12 14
3 14 15
avg waiting time: 21.666666
avg turnaround time: 26.666666