![]() At ( t = 10ms ), P1 gets executed till it finishes.At ( t = 7ms ),P4 gets executed for 3ms.As ,P2 and P4 have same time, so the task which came first will be executed first. Now, remaining tasks are P1 = 5ms, P2 = 3ms, P4 = 3ms. Since P4 does not have short burst time, so P3 continues to execute. At ( t = 3ms ), P4 comes, At this time, P1 = 5ms, P2 = 3ms, P3 = 1ms, P4 = 3ms.Since P3 is having least burst time, P3 is executed. At this time, P1(remaining time) = 5ms, P2(remaining time ) = 3 ms, P3 = 2ms. At ( t = 2ms ), P3 process has arrived.P2 has 4ms, so as P2 is shorter, P1 is preempted and P2 process starts executing. At this time, P1 (remaining time ) = 5 ms. ![]() It’s the only process so CPU starts executing it. The order in which the CPU processes the process are (Gantt Chart) – Let’s understand SJF Scheduling with the help of an example. Note – If 2 processes have same execution time, then jobs are based on First Come First Serve Basis.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |