Process and process scheduling takes precedence

Source: Internet
Author: User

Here, let's talk about the process:

Process is a computer program on a data set on a running activity, the system is the basic unit of resource allocation and scheduling, is the basis of the operating system structure. In the early process design-oriented computer architecture, the process is the basic execution entity of the program, and in the contemporary thread-oriented computer architecture, the process is the container of the thread. A program is a description of instructions, data, and its organization, and the process is the entity of the program. --Baidu Encyclopedia

We might as well take the process as a unit, the unit has a lot of properties, of course, each process must have priority, process priority is based on a certain algorithm, the computer according to the nature of the process or its length, or by the source of the job, etc., to specify its priority.

Each process has a corresponding priority, and the priority determines when it will run and how much CPU time it receives. The final priority is a total of 32 levels, which is a value from 0 to 31, called the base priority level. System according to different priority scheduling process operation, level 0-15 is the normal priority, the priority of the process can be changed dynamically, high priority process first run, only the high priority process is not running, the low priority process is scheduled to run, the same priority process according to the time slice rotation 16-31 is the real-time priority, The biggest difference between the real-time priority and the normal priority is that the same priority process runs in real-time priority without rotating the time slice, but the process running first controls the CPU, and if it does not actively abandon the control, the peers or low-priority processes cannot run.

The process is divided into 3 states: Ready, the process has obtained the required resources in addition to the processor, waits for the allocation of processor resources, as long as the processor process is assigned to execute, running state (Running), the process consumes processor resources, the number of processes in this state is less than or equal to the number of processors , blocking state (Blocked), because the process waits for a certain condition (such as an I/O operation or process synchronization), cannot continue execution until the condition is satisfied, even if the processor resource is assigned to the process before the event occurs.

3 states can switch to each other according to a certain mechanism and trigger conditions.

The computer puts all the ready-state processes in a ready queue, and when our processor finishes a processing preparation for the next processing, it uses a scheduling mechanism to dispatch the next process into the processor.

Then the computer is based on what kind of mechanism or algorithm to go to the scheduling process to enter the processing machine (scheduling algorithms are various, according to different needs to take different methods, I would like to say more representative)?

In batch processing system, more is the FIFO algorithm (Fifo,first in first out) and the short process first algorithm (Sjf,shortest Job). The time-slice rotation algorithm (Rr,round Robin) is used more than in the timeshare system. The specific implementation process of the algorithm itself Baidu.

These algorithms assign priority to processes in the ready queue based on their algorithmic characteristics, which is what we call the process scheduling priority. These algorithms are based on the priority of the process, and then the appropriate debugging according to their own algorithm characteristics.

In this way, we take different scheduling methods to achieve the desired results in different situations.

This article is from the "Sevenot" blog, make sure to keep this source

Process and process scheduling takes precedence

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.