Multi-channel program

1. Concept

program is a strict ordered instruction set in time. It monitors all resources in the system, including CPU, memory, peripherals, and software, etc., without other competitors compete with it. Therefore, in a single CPU computer system, only one program is running for a while. The program exclusively has all the resources of the computer, and does not have external impact

computer's early, multitasking is called multi-channel programs. Multi-channel programs refer to the CPU read multiple programs in memory, first run the first program until it has an IO operation. Because the IO operation is slow, the CPU needs to wait. In order to improve the CPU utilization, the second program is run. That is, the condition that the Nth + 1 program is executed is the nth program for IO operation or has been run. In this way, the time assignment of each program is unequal, and it is likely that the first program runs several hours without the IO operation, so the second program is not running. In the original, this situation is acceptable. People have specified running multiple programs at a time, and after a few hours or a day later, run the result or take away the document. People do not need to get the operation of each program in real time, only care about the results.

Multitasking is the ability to run multiple programs at the same time. The general method of multitasking is to run a piece of code for the first program, save the work environment; run a piece of code for the second program, save the environment; ... Restore the first program's working environment, execute the first program A code ... Modern multitasking, the time allocation of each program is relatively average.

The fundamental purpose of introducing multi-channel programming technology is to improve the utilization of the CPU, and give full play to the parallelism of computer system components, and modern computer systems use multi-channel programming technology. The emergence of multi-channel programming has accelerated the birth of the current operating system.

2. Features

1) Multi-channel: that is, a few separate procedures are stored simultaneously in the computer memory.

2) Macro Parallel: Also in the operation of entering the system is in operation, that is, they have started their operation, but they have not run.

3) Micro-serial: From a microscopic view, the multi-channel program in the memory is turned from the CPU in turn.

3. Advantages

Improve the utilization of the CPU. In a multi-channel program environment, multiple programs share computer resources When a program waits for I / O operation, the CPU can perform other programs to greatly improve the Utilization of the CPU.

Improve the utilization of the equipment. In a multi-channel program environment, multiple program sharing systems, greatly improve the utilization of system equipment.

Improve the throughput of the system. In a multi-channel program environment, the wait time of the program is reduced, and the system's throughput is improved.

4. Scheduling

Multi-channel processing can be loaded in the memory, and when a program is waiting for external transmission without working, the central processing machine can immediately To perform another program, if the second program cannot continue to execute for some reason, the central process will execute the third program so that the first program is executed after the first program is transmitted. The reasonable matching of multi-channel procedures can improve the utilization of resources and enhance the input and output capabilities of the system. Multi-channel procedures are carried out in a pseudo-parallel way. From a time interval, each program has started executing, but it has not been executed. From a moment, only one program is executed in the central processing machine, each program holds a time film, alternately, serial, serial using a central processing machine. Each program does not end in the order they begin.

Multi-channel sharing processing system's various resources, but the system has limited resources, and each program requires the number and species of resources. Therefore, the scheduling of multi-channel programs is different depending on each program. Resource requirements use the following strategies: 1 Let's first serve, build a backup queue in order, and scan the backup queue from the header, find the first resource to get the program, and insert it into the current queue waiting to execute. 2 According to the priority scheduling, the system selects the highest priority program execution. The priority number of the program can be specified by the user (the system charges a higher priority program), and can also be determined by the system (the system is based on the wait time of the program, the length of the runtime, and the amount of time required to require system resources). This priority can be determined when the program enters the system, or it can be calculated at each program schedule. In the same priority program, it is still scheduled to serve first. 3 Equilibrium scheduling, classify the program according to its own characteristics, such as the Class A is the program when entering the output fee, the class B is the program of input and output and operational time equalization, Class C is the program. The program scheduling program will select a running program from these different types of programs to make the resource to obtain a balanced utilization, play system efficiency and satisfy the user.

As shown in the figure, the execution of a single program and a multi-channel program is listed, and it can be seen that the multi-channel program can greatly improve the resource utilization of the system.

Related Articles
TOP