In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
Most of the deadlock prevention and prevention algorithms introduced later are to impose restrictions or stop detection when allocating capital to the process. If bits and pieces are not taken when allocating capital to the process, the tactics of deadlock detection should be provided.
Capital allocation chart
Piecemeal deadlocks can be depicted using a capital allocation chart. As shown in figure 2-17, a process is represented by a circle and a class of capital is represented by a box. Because there can be more than one type of capital, a point in the box is used to represent a capital in a class of capital. The direction from the process to the capital is called pleading, which shows that the process requests this kind of capital of a unit; from the capital to the process, it shows that a capital of this kind of capital has been allocated to the process.
Figure 2-17 sample diagram of capital allocation
In the capital allocation diagram shown in figure 2-17, process P1 has allocated two R1 capital and pleaded for another R2 capital; process P2 has allocated one R1 and one R2 capital, and pleaded for another R1 capital.
Deadlock theorem
We can test whether the piecemeal form S is a deadlock form by simplifying the capital allocation chart. The simplification method is as follows:
1) in the capital allocation graph, find out the process Pi that is neither congested nor isolated (that is, find a directed edge connected to it, and the number of requests for capital corresponding to the directed edge is less than or equal to the number of leisure capital in the bits and pieces. If all the sides of the process are satisfied with the above premise, the process can continue to operate until it is completed, and then release all the capital it occupies). Eliminate all its pleading and dispatching edges and make it an isolated node. In figure 2-18 (a), P1 is the process node of contentment. If all edges of P1 are deleted, the condition shown in figure 248 (b) will be lost.
2) the capital released by the process Pi can wake up some processes that are choked by waiting for these capital, and the original choking process can become an unchoked process. In figure 2-17, process P2 is satisfied with the premise. After stopping a series of simplification according to the method in section 1), if all edges in the graph can be eliminated, the graph is said to be completely simplified, as shown in figure 2-18 (c).
The premise that S is deadlock is if and only if the capital allocation graph of S form is completely simplified, which is the deadlock theorem.
Release of deadlock
Once a deadlock is detected, a response should be taken immediately to release the deadlock. The secondary ways to release deadlocks are:
1) capital deprivation law. Suspend some deadlock processes and seize its capital, allocating that capital to other deadlock processes. However, we should avoid the process of being suspended for a long time without access to capital, but in the form of lack of capital.
2) revocation process method. Force the withdrawal of local or even entire deadlock processes and deprive them of their capital. The criterion of revocation can be stopped according to the priority of the process and the value of the undo process.
Figure 2-18 Simplification of the capital allocation chart
3) process fallback method. Let one or more processes fall back to the point where they can escape the deadlock and voluntarily release capital instead of being deprived of it. Request bits and pieces of history information about the persistence process and set the recovery point.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.