The concept of dispensing 1. The fundamental concept of dispensing
In the multi-channel program fragmented, the number of processes is often more than the number of machines, the process of the situation of the use of the machine is unavoidable. The disposition machine transfers is to the disposition machine to stop assigns, is from the queue, according to the certain algorithm (fair, GAO Efficiency) chooses a process and assigns the disposition machine to it to run, completes the process to carry on concurrently to fulfill.
The disposition machine transfers is the multi-channel procedure Operation Fragmentary Foundation, it is the operation fragmentary design central result.
2. Arrangement of transfers
a lesson from the beginning of submission to completion, often to experience the following three levels of adjustment, 2-4 shows.
1) Homework transfers. Also known as the primary transfer,. Secondly, the obligation is to select one (or more) lessons from the external memory on the basis of a certain criterion and give it the necessary capital to allocate memory, output/input equipment, etc., and establish a response process so that it can obtain the rights and interests of the competition machine. In short, it is the transfer between memory and secondary storage. About each lesson only to be transferred once, call up once.
multi-channel batch disposal is mostly equipped with homework transfers, and other piecemeal in the weekdays do not need to set up equipment assignments. Homework transfers are performed at a lower frequency and weekdays are a few minutes.
2) Intermediate dispensing. Also known as memory transfers. Intermediate transfers are introduced to improve memory application rates and fragmented throughput. To this end, should be the temporary means of operation of the process, transferred to external memory wait, the process at this time is called the form of suspension. When they have a running premise and memory and a little leisure, by the intermediate transfer to the resolution, the external memory on those already have the operation of the premise of the process, and then re-transfer into the memory, and modify its shape as the ready form, hanging in the queue waiting.
3) Process transfers. Also known as the primary transfer, its secondary obligation is to follow a certain method and strategy from the queue to be elected a process, the disposition machine assigned to it. Process transfer is the most fundamental of the operation of a diversion, in the ordinary operation of the fragmented must set the equipment arrangement process. The frequency of process transfers is very high, normally dozens of milliseconds at a time.
650) this.width=650; "src=" http://c.biancheng.net/cpp/uploads/allimg/140629/1-140629144600329.jpg "style=" border : 0px;width:550px;height:305px; "/>
Figure 2-4 Three-level dispensing of the disposal machine
3. Contact for Level three transfers
assignments from the external memory reserve queue when selecting a batch of lessons into memory, set up the process for them, these processes are fed into the queue, process transfers from the queued queue to a process, and change its shape into a running form, the CPU assigned to it. Intermediate dispensing is in order to improve the application of memory, piecemeal will those temporary means of operation of the process hang up. When the memory space is loose, after intermediate dispensing selection has the operation premise process, wakes it up.
1) Homework transfer for the process of preparation, process adjustment so that the process of normal movement up, intermediate transfers will temporarily not run the process of hanging, intermediate dispensing in the transfer of homework and the process of adjustment between.
2) The number of homework transfers less, intermediate transfers a little more, the process of the highest frequency.
3) Process dispensing is the most fundamental, impossible or missing.
Opportunities, transitions and processes of dispensing
process dispensing and switching procedures are operations of fragmented kernel programs. When the appeal of the transfer of things after the seizure, only to be able to operate the process of dispensing procedures, when the adjustment of the new process, will be to stop the process between the switch. In fact, these three pieces of work should be performed sequentially, but in the practice of design, in the operation of the fragmented kernel program operation, if a certain time attack caused the process to adjust the elements, and the differences can immediately stop dispensing and switching.
in the ancient operation of fragmentary, cannot stop the process of dispensing and switching condition has the following several conditions.
1) in the process of dealing with infix: infix process Complex, in the completion of the process is difficult to switch, and infix disposition is a part of the piecemeal task, the logic does not belong to a process, should not be deprived of the disposal machine capital.
2) The process in the operation of the critical section of the kernel program: After entering the critical section, the demand is unique to the sharing of data, it is necessary to lock, in order to avoid other parallel programs to enter, before unlocking should not switch to other processes to operate, to slow down the release of the shared data.
3) Other requirements complete barrier infix atomic operation process: such as locking, unlock, infix on-site maintenance, recovery and other atomic operations. In the atomic process, even infix to the barrier, but should not stop the process of dispensing and switching.
if in the process of the seizure of the premise of the adjustment, not to stop the transfer and switching, should be placed piecemeal pleading dispensing mark, until the completion of the above process to stop the response to adjust and switch.
the conditions in which the process transfers and transitions should be stopped are:
1) When the seizure caused by the premise of the adjustment, and the subsequent process can not continue to operate, you may immediately stop dispensing and switching. If the operation of fragmented only in this situation to stop the process of dispensing, the length of the deprivation of dispensing.
2) Near the end of the disposal or self-trapping after the completion of the process to be infix user program to perform the scene, if the request to adjust the mark, you can immediately stop the process of dispensing and switching. If the operation piecemeal support the operation of the process of dispensing procedures, the deprivation method is completed.
process switching often occurs immediately after the transfer, it requests to keep the original process after the switching point of the site information, restore the site information of the dispensing process. On-site switching, the operating fragmented kernel pushes the field information of the original process into the Kernel Inn of the later process to keep them, and updates the inn pointer. After the kernel completes the re-process of the kernel stack to fill in the new process of the field information, updated after the operation of the space pointer, resetting the PC storage and other coherent tasks, the beginning of a new process of operation.
Process Dispensing Methods
the so-called process transfer method refers to when a process is being disposed of on-machine performance, if there is a more major or urgent process needs disposal, that is, higher priority of the process into the queue, at this time how to dispatch the disposal machine.
On weekdays, there are two ways to adjust the process:
1) Non-deprivation dispensing method, also known as non-preemption method. When a process is being performed on a machine, the machine is assigned to a more major or urgent process even if there is a more major or urgent process going into the queue, allowing the process to be fulfilled continuously until the process completes or attacks something and enters the congestion pattern.
in the non-deprivation dispensing method, once the CPU is assigned to a process, the process persists until the CPU is terminated or converted to a waiting pattern. The advantage of this method is the completion of complex, piecemeal expenditure small, in fact, for most of the batch disposal piecemeal, but it cannot be used for time-sharing and most of the most fragmented.
2) Deprivation of dispensing method, also known as Preemption method. When a process is being performed on a machine, if there is a more major or urgent process requirement to use the machine, immediately suspend the process being fulfilled and assign the machine to this more major or urgent process.
The use of the deprivation of the transfer, the progress of fragmented throughput rates and the effectiveness of the response have distinct benefits. But "deprivation" is not a wanton action, must follow the necessary criteria, secondary to: priority, short process priority and time slice criterion.
The fundamental principle of dispensing
The differences of the dispensing algorithm have different characteristics, in the selection of dispensing algorithm, it is necessary to think about the characteristics of the algorithm. In order to compare the function of the machine dispensing algorithm, people put forward many evaluation principles, the following introduces several minor:
1) CPU application rate. CPU is one of the most important and expensive in the computer fragmentation, so should be able to make the CPU stick to the "busy" pattern, so that the highest rate of capital application.
2) Fragmented throughput. The amount of time the CPU completes the homework in the performance unit. Long homework requirements take a long time to dispose of, thus reducing fragmented throughput. With regard to short schoolwork, they need to spend less time on the disposal machine, so they can improve the fragmented throughput. The divergence of dispensing algorithms and methods can also have a large impact on fragmented throughput.
3) Working time. It refers to the amount of work done from homework submission to completion, including homework waiting, queuing in the queue, running on the Yi machine, and stopping output/input operations.
the working time of homework can be expressed as follows:
Working time = homework Completed-Homework submission time
uniform turnover time refers to the uniform value of multiple homework turnover time:
Uniform turnaround time = (Homework 1 turnover time + ... + homework n turnover time)/n
The right turnover time refers to the ratio of homework turnover time and homework practice working time:
650) this.width=650; "src=" Http://c.biancheng.net/cpp/uploads/allimg/140629/1-140629151603410.png "style=" border : 0px;color:rgb (51,51,51); font-family: ' Microsoft Jas Black ', ' Microsoft Yahei ', Arial, Helvetica, sans-serif;font-size:14px; line-height:21px;white-space:normal;width:243px;height:40px; "/>
the equal right turnover time refers to the uniform value of the working time of multiple homework:
Uniform Belt Right turnaround time = (homework 1 with the right turnover time + ... + homework n the right turnaround time)/n
4) Waiting time. Refers to the process in the form of such a machine, and the longer the waiting time, the lower the user's satisfaction. In practice, the assignment algorithm does not affect the homework performance or output/input operation, only affect the work in the queue waiting for the time spent. Thus, the tradeoff between a dispensing algorithm is often only complicated to investigate the waiting time.
5) The time of the Echo. Refers to the time taken from the user to submit a request to a piecemeal first occurrence. In the interactive fragmentary, the turnover time impossible can be the best evaluation principle, the common use echoes the time as the tradeoff adjustment algorithm one of the main principles. From the user's point of view, the adjustment strategy should try to reduce the response time, so that the response time in the user can bear the scale within.
To lose a contented algorithm for all users and piecemeal requests is impossible capable. Design transfer procedures, on the one hand to meet the specific needs of the user's request (such as some timely and interactive process to respond quickly to requests), on the other hand to consider the full effect of fragmented (such as increasing all the fragmented process of uniform turnaround time), but also to consider the expenditure of the dispensing algorithm.
This article is from the "11999725" blog, please be sure to keep this source http://12009725.blog.51cto.com/11999725/1843720
Disposal: Concept, opportunity, switch, process, transfer method and fundamental principle of dispensing