I am studying for my OS midterm and I have a question in the study guide that I am not 100% sure about.
The scheduler exists to:
A. Service interrupts.
B. Select the next process to enter the CPU.
C. Create a new process.
D. Remove unused processes from the system.
E. Determine which blocked processes can enter the CPU.
F. B and E.
So I know B (Select the next process to enter the CPU) is true.
The part that I am not sure about is the E option. I am not sure what this actually means.
Does this actually imply the case where, say after scanf
, user input is expected, and the process remains blocked ?
Does waiting for that input actually means determining ? Or is the scheduler actively involved determining whether that input is entered ?
How would you answer this question? B or F?
If you look at the process states carefully you will notice that a blocked process can never enter a CPU directly. Its only when a process has entered the ready state, it can enter the CPU to be executed.
When a process is in blocked/waiting state it is basically waiting either for an external event like input from user or waiting in some I/O device queue for some I/O service. Now once that event occurs it will go to ready state and the scheduler(short term scheduler to be precise) job is to decide which process to pick out of those that are in ready state. So statement E is wrong.