Long-term scheduling, medium-term scheduling, short-term scheduling

About what the three of them are and what is the difference, there are many blogs on the Internet, such as this: https://blog.csdn.net/u013007900/article/details/50550415

Here I mainly talk about my own understanding as a beginner:

long-term scheduling

This is for a batch system, there are a bunch of processes to be executed, first the system will know that these processes are going to be executed. At this time, the system only knows which processes are going to be executed, rather than executing them immediately, which means that these processes have no "power" to execute (this is just an example, and it has nothing to do with file permissions). At this time, the long-term scheduler selects one or a batch of them, loads them into memory, and waits for execution. At this time, the selected process has the "power" to execute, and it is time to wait for the right time and place (system resource allocation).

short-term scheduling

For those processes that have the "power" to execute, the short-term scheduler allocates CPU resources to them, and the program is officially executed only when the "time and place is right"

Mid-term scheduling

This involves the concept of interruption. Interruption means that the A process is executing, and the B process also needs to be executed immediately, then the A program needs to be interrupted, and when the B process execution ends, the A process resumes execution from the place where it was interrupted. For example, you are playing music, then open a video, the music will automatically pause, you hear the sound of the video, after the video is finished, exit the video interface, and then the music will resume automatically (in any case, my mobile phone is often like this ), it can be understood that the music process is interrupted, the video process is executed for a wave, and after the video process ends, the music process continues.

After the interruption is finished, the mid-term scheduling is almost finished, because the mid-term scheduling controls a process similar to this.

I don't know if my understanding is wrong. I will come back and update when I have a new understanding.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326115155&siteId=291194637