Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JPS6048795B2 - deadlock detector - Google Patents
[go: Go Back, main page]

JPS6048795B2 - deadlock detector - Google Patents

deadlock detector

Info

Publication number
JPS6048795B2
JPS6048795B2 JP4292778A JP4292778A JPS6048795B2 JP S6048795 B2 JPS6048795 B2 JP S6048795B2 JP 4292778 A JP4292778 A JP 4292778A JP 4292778 A JP4292778 A JP 4292778A JP S6048795 B2 JPS6048795 B2 JP S6048795B2
Authority
JP
Japan
Prior art keywords
resource
deadlock
register
processes
circuit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired
Application number
JP4292778A
Other languages
Japanese (ja)
Other versions
JPS54134531A (en
Inventor
孔二 祢津
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
Nippon Electric Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nippon Electric Co Ltd filed Critical Nippon Electric Co Ltd
Priority to JP4292778A priority Critical patent/JPS6048795B2/en
Publication of JPS54134531A publication Critical patent/JPS54134531A/en
Publication of JPS6048795B2 publication Critical patent/JPS6048795B2/en
Expired legal-status Critical Current

Links

Landscapes

  • Multi Processors (AREA)

Description

【発明の詳細な説明】 本発明は、排他的に使用される複数個のリソースを含み
、複数のプロセスを並行して処理するシステムにおいて
発生するシステムデツド頭ノクを検出する回路、なわち
デツドロツクデイテクタに係る。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a circuit for detecting a system deadlock that occurs in a system that includes a plurality of exclusively used resources and processes a plurality of processes in parallel. Regarding the detector.

上記のシステムにおいて、プロセスAがリソースRを使
つて、一方プロセスBがリソースSを使つて処理されて
いるとする。
Assume that in the above system, process A is being processed using resource R, while process B is being processed using resource S.

今、プロセスAがさらにリソースSを必要とする状態に
なつたとするとこのリソースsはプロセスBが使用中で
あるためのプロセスAの処理を進めることができす、プ
ロセスBがリソースSを解放するまで処理を停止して待
つここになる。この状態で、プロセスBがリソースsの
他にさらにリソースRを必要とする状態になつたとする
と、リソースRはプロセスAに握られているので、明ら
かに両プロセスともそれ以上処理を進めることができな
い。このようなシステムの状態をデツドロツクと呼ぶ。
システムに、このようなデツドロツクが発生すると、単
にデツドロツクを起したプロセスが処理が進められなく
なるばかりでなく、それらのプロセスに握られているリ
ソースは使われないままになり、システムの処理能率を
低下させてしまう。
Now, if process A is in a state where it needs more resource S, this resource s is in use by process B, so process A can proceed with its processing until process B releases resource S. This will stop the process and wait. In this state, if process B becomes in a state where it needs resource R in addition to resource s, since resource R is held by process A, it is clear that neither process can proceed any further. . This state of the system is called a deadlock.
When such a deadlock occurs in a system, not only will the process that caused the deadlock not be able to proceed, but the resources held by those processes will remain unused, reducing the processing efficiency of the system. I'll let you.

例えば、マルチプログラミングやマルチプロセッシング
を行うコンピューターシステムにおいては各種の周辺装
置は上記リソースに対応するが、デツドロツクの発生に
より、これらの周辺装置の一部が使用されないままにな
ることは極めて不経・済なことであり、従つて、デツド
ロツクの早期検出は非常に重要である。デツドロツク状
態の検出は、コンピュータシステムおいてはオペレーテ
ィングシステム(OS)の仕事であり、したがつて従来
はソフトウェアに・より行われてきた。
For example, in a computer system that performs multiprogramming or multiprocessing, various peripheral devices correspond to the above resources, but it is extremely uneconomical and uneconomical for some of these peripheral devices to remain unused due to deadlock. Therefore, early detection of deadlock is very important. Detection of deadlock conditions is the job of the operating system (OS) in computer systems, and thus has traditionally been performed by software.

しかし、ソフトウェアによると、その処理にCPU(中
央処理装置)や主記憶を占有することになり、システム
スループット(コンピュータの処理能力)が低下するこ
とが問題であつた。この問題に対する解決策の一つとし
て、ハードウェアによるデツドロツクの検出方式が提案
されている。その詳細は昭和5詳10月発行の電子通信
学会論文誌第J6O−D巻第10号の809〜813頁
に「デツドロツクデイテクタ」として掲載されているが
、これによればCPUや主記憶を使用せず、しかもソフ
トウェアによるよりはるかに高速に検出処理が実行され
る。しかしながら、欠点としてレジスタ数やゲート数が
多く高価なハードウェアとなる点が実用上問題であつた
。本発明は、レジスタ数やゲート数が従来より大巾に少
なくて済む新規なデツドロツクデイテクタを提供するこ
とを目的としている。
However, the problem with software is that its processing occupies the CPU (central processing unit) and main memory, reducing system throughput (computer processing power). As one solution to this problem, a deadlock detection method using hardware has been proposed. The details are published in the Journal of the Institute of Electronics and Communication Engineers, Vol. The detection process is performed without memory and much faster than with software. However, the drawback is that the number of registers and gates is large, resulting in expensive hardware, which is a practical problem. SUMMARY OF THE INVENTION An object of the present invention is to provide a new deadlock detector which requires a significantly smaller number of registers and gates than conventional ones.

次に、本発明を図示の実施例によつて詳細に説明する。Next, the present invention will be explained in detail with reference to illustrated embodiments.

図においてリソースアロケーションレジスタ101には
、各プロセスがリソースを握つているかどうかに状態が
0S等によりロードされ、記憶されている。図は一例と
してプロセス数が4以下のシステム用のデツドロツクデ
イテクタであるから、レジスタは4ビットで各ビットは
各プロセスに対応させている。例えば第1、第2および
第4プロセスがどれかのリソースを握つているとすると
、レジスタの内容は(101ハとなる。リソース要求レ
ジスタ201,202,203,204についても同様
に各プロセスに対応配置されている。
In the figure, the resource allocation register 101 is loaded with the status of whether each process is holding a resource or not using OS or the like and stored therein. The figure shows, as an example, a deadlock detector for a system with four or less processes, so the register has four bits, and each bit corresponds to each process. For example, if the first, second, and fourth processes hold some resource, the contents of the register will be (101c). Similarly, the resource request registers 201, 202, 203, and 204 correspond to each process. It is located.

201は第1プロセス用であり、その内容がもし(01
1)なら、第1プロセスは第2および第3プロセスが握
つているリソースを要求しているこ.とを表わす。
201 is for the first process, and if its contents are (01
1), then the first process is requesting the resources held by the second and third processes. represents.

このレジスタが4ビットでなく3ビットなのは、自分用
のビットが不要だからである。202,203,204
はそれぞれ第2、第3、第4プロセス用リソース要求レ
ジスタであ.る。
The reason this register is 3 bits instead of 4 bits is because it does not require its own bits. 202, 203, 204
are the resource request registers for the second, third, and fourth processes, respectively. Ru.

リソースバス50は、リソースアロケーションレジスタ
101の各ビットに対応した本数の信号線でリソースア
ロケーションレジスタ101からリソース解放回路11
のN1ゲートを通つた信・号が表われる。
The resource bus 50 connects the resource allocation register 101 to the resource release circuit 11 with the number of signal lines corresponding to each bit of the resource allocation register 101.
The signal passing through the N1 gate appears.

デツドロツクフリー検出回路21,22,23,24も
各プロセスに対応して配置されているものであり、リソ
ースバス50およびリソース要求レジスタ201,20
2,203,204の信号を比較し、リソースバス50
上に現われているどれかのプロセスが握つているリソー
スを前記デツドロツクフリー検出回路に対応するプロセ
スが要求しているかどうかを検出する。
Deadlock free detection circuits 21, 22, 23, and 24 are also arranged corresponding to each process, and are connected to a resource bus 50 and resource request registers 201, 20.
2, 203, and 204, and the resource bus 50
It is detected whether the process corresponding to the deadlock free detection circuit requests the resource held by any of the processes appearing above.

例えばリソースバス50上の信号が(1011)つまり
第1、第2、第4プロセスがリソースを握つており、か
つ信号Tのレベルが1であるとき、第1のプロセスのリ
ソース要求レジスタ201の内容が上記のように(01
ハ、つまり第2、第3プロセスの握つているリソースを
要求していると、リソースバス50上の第2プロセスと
、リソース要求レジスタ201の第2プロセス(第1ビ
ット)にそれぞれ対応した信号が1であるからそれらの
N1は1となる。
For example, when the signal on the resource bus 50 is (1011), that is, the first, second, and fourth processes are in possession of the resource, and the level of the signal T is 1, the content of the resource request register 201 of the first process As shown above (01
C. In other words, when the second and third processes are requesting the resources held by them, the signals corresponding to the second process on the resource bus 50 and the second process (first bit) of the resource request register 201 are transmitted. 1, so their N1 is 1.

しかし、リソースバス50上の第3、第4プロセスにつ
いては前記リソース要求レジスタ201の対応したビッ
トの信号とのN損は0となる。デツドロツクフリープロ
セス検出回路21の終段はこれらANDゲート出力の0
Rをとる構成にしてあるから、結局この回路の出力は1
である。上記説明で明らかなように、デツドロツクフリ
ープロセス検出回路では、前記デツドロツクフリープロ
セス検出回路に対応するプロセスが要求しているリソー
スで、他のプロセスに握られているものがあるかどうか
を検出する。
However, for the third and fourth processes on the resource bus 50, the N loss with respect to the signal of the corresponding bit of the resource request register 201 is zero. The final stage of the deadlock free process detection circuit 21 is the 0 of these AND gate outputs.
Since it is configured to take R, the output of this circuit is 1 in the end.
It is. As is clear from the above explanation, the deadlock-free process detection circuit determines whether there are any resources that are requested by the process corresponding to the deadlock-free process detection circuit and which are held by other processes. Detect.

もし握られていれば出力は1、そうでなければ出力は0
となる。出力がoとなつているプロセスは、デツドロツ
ク状態にないことは明らかである。つまり、デツドロツ
クフリープロセス検出回路21の出力がoとなつている
プロセス(この楊合対応する第1プロセス)はデツドロ
ツク状態にないことを表わす。他のプロセスについても
同様であり、要求がどのプロセスにも握られていないリ
ソースとデツドロツク状態にないプロセスが握つている
リソース以内のプロセスも、またデツドロツク状態にな
い。
If the grip is held, the output is 1, otherwise the output is 0.
becomes. It is clear that a process whose output is o is not deadlocked. In other words, the process for which the output of the deadlock-free process detection circuit 21 is o (the first process corresponding to this change) is not in a deadlock state. The same goes for other processes, and processes whose requests are held by processes whose requests are not in a deadlock state with resources that are not in a deadlock state are also not in a deadlock state.

リソース解放回路11はこのようなプロセスを検出でき
るようにするための回路である。
The resource release circuit 11 is a circuit for detecting such a process.

いま、T=0とすると、制御回路31によりデツドロツ
クフリープロセス検出回路21,22,23,24の出
力はそのままリソース解放回路11のそれぞれのプロセ
スに対応したANDゲートに入力される。
Now, when T=0, the control circuit 31 inputs the outputs of the deadlock free process detection circuits 21, 22, 23, and 24 as they are to the AND gates corresponding to the respective processes of the resource release circuit 11.

もしこの入力が0でT=0なら、リソースアロケーショ
ンレジスタ101のそのビットが1であつてもリソース
バス50には出力されない。つまり、そのプロセスが握
つているリソースは解放されたと同じことになり、上記
のようなプロセス(どのプロセスにも握られていないリ
ソースとデツドロツク状態にないプロセスが握つている
リソース以内のプロセス)がデツドロツクフリープロセ
ス検出回路21〜24により検出される。Tは、本デツ
ドロツクデイテクタの動作を制御する制御信号入力線で
ある。
If this input is 0 and T=0, no output is made to the resource bus 50 even if that bit of the resource allocation register 101 is 1. In other words, the resources held by that process are the same as being released, and the processes described above (resources that are not held by any process and processes within the resources held by processes that are not in a deadlock state) are released. It is detected by the drag-free process detection circuits 21-24. T is a control signal input line for controlling the operation of the present deadlock detector.

T=1なら制御回路31によりデツドロツクフリープロ
セス検出回路21〜24の0出力は阻止され、リソース
解放回路11へは伝達されないから、本デツドロツクデ
イテクタの動作は停止させる効果を持つ。依つて各レジ
スタへのデータをロードする時にはT=1としておくこ
とになる。本デツドロツクデイテクタの動作は、T=1
として各レジスタにデータをロードした後、T=0とし
た瞬間から始まり、デツドロツクフリープロセス検出回
路21〜24の出力端子山〜山に各プロセスがデツドロ
ツク状態にあるか否かが出力される。
If T=1, the zero output from the deadlock free process detection circuits 21 to 24 is blocked by the control circuit 31 and is not transmitted to the resource release circuit 11, which has the effect of stopping the operation of the deadlock detector. Therefore, T=1 is set when loading data into each register. The operation of this deadlock detector is T=1
After loading data into each register as follows, starting from the moment when T=0, output terminals of the deadlock free process detection circuits 21 to 24 output whether or not each process is in a deadlock state. .

もしD,〜Dn全てが0になれば、システムにはデツド
ロツクが存在しないことになる。
If D, ~Dn all become 0, there is no deadlock in the system.

1のまま残つているものがあれば、システムはデツドロ
ツクを起しているシステムがあり、そのプロセスはd端
子が1のものである。
If some remain as 1, the system is deadlocked, and the process is one whose d terminal is 1.

例えばdl端子が1であれだ第1プロセスがデツドロツ
クを起していることになる。以上の説明から明らかなよ
うに、システムの状態を示す、リソースアロケーション
レジスタおよび要求レジスタ以外は全て組み合せ回路で
あるため動作は高速てある。
For example, if the dl terminal is 1, this means that the first process is deadlocked. As is clear from the above description, all the registers other than the resource allocation register and the request register, which indicate the state of the system, are combinational circuits, so the operation is fast.

さらに前記の公知のものに較べ、回路に使われるレジス
タおよび論理素子の数を大巾に減少している。すなわち
、公知のものでは各リソースの割当状況および要求状況
をもとに回路が構成されていたので、レジスタの数も約
2倍必要でかつ各レJジスタのビット数もリソース数だ
け必要であつた。多くのシステムではリソース数はプロ
セス数よりかなり多いから本発明によればこれらレジス
タのビット数も減らせる。
Furthermore, compared to the prior art, the number of registers and logic elements used in the circuit is greatly reduced. In other words, in the known circuit, the circuit is configured based on the allocation status and request status of each resource, so the number of registers is approximately twice as necessary, and the number of bits in each register is equal to the number of resources. Ta. Since in many systems the number of resources is significantly greater than the number of processes, the present invention also reduces the number of bits in these registers.

公知例との違いを回路構成の上からさらに具体的に説明
しよう。公知例との回路構成上の顕著な違いの第1点は
リソースアロケーションレジスタに見られる。
Let us explain the difference from the known example in more detail from the circuit configuration. The first notable difference in circuit configuration from the known example is the resource allocation register.

公知例では各プロセスに対応したリソース数だけのビッ
ト巾のレジスタが必要であるが、本発明によれば唯一つ
のそれもプロセス数だけの巾のレジスタでよい。例えば
コンピュータにおける典型的な例として、プロセス数1
0、リソース数30とすると、レジスタのビット数の総
計は本発明によれば公知例に対し101(30×10)
=1130で済むことになり極めて大巾な簡単化がなさ
れる。公知例との違いの第2点は、リソースバスに現わ
れている。
In the known example, registers with a bit width equal to the number of resources corresponding to each process are required, but according to the present invention, only one register with a width equal to the number of processes is sufficient. For example, as a typical example in a computer, the number of processes is 1
0 and the number of resources is 30, the total number of register bits is 101 (30×10) according to the present invention compared to the known example.
= 1130, resulting in an extremely large simplification. The second difference from the known example appears in the resource bus.

公知例では、リソースアロケーションレジスタが複数個
あるために、リソースバスへは0Rゲートを通してから
結線する必要がある。しカル本発明によれば、レジスタ
は唯一個であるから0Rゲートは不要である。ここでも
論理素子の大巾な減少がなされており、かつゲートによ
る遅れも無いので動作の高速化が可能となつている。こ
のように、本発明によれば公知例のものに較べ、レジス
タ構成および論理回路構成とも大巾に簡単化した、従つ
て素子数が大巾に少なくて済みかつ動作が高速な新規な
デツドロツクデイテクタが得られる。
In the known example, since there are a plurality of resource allocation registers, it is necessary to connect them to the resource bus after passing through an 0R gate. According to the present invention, since there is only one register, an 0R gate is not required. Here, too, the number of logic elements has been greatly reduced, and there is no delay due to gates, making it possible to speed up the operation. As described above, the present invention provides a novel device that has a much simpler register configuration and logic circuit configuration than the known examples, and therefore requires a much smaller number of elements and operates at high speed. You can get Tsukudaytekta.

なお、デツドロツクの予測は、デツドロツク検出と同じ
手順で行えることが知られている。
It is known that prediction of deadlock can be performed using the same procedure as detection of deadlock.

従つて、本発明の回路でシステムにデツドロツク発生の
危険があるかどうかを判定することもできる。なお、図
の実施例ては、組み合せ回路にANDゲートと0Rゲー
トを使用したが、NANDゲート等の他のものでも同様
に実現できることは言うまでもない。
Therefore, the circuit of the invention can also be used to determine whether there is a risk of deadlock in the system. In the illustrated embodiment, an AND gate and an 0R gate are used in the combinational circuit, but it goes without saying that other gates such as a NAND gate can also be used.

【図面の簡単な説明】[Brief explanation of the drawing]

図は本発明の一実施例の回路図で、101はプロセスへ
のリソースの割当て状態を記憶するリソースアロケーシ
ョンレジスタ、201〜204はプロセスのリソース要
求状態を記憶するリソース要求レジスタ、11はプロセ
スに割当てられたリソースを全て解放させるのと同等の
信号を発生させるリソース解放回路、21〜24はプロ
セスがデツドロツク状態にないことを検出するデツドロ
ックフリープロセス検出回路、31は本デツドロツクデ
イテクタの動作を制御するための制御回路である。
The figure is a circuit diagram of an embodiment of the present invention, in which 101 is a resource allocation register that stores resource allocation status to processes, 201 to 204 are resource request registers that store resource request status of processes, and 11 is a resource allocation register that stores resource allocation status to processes. 21 to 24 are deadlock-free process detection circuits that detect that a process is not in a deadlock state; 31 is the operation of this deadlock detector; This is a control circuit for controlling.

Claims (1)

【特許請求の範囲】[Claims] 1 各プロセスがいずれかのリソースを握つているか、
あるいは全く握つていないかというリソースアロケーシ
ョンの状態を記憶するリソースアロケーションレジスタ
と、各プロセスが他のどのプロセスが握つているリソー
スを要求しているかというリソース要求の状態を記憶す
るリソース要求レジスタと、前記アロケーションレジス
タ出力信号と前記リソース要求レジスタ出力信号との論
理によりデツドロツク状態にないプロセスによつて握ら
れているリソースを要求しているプロセスを検出するデ
ツドロツクフリープロセス検出回路と、前記デツドロツ
クフリープロセス検出回路の出力信号のないときに前記
デツドロツクフリープロセス検出回路への前記リソース
アロケーションレジスタの対応プロセスビット出力信号
を阻止し、当該リソースを解放するリソース解放回路と
を含み構成されることを特徴とするデツドロツクデイテ
クタ。
1 Does each process own any resource?
a resource allocation register that stores the state of resource allocation, such as whether each process is not holding the resource at all, and a resource request register that stores the state of resource request, such as which other process is requesting the resource that each process is holding; a deadlock-free process detection circuit that detects a process requesting a resource held by a process that is not in a deadlock state based on logic between the allocation register output signal and the resource request register output signal; and a resource release circuit that blocks a corresponding process bit output signal of the resource allocation register to the deadlock free process detection circuit to release the resource when there is no output signal of the deadlock free process detection circuit. A deadlock detector characterized by:
JP4292778A 1978-04-11 1978-04-11 deadlock detector Expired JPS6048795B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4292778A JPS6048795B2 (en) 1978-04-11 1978-04-11 deadlock detector

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4292778A JPS6048795B2 (en) 1978-04-11 1978-04-11 deadlock detector

Publications (2)

Publication Number Publication Date
JPS54134531A JPS54134531A (en) 1979-10-19
JPS6048795B2 true JPS6048795B2 (en) 1985-10-29

Family

ID=12649647

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4292778A Expired JPS6048795B2 (en) 1978-04-11 1978-04-11 deadlock detector

Country Status (1)

Country Link
JP (1) JPS6048795B2 (en)

Also Published As

Publication number Publication date
JPS54134531A (en) 1979-10-19

Similar Documents

Publication Publication Date Title
US10877766B2 (en) Embedded scheduling of hardware resources for hardware acceleration
US5119480A (en) Bus master interface circuit with transparent preemption of a data transfer operation
EP0142820A2 (en) Method of controlling multiprocessing system and hardware arrangement for accomplishing the method
JPS5841538B2 (en) Multiprocessor system instructions
JPS6353678A (en) vector processing device
US4187538A (en) Read request selection system for redundant storage
KR102848992B1 (en) Locking circuit for competing kernels in hardware accelerators
EP0217350B1 (en) Data transfer control unit and system
US7254667B2 (en) Data transfer between an external data source and a memory associated with a data processor
JPS6048795B2 (en) deadlock detector
US7240144B2 (en) Arbitration of data transfer requests
EP4022445B1 (en) An apparatus and method for handling ordered transactions
JPH01305460A (en) Inter-processor communication system
JPS62180455A (en) Multiplexing processor
JP2995666B2 (en) Microcomputer system
JPS5930304B2 (en) Deadlock detection circuit
JP2699873B2 (en) Bus control circuit
JPS6126104B2 (en)
JPH0218622A (en) Numerical arithmetic processor
JP2825589B2 (en) Bus control method
JP2621315B2 (en) Information processing device
JPS63251846A (en) Storage device control system
JPS6228866A (en) Main memory access system
JPS62282358A (en) Memory controller
JPS59103155A (en) Data processing module