-3
$\begingroup$

Let's say we have 3 processes:

  • Process 1 service time 6 arrival time 0
  • Process 2 service time 2 arrival time 1
  • Process 3 service time 5 arrival time 3

We know that:

  • after 1 time, process 2 will come and process 1 will go back having 5 service time left.

  • then process 3 will come, after process 2 ends, at 3 time.

Now the conflict is:

Since process 1 and process 3 have equal service time - which one gets service time first?

$\endgroup$
  • 2
    $\begingroup$ Have you copy-pasted a table here? Please take more care with language and formatting; I find it hard to tell what you are asking. Community votes, please! Is this unclear? $\endgroup$ – Raphael Feb 1 '16 at 15:28
  • $\begingroup$ @Raphael - It sort of makes sense: As process 1 was pushed into the background (with 5 service time slots remaining) while process 2 was being serviced, then (at time slot 3) as process 3 also requires 5 service slots, which process has precedence, process1 or process 3..? $\endgroup$ – Greenonline Feb 1 '16 at 16:23
  • 2
    $\begingroup$ It would help if you could edit the post to use full sentences. I don't know what "Process 1 service time 6 arrival time 0" means. I also don't know what "at 3 time" means. Thank you! $\endgroup$ – D.W. Feb 1 '16 at 16:55
1
$\begingroup$

This really depends on the scheduling algorithm. Most of the scheduling algorithms will decide arbitrary. I assume that you are talking about shortest-job-first. SJF will schedule arbitrarily.

The real life scheduling algorithms are round-robin as we usually do not know the completion time. And they usually want to give a quick response to a new job. These algorithms will schedule process 3.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.