Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Machine dispensing: the concept, opportunity, switching, process, methods and basic principles of dispensing

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

The concept of regulation 1. The basic concept of dispensing

In the multi-program bits and pieces, the number of processes is often more than the number of disposal machines, so it is inevitable that the process competes for the route machine. The dispatch of the disposal machine is to stop the dispatch of the disposal machine, that is, from the parking queue, select a process according to a certain algorithm (justice, efficiency) and assign the disposal machine to it to run, in order to complete the process concurrently.

The adjustment of disposal machine is the foundation of multi-program operation, and it is the central achievement of piecemeal design.

two。 The organization of dispensing

From the beginning of submission to the completion of an assignment, you often have to go through the following three levels of adjustment, as shown in figure 2-4.

1) homework adjustment. Also known as primary adjustment. The second obligation is to select one (or more) homework from the back-up form of external memory according to a certain criterion, assign it the necessary capital such as memory, output / input equipment, and set up a response process. to enable it (us) to gain the rights and interests of competitive disposal machines. In short, it is the adjustment between memory and auxiliary storage. About each lesson only transferred in once, transferred out once.

Most of the multi-batch disposal of bits and pieces are equipped with homework adjustment, while other bits and pieces do not need to set up equipment for homework adjustment. The frequency of homework adjustment is relatively low, usually every few minutes.

2) Intermediate adjustment. Also known as memory adjustment. Intermediate regulation is introduced to improve memory utilization and piecemeal throughput. For this reason, those processes that cannot be operated temporarily should be transferred to external storage to wait, and the process form at this time should be called hanging form. When they already have the operation premise and the memory has a little leisure, it is decided by the intermediate adjustment, and then retransfer the out-of-memory processes that already have the operation premise into the memory, and modify their shape to a stop form, hang on the stop queue and wait.

3) process adjustment. Also known as primary adjustment, the second obligation is to select a process from the parking queue and assign the disposal machine to it in accordance with a certain method and strategy. Process adjustment is the most fundamental adjustment in the operation of bits and pieces, and equipment must be set up in the ordinary operation. The frequency of process adjustment is very high, usually tens of milliseconds.

Figure 2-4 three-level dispensing of the disposal machine

3. Liaison of the third-level adjustment

Homework transfer from the external backup queue when a batch of homework is selected to enter the memory and a process is set up for them, these processes are sent to the stop queue, and the process adjustment selects a process from the stop queue, changes its shape to the running form, and assigns CPU to it. The intermediate adjustment is to improve the application rate of memory, suspending those processes that cannot be run temporarily. When the memory space is loose, through the intermediate adjustment to select the process with the premise of operation, wake it up.

1) the homework adjustment prepares for the process movement, the process adjustment makes the process move normally, the intermediate adjustment suspends the process that can not operate temporarily, and the intermediate adjustment is between the homework adjustment and the process adjustment.

2) the times of homework adjustment are less, the times of intermediate adjustment are slightly more, and the frequency of process adjustment is the highest.

3) process adjustment is the most fundamental, full success or lack.

The opportunity, switch and process of adjustment

Process tuning and switching programs operate piecemeal kernel programs. When the request for adjustment occurs, the process adjustment program can be run, and when the new stop process is adjusted, the switching between processes will be stopped. In fact, these three tasks should be carried out in order, but in practical design, if there are some elements that cause process adjustment during the operation of piecemeal kernel programs, the adjustment and switching can be stopped immediately.

In the ancient operation, the adjustment and switching of the process can not be stopped in the following situations.

1) in the process of infix disposal: the process of infix disposal is complex, so it is difficult to switch the process, and infix disposal is a part of piecemeal tasks, which logically does not belong to a certain process, and should not be deprived of disposal machine capital.

2) the process is in the critical area of operating piecemeal kernel programs: after entering the critical area, it is required to visit the shared data uniquely, in fact, it must be locked to prevent other parallel programs from entering, and should not be switched to other processes before unlocking to slow down the release of the shared data.

3) other atomic operations requiring complete barrier suffix, such as locking, unlocking, infix on-site maintenance, recovery and other atomic operations. In the atomic process, even the infix should be blocked, let alone stop the process adjustment and switching.

If the premise of causing adjustment occurs in the above-mentioned process, you can't stop the adjustment and switching immediately, you should place a piecemeal request for adjustment mark, and you won't stop responding to the adjustment and switching until the above-mentioned process is over.

The situations in which the process adjustment and switching should be stopped are:

The main results are as follows: 1) when the attack causes the premise of adjustment, and the later process can not continue to operate continuously, the adjustment and switching can be stopped immediately. If the operation is piecemeal only in this situation to stop the process adjustment, the length of the adjustment.

2) after the side break disposal or self-trapping disposal is completed, before going to the user mode program of the infix process to perform on the site, if the request for adjustment mark is placed, the process adjustment and switching can be stopped immediately. If you operate the operation adjustment procedure in this condition, the adjustment of the deprivation method will be completed.

Process switching often occurs immediately after the completion of the transfer, and it requests to keep the on-site information of the switching point after the original process and restore the on-site information of the transferred process. When switching on the spot, the operation of the piecemeal kernel pushes the field information of the original process to the kernel inn of the later process to keep them, and update the inn pointer. After the kernel finishes loading the field information of the new process into the kernel stack of the re-process, updating the running process space pointer, resetting the PC memory and other related tasks, the kernel starts to run the new process.

Process adjustment method

The so-called process adjustment method means that when a process is being performed on the disposal machine, if there is a more important or urgent process requirement disposal, that is, the priority process enters the parking queue, how to assign the disposal machine at this time.

On weekdays, there are two methods of process regulation:

1) non-preemptive adjustment method, also known as non-preemptive method. It means that when a process is being performed on the disposal machine, even if a more important or urgent process enters the stop queue, the process being performed continues to be performed until the process is completed or something happens and enters the form of congestion. The disposal machine is not assigned to a more primary or urgent process.

Under the non-deprivation adjustment method, once the CPU is assigned to a process, the process persists with the CPU until it terminates or transitions to the waiting form. The advantage of this method is to complete complex, small piecemeal expenses, and is practical for most batch disposal of bits and pieces, but it can not be used for time-sharing bits and pieces and most of them in time.

2) deprivation adjustment method, also known as preemption method. When a process is being performed on the disposal machine, if a more major or urgent process requires the use of the disposal machine, immediately suspend the ongoing process and assign the disposal machine to the more primary or urgent process. .

The use of deprivation adjustment is of clear benefit to the improvement of piecemeal throughput and echo effectiveness. However, "deprivation" is not a kind of arbitrary action, which must follow certain criteria, such as priority, short process priority and time chip criterion.

The basic principle of regulation

The divergent adjustment algorithm has different characteristics, so it is necessary to consider the characteristics of the algorithm when choosing the adjustment algorithm. In order to compare the functions of the processor adjustment algorithm, many evaluation principles have been proposed. Here are some minor ones:

1) CPU application rate. CPU is one of the most important and expensive capital in computer bits and pieces, so we should try our best to make CPU adhere to the "busy" form and make the application rate of this capital the least.

2) piecemeal throughput. Show the number of assignments completed by CPU in the unit time. Long homework requires longer processing time, which reduces piecemeal throughput. As for short homework, they require less processing time, so they can improve piecemeal throughput. Differences in regulation algorithms and methods will also have a great impact on piecemeal throughput.

3) turnover time. It refers to the experience from homework submission to homework completion, including the sum of the time spent waiting for homework, queuing in a stop queue, running on the processor, and stopping output / input operations.

The turnover time of homework can be expressed in the following formula:

Turnover time = homework completion time-homework submission time

Uniform turnaround time refers to the average value of multiple homework turnover time:

Average turnaround time = (turnover time of lesson 1 + … + turnover time of homework n) / n

Weighted turnover time refers to the ratio of homework turnover time to homework practice work time:

Uniform weighted turnover time refers to the average value of multiple homework weighted turnover time:

Uniform weighted turnover time = (exercise 1 weighted turnover time + … + weighted turnover time of homework n) / n

4) wait for time. It means that the process is in the sum of the time of the equal disposal machine, and the longer the waiting time, the lower the satisfaction of the user. In practice, the dispatching algorithm of the disposal machine does not affect the time of homework performance or output / input operation, but only the time spent waiting in the parked queue. As a result, weighing the quality of a regulation algorithm often requires only a complex investigation and waiting time.

5) echo time. It refers to the time it takes from the time the user submits the request to the first occurrence of the piecemeal response. In interactive bits and pieces, turnaround time is the best evaluation principle, and echo time is generally used as one of the main principles to weigh the adjustment algorithm. From the user's point of view, the adjustment strategy should reduce the response time as far as possible, so that the response time is within the scale that the user can bear.

It is impossible to lose an algorithm that satisfies all users and piecemeal requests. To design a mediation program, on the one hand, you should be satisfied with the requests of specific piecemeal users (such as some timely and interactive processes that respond quickly to requests), and on the other hand, you should consider the effectiveness of piecemeal totals (such as increasing the uniform turnaround time of all piecemeal processes). At the same time, we also need to think about the cost of the adjustment algorithm.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report