0
$\begingroup$

I'm trying to know what is the exact function in medium term scheduler in operating systems.

As far my understanding, a process may be needed to be removed from the running queue when it is faced with an I/O request. So it is usually sent to blocked list which is also situated in the main memory. Medium term scheduler is responsible for this.

enter image description here

It's all good till here, but it is confusing in the next part. I looked up the function for medium term scheduler, and it says that it suspends any processes which receives I/O request and are sent to secondary memory in the process of swapping.

So the process is totally removed from the main memory, as opposed to moving it to blocked state within the Main memory. So is MTS really responsible for moving processes from running state to suspension in case of I/O requests or someone else is responsible for it?

$\endgroup$
1
  • $\begingroup$ Note that this is a pretty old diagram. Since the end of the 20th century, every Operating System works by scheduling threads, not processes. Also, asynchronous I/O means that I/O requests do not remove the thread from the running queue. $\endgroup$
    – MSalters
    Commented Oct 12, 2023 at 12:33

1 Answer 1

0
$\begingroup$

Before I try to explain your question, I need to make a few observations:

  1. You claim that: "a process may be needed to be removed from the running queue when it is faced with an I/O request", not only, when a process is running, one of the following events can occur: the process issues an I/O request and then is inserted into an I/O queue; the process creates a new child process and waits for it to finish; or the process may be forcibly removed from the CPU as a result of an interrupt and placed in the ready queue.
  2. "So it is usually sent to blocked list", no. The process moves from the waiting state to the ready state and is then returned to the ready queue.

Well, it is often advantageous to remove a process from memory and consequently from the "dispute" for the CPU, in order to reduce the degree of multiprogramming. Of course, later on, the process can be reintroduced into memory and its execution can resume where it left off, this is done by the medium-term scheduler and is called swapping. Swapping may be necessary to improve process mixing or because a change in memory requirements has overloaded available memory and must be freed. This permutation makes it possible for the space of physical addressing of all processes exceeds the actual physical memory of the system.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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