1
$\begingroup$

I understand that CPU scheduling takes place on 4 circumstances listed below:

  1. When the process changes state from Running to Ready
  2. Changes state from Running to Waiting
  3. Changes state from Waiting to Ready
  4. Process Terminates

However, i notice that the CPU scheduling does not take place when Ready to running. Why is this so?

$\endgroup$
2
$\begingroup$

The only way that a process can go from "ready" to "running" is if the scheduler just scheduled it. Running the scheduler as soon as the process started running would mean that you'd actually be running the scheduler the whole time.

$\endgroup$
1
$\begingroup$

If a process is "ready", that implies that it is ready to get scheduled (and thus executed or "run"). And only if a process is "ready", it gets scheduled.

And in what ever order the processes get scheduled, they are supposed to "run" (get executed by the CPU) in that order itself. That is the fundamental notion of scheduling processes which are "ready" to be "run" on the CPU.

I suggest, you go through, Operating System Concepts, Galvin et al. ( Ch. 5 - CPU scheduling -> 5.1.3 Preemptive Scheduling).

$\endgroup$
1
$\begingroup$

When a process moves from running to ready, to waiting, or to finished, it just lost the use of the CPU, a CPU is free and the scheduler has to select a new process to run.

When the scheduler selects the next process to run, it picks it from the ones in ready to move to running. It is part of the scheduling process, it doesn't trigger it's running.

$\endgroup$
0
$\begingroup$

when you say a process is ready it means that it is in prime condition to be scheduled by the processor and go into the running state.

once it goes into the running state it can either go to the wait/sleep/termination,and from the wait/sleep it can go to the ready state again or as the first condition displays jump directly from the running to ready queue in case there is a FIFO or a rate monotonic scheduling.

so yes...it all depends upon the scheduler scheme...but as far as your question goes as to why there is no scheduling from the Ready->Running states..the scheduler assembles the process queue as per a scheduling algorithm and then the processor is free to execute them from the queue as the come one by one i.e like the basic of how it works.

$\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.