user1784297
user1784297

Reputation: 105

CPU scheduling algorithms and arrival time

I was looking at the examples found on http://www.tutorialspoint.com/operating_system/os_process_scheduling_algorithms.htm

And there's something that just doesn't make sense about those examples. Take shortest-job-first for example. The premise is that you take the process with the least execution time and run that first.

The example runs p1 first and then p0. But WHY? At t = 0 the only process that exists in the queue is p0. Wouldn't that start running at t = 0, and then p1 would start at t = 6?

I've got the same issue with priority based scheduling.

Upvotes: 0

Views: 385

Answers (2)

Yunus
Yunus

Reputation: 84

I have this implementation name ALeXSim-USAS where you can use to analyze different scenarios for different algorithms. But only to verify the result / answer from your manual calculation i.e. in learning scheduling algorithm. I'm not saying the tool is the best but enough to fulfill this purpose.

https://alexsim-system.blogspot.com/

For example, the issue of SJF on the scenario can be verified with the following results

Details of SJF result

enter image description here

Upvotes: 2

Mushrit Shabnam
Mushrit Shabnam

Reputation: 176

you are right , since the process P0 has arrived at the queue at 0 sec and before P1 , it will start executing before P1 .

Their answer would be correct if there was no arrival time for the corresponding process and in that case , it is considered that all the processes have reached at the queue at the same time .So, the process with shortest executing time will be executed by CPU first .

Upvotes: 2

Related Questions