After doing this we will decrease the burst time of the process by 1 in each cycle of the time. ![]() ![]() In each cycle we will find the process which have highest priority(lowest priority number like 1 have high priority than 2) and arrived at time t and burst time of the process is not equal to zero.for checking how many processes are completed we use coun t .Initially it's value is 0 (i.e no processes are completed yet). In this code we are going to use a loop which executed until all the processes are completed.and we will use 9th process because we assumed that there will not be more than 10 process but you can use any number. we initialize the priority of a process with the maximum (you can take any maximum value).(If you confused then don't worry you will be able understand after going through code) First we copy the burst time of the process in a new array temp because in the further calculation we will be going to decrease the Burst time of the process but we will have to need the real burst time of the process in the calculation of the waiting time.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |