TripleAvian
TripleAvian

Reputation: 49

basic CPU scheduling "waiting to ready"

Is waiting to ready in scheduling counted as preemptive or non-preemptive?

At first I thought it was non-preemptive because it involve IO or event to be done before it can switch, however my friend told me that it is preemptive because it need to give back resource when it switch to ready.

So which one is the correct interpretation in this case?

Upvotes: 3

Views: 991

Answers (1)

Am_I_Helpful
Am_I_Helpful

Reputation: 19178

It is the duty of every process to release the resources after the completion of the event/task, even when no other process requires that particular resource(s). It has nothing to do with preemption.

In general it depends on the priority of the process scheduled which decides whether it is preemptive or not. The particular stage is not defined as preemptive/non-premeptive.

It depends --- If the process is preemptive, it won't wait for any longer to get scheduled. It will snatch the chance from other lower-priority process. If the process is having lower priority/non-preemptive, then it will keep on waiting for the resources to release and then complete the event and then get dispatched through the scheduler.

Waiting - The process cannot run at the moment, because it is waiting for some resource to become available or for some event to occur. For example the process may be waiting for keyboard input, disk access request, inter-process messages, a timer to go off, or a child process to finish.

enter image description here

Upvotes: 1

Related Questions