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
JPS5930304B2 - Deadlock detection circuit - Google Patents
[go: Go Back, main page]

JPS5930304B2 - Deadlock detection circuit - Google Patents

Deadlock detection circuit

Info

Publication number
JPS5930304B2
JPS5930304B2 JP4569176A JP4569176A JPS5930304B2 JP S5930304 B2 JPS5930304 B2 JP S5930304B2 JP 4569176 A JP4569176 A JP 4569176A JP 4569176 A JP4569176 A JP 4569176A JP S5930304 B2 JPS5930304 B2 JP S5930304B2
Authority
JP
Japan
Prior art keywords
resource
deadlock
circuit
detection circuit
registers
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
JP4569176A
Other languages
Japanese (ja)
Other versions
JPS52128029A (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 JP4569176A priority Critical patent/JPS5930304B2/en
Publication of JPS52128029A publication Critical patent/JPS52128029A/en
Publication of JPS5930304B2 publication Critical patent/JPS5930304B2/en
Expired legal-status Critical Current

Links

Description

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

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

いま、プロセスAがさらにリソースsを必要とする状態
になつたとすると、リソースsはプロセスBが使用中で
あるため処理を進めることができず、プロセスBがリソ
ースsが解放するまで待つことになる。この状態で、プ
ロセスBをリソースsのほかにさらにリソースRを必要
とする状態になつたとすると、明らかに両プロセスとも
それ以上処理を進めることができない。このようなシス
テムの状態をデツドロツクと呼ぶ。システムに、このよ
うなデツドロツクが発生すると、単にデツドロツクを起
したプロセスを進めることができなくなるばかりでなく
、これを知らずに放つておくと、そのプロセスに割当て
られたリソースは使われないままになり、システムの処
理効率を落してしまう。
If process A now needs more resource s, it cannot proceed because resource s is being used by process B, and process B will have to wait until resource s is released. . In this state, if process B reaches a state where it requires resource R in addition to resource s, it is clear that both processes cannot 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 become unable to proceed, but if left unchecked, the resources allocated to that process will remain unused. , which reduces the processing efficiency of the system.

例えば、マルチプログラミングを行なうコンピュータシ
ステムにおいては、各種の周辺装置は上記リソースに対
応するが、デツドロツクの発生により、これらの周辺装
置の−部が使用されないままになることは極めて不経済
なことであり、したがつてデツドロツク状態の検出は非
常に重要である。
For example, in a computer system that performs multiprogramming, various peripheral devices correspond to the above resources, but it is extremely uneconomical that some of these peripheral devices remain unused due to deadlock. Therefore, detection of deadlock conditions is very important.

デツドロツク状態の検出は、コンピュータシステムにお
いてはオペレーティングシステム(OS)の仕事であり
、したがつて従来はソフトウェアにより行なわれてきた
Detection of deadlock conditions is the job of the operating system (OS) in computer systems, and thus has traditionally been performed by software.

しかし、ソフトウェアによると、その処理にCPU(中
央処理装置)やメインメモリを占有することになり、シ
ステムスループットがその分だけ低下することが問題で
あつた。
However, the problem with software is that the processing occupies the CPU (central processing unit) and main memory, resulting in a reduction in system throughput.

本発明は、新規なハードウェアによつて、従来のこのよ
うな問題を解決することを目的としている。
The present invention aims to solve these conventional problems by means of new hardware.

すなわち、本発明によれば、05は本発明の回路に現在
のシステムの状態を入力するだけでよく、デツドロツク
状態の存否は、該回路が自動的に判定してくれる。
That is, according to the present invention, 05 only needs to input the current system status to the circuit of the present invention, and the circuit automatically determines whether a deadlock condition exists.

しかも本発明によれば、上記判定は簡単な組合せ回路に
よつて行なわれるため、判定に要する時間は極めて短い
。つぎに、本発明を図示の実施例によつて詳細に説明す
る。
Moreover, according to the present invention, since the above-described determination is performed by a simple combinational circuit, the time required for the determination is extremely short. Next, the present invention will be explained in detail with reference to illustrated embodiments.

図において、リソース割当てレジスタ101,102,
・・・,105にはプロセスに割当てられているリソー
スの状態が記憶されている。各レジスタはそれぞれ一つ
のプロ石スに対応しており、レジスタの各ビツトはリソ
ースに対応している。したがつてレジスタの数および各
レジスタの長さ(ビツト数)はシステムで処理される最
大プロセス数および使用される最大リソース数をカバー
できるようになつている。そして、この実施例では、プ
ロセスに割当てられているリソースは、対応レジスタの
対応ビツトが1になるようにしてある。リソース要求レ
ジスタ201,202,・・・,205についても同様
である。
In the figure, resource allocation registers 101, 102,
..., 105 stores the status of resources allocated to processes. Each register corresponds to one processor, and each bit of the register corresponds to a resource. Therefore, the number of registers and the length (number of bits) of each register are set to cover the maximum number of processes processed by the system and the maximum number of resources used. In this embodiment, the resources allocated to the processes are such that the corresponding bits of the corresponding registers are set to 1. The same applies to the resource request registers 201, 202, . . . , 205.

つまり、要求しているプロセスに対応したレジスタのそ
のリソースに対応したビツトが1になる。リソースバス
50は、リソース割当てレジスタの各ビツトに対応した
本数の信号線で、リソース割当てレジスタからリソース
解放回路11,12,・・・,15のANDゲートを通
つた信号線がワイアド0Rの形で接続されている。
In other words, the bit corresponding to the resource in the register corresponding to the requesting process becomes 1. The resource bus 50 has a number of signal lines corresponding to each bit of the resource allocation register, and the signal lines that pass from the resource allocation register through the AND gates of the resource release circuits 11, 12, . . . , 15 are wired 0R. It is connected.

いま、リソース解放回路のANDゲートが全て開かれて
いるとすると、リソースバス50の信号線上には、リソ
ースがプロセスに占有されている状態が現われているこ
とになる。したがつてもし、その値が0なら、そのリソ
ースはどのプロセスにも割当てられていないことになる
。デツドロツクフリ一検出回路21,22,・・・25
は、リソースバス50およびリソース要求レジスタ20
1,202,・・・,205の信号を比較し、リソース
バス上に現われている自由なリソース(どのプロセスに
も割当てられていないリソース)以内であるかどうかを
判別する論理回路である。
If all the AND gates of the resource release circuit are now open, a state appears on the signal line of the resource bus 50 in which the resource is occupied by a process. Therefore, if the value is 0, it means that the resource has not been allocated to any process. Deadlock free detection circuits 21, 22, . . . 25
is the resource bus 50 and resource request register 20
This is a logic circuit that compares signals 1, 202, .

例えばリソースバスが(0,0,1,1,0)つまり第
3番目と第4番目のリソースを除いて、他は自由である
とすると、もしリソース要求レジスタの内容が(1,0
,0,0,1)、つまり第1番目と第5番目のリソース
を要求しているプロセスについては、デツドロツクフリ
一検出回路の出力は0である。
For example, if the resource bus is (0, 0, 1, 1, 0), that is, the rest is free except for the third and fourth resources, then if the contents of the resource request register are (1, 0
, 0, 0, 1), that is, the output of the deadlock free detection circuit is 0 for the processes requesting the first and fifth resources.

一方、もしリソース要求レジスタの内容が(1,0,1
,0,1)なるプロセスでは、第3番目のリソース要求
はリソースバスの状態をはみ出しているので、出力は1
である。デツドロツクフリ一検出回路は、リソースバス
の状態が1(他のプロセスに割当てられている)である
のに、そのリソースを要求している(リソース要求レジ
スタのそのリソースに対応したビツトが1)ところが1
つでもあればそのプロセスのデツドロツクフリ一回路の
出力は1であることから、図のようにANDゲートと0
Rゲートで実現される。0Rゲート31〜35は、本回
路の動作制御信号Tおよび上記のデツドロツク検出回路
の出力d1〜Dnのそれぞれを入力とし、例えば0Rゲ
ート31についてはTおよびd1の双方がOのときに0
を出力し、リソース解放回路11内の全ゲートを閉じる
On the other hand, if the contents of the resource request register are (1, 0, 1
, 0, 1), the third resource request overflows the state of the resource bus, so the output is 1.
It is. The deadlock free detection circuit detects when a resource is requested (the bit corresponding to the resource in the resource request register is 1) even though the resource bus status is 1 (allocated to another process).
If there is one, the output of the deadlock free circuit of the process is 1, so as shown in the figure, the AND gate and 0
This is realized with an R gate. The 0R gates 31 to 35 input the operation control signal T of this circuit and the outputs d1 to Dn of the deadlock detection circuit, respectively. For example, the 0R gate 31 becomes 0 when both T and d1 are O.
is output, and all gates in the resource release circuit 11 are closed.

つぎにこの回路の動作を説明しよう。Next, let's explain the operation of this circuit.

まず、各レジスタに必要な情報が0S等によりロードさ
れる。この時リソース解放回路11,12,・・・,1
5のANDゲートは回路の動作を制御する信号Tにより
全て開かれている。すなわち、ロード期間中はT=1と
してあり、0Rゲート31、32、・・・35によりリ
ソース開放回路のANDゲートは全て開かれている。
First, necessary information is loaded into each register by OS or the like. At this time, resource release circuits 11, 12, ..., 1
All of the 5 AND gates are opened by a signal T that controls the operation of the circuit. That is, during the load period, T=1, and the AND gates of the resource release circuit are all opened by the 0R gates 31, 32, . . . .

口ードが終るとT=0とし、デツドロツク判定動作が開
始される。本実施例の動作を理解するためには、しかし
T=0の状態での各デツドロツクフリ一検出回路の出力
であるD,,d2,・・・,Dnの値に注目しておく必
要がある。
When the code is finished, T=0 and the deadlock determination operation is started. In order to understand the operation of this embodiment, however, it is necessary to pay attention to the values of D, d2, .

dがOになつているプロセスは、現在要求しているリソ
ースが他のプロセスに割当てられていないということで
ある。つまり、これらのプロセスはデツドロツク状態に
ないことを意味している。そこでまた、このデツドロツ
クを起していないプロセスに割当てられているリソース
だけを要求しているプロセスもデツドロツク状態にない
ことは明らかである。
A process whose d is O means that the resource it is currently requesting is not allocated to another process. This means that these processes are not in deadlock. It is also clear that a process requesting only the resources allocated to a process that is not deadlocked is also not deadlocked.

このプロセスのdはT=0とした瞬間には1であるが、
T=0としたときd=0を出力しているプロセスのリソ
ースがこのd=0で回路上間放される。つまり、T=0
のときd=1となつていたプロセスも開放されるリソー
スを要求している場合にはdもT=0において0となつ
て行く。この動作はT=0とした瞬間から始まる。もし
Dl,d2,・・・,Dn全てがOになれば、システム
にはデツドロツクが存在しないことになる。
d of this process is 1 at the moment T=0, but
When T=0, the resources of the process that is outputting d=0 are released on the circuit at d=0. That is, T=0
If the process that was d=1 at T=1 is also requesting the released resource, d also becomes 0 at T=0. This operation starts from the moment T=0. If Dl, d2, . . . , Dn all become O, there is no deadlock in the system.

これは0Rゲート40の出力に現われる。もし1のまま
のものが残つたとすれば、システムにはデツドロツクを
起しているプロセスがあり、そのプロセスはd=1のも
のである。
This appears at the output of 0R gate 40. If anything remains as 1, there is a deadlocked process in the system, and that process is the one with d=1.

以上の説明から明らかなように、システムの状態を示す
レジタル以外は全て組合せ回路である。
As is clear from the above description, all circuits other than the digitals indicating the system status are combinational circuits.

したがつて回路動作の高速化は極めて容易である。また
図の実施例では、信号Dl,d2,・・・,DnとTO
)0R論理によりリソース解放回路を制御したが、リソ
ース解放回路を省略する方法もある。例えば、0Rゲー
トの代りにNANDゲートを使いせの信号で対応するリ
ソース割当てレジスタの全ビツトを0にりセツトするよ
うに構成すればよい。さらにまた、上記実施例では、デ
ツドロツクフリ一検出回路およびリソース解放回路を各
レジスタに全て設けたが、リソースバス50およびDl
,d2,・・・,Dn用のレジスタを付ければ、上記回
路はプロセスで切換えて共用でき、回路のゲート数を減
らすことができる。ここで本回路の利用手順をまとめる
と以下の様である。
Therefore, speeding up the circuit operation is extremely easy. Furthermore, in the illustrated embodiment, the signals Dl, d2,..., Dn and TO
) Although the resource release circuit is controlled by 0R logic, there is also a method of omitting the resource release circuit. For example, instead of the 0R gate, a NAND gate may be configured to reset all bits of the corresponding resource allocation register to 0 using a special signal. Furthermore, in the above embodiment, the deadlock free detection circuit and the resource release circuit are all provided in each register, but the resource bus 50 and Dl
, d2, . . . , Dn, the above circuit can be switched and shared among processes, and the number of gates in the circuit can be reduced. Here, the procedure for using this circuit is summarized as follows.

まず動作制御信号Tを1に設定し0Rゲート31,32
,・・・35をすべて開いた状態で、リソース割当てレ
ジスタにシステムのリソース割り当て状態を、またリソ
ース要求レジスタに各プロセスのリソース要求状態をそ
れぞれセツトする。つぎに、上記Tを0にすると0Rゲ
ート31,32,・・・35がすべて開き本回路の検出
動作が治まる。検出結果はDl,d2,・・・,Dnに
出力される。よつて、プロセスiがデツドロツクに陥い
つている時にはDiに1が、陥いつていない時には0が
それぞれ出力される。この説明で明らかな様に、本回路
をコンピユータに組込む場合のインターフエース回路は
、複雑なものにはならない。
First, the operation control signal T is set to 1, and the 0R gates 31 and 32
, . . 35 are open, the system's resource allocation status is set in the resource allocation register, and the resource request status of each process is set in the resource request register. Next, when T is set to 0, all the 0R gates 31, 32, . . . , 35 are opened and the detection operation of this circuit is stopped. The detection results are output to Dl, d2, . . . , Dn. Therefore, when process i is deadlocked, 1 is output to Di, and when it is not deadlocked, 0 is output. As is clear from this explanation, the interface circuit when this circuit is incorporated into a computer does not need to be complicated.

基本的には下記の機能が必要である。a)リソース割当
てレジスタおよびリソース要求レジスタへの状態データ
のロード。
Basically, the following functions are required. a) Loading state data into resource allocation registers and resource request registers.

b)動作制御信号Tの供給。b) Supply of operation control signal T.

c)検出結果の読取。c) Reading of detection results.

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

したがつて、各プロセスの最大必要リソースがあらかじ
め判つている場合には、システムのあるリソース割当て
状態についてデツドロツク発生の危険があるかどうかは
、本発明の回路で判定することができる。なお、図の実
施例では、組合せ回路にANDゲートと0Rゲートを使
用しているが、他のものでも同様に実現できることは云
うまでもない。
Therefore, if the maximum required resources of each process are known in advance, the circuit of the present invention can determine whether there is a risk of deadlock occurring for a given resource allocation state of the system. In the illustrated embodiment, an AND gate and an OR gate are used in the combinational circuit, but it goes without saying that other gates can be used as well.

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

図は本発明の一実施例の回路図で、101,102,・
・・,105はリソースの割当て状態を記憶するリソー
ス割当てレジスタ、201,202,・・・,205は
リソースの要求状態を記憶するリソース要求レジスタ、
11,12,・・・,15は割当てられたリソースを解
放させるのと同等な信号を発生するリソース解放回路、
21,22,・・・,25はデツドロツク状態でないこ
とを検出するデツドロツクフリ一検出回路である。
The figure is a circuit diagram of an embodiment of the present invention, with 101, 102, .
. . , 105 are resource allocation registers that store the resource allocation status; 201, 202, . . . , 205 are resource request registers that store the resource request status;
11, 12, . . . , 15 are resource release circuits that generate signals equivalent to releasing allocated resources;
Reference numerals 21, 22, . . . , 25 are deadlock-free detection circuits for detecting that the device is not in a deadlock state.

Claims (1)

【特許請求の範囲】[Claims] 1 プロセスへのリソース割当て状態を記憶する複数個
のリソース割当てレジスタと、プロセスからのリソース
要求の状態を記憶する複数個のリソース要求レジスタと
、該リソース割当てレジスタおよび下記のリソース解放
回路からの入力信号によりプロセスがデツドロツク状態
にないことを検出するデツドロツクフリー検出回路と、
該デツドロツクフリー検出回路の出力により対応したプ
ロセスに割当てられているリソースを解放させたのと同
等な信号を発生するリソース解放回路とより成り、デツ
ドロツク検出回路の出力を対応するリソース解放回路に
フィードバックさせる様に接続したことを特徴とするデ
ツドロツク検出回路。
1 A plurality of resource allocation registers that store resource allocation states to processes, a plurality of resource request registers that store resource request states from processes, and input signals from the resource allocation registers and the resource release circuit described below. a deadlock-free detection circuit for detecting that the process is not in a deadlock state;
A resource release circuit generates a signal equivalent to releasing the resources allocated to the process corresponding to the output of the deadlock free detection circuit, and the output of the deadlock detection circuit is sent to the corresponding resource release circuit. A deadlock detection circuit characterized by being connected so as to provide feedback.
JP4569176A 1976-04-21 1976-04-21 Deadlock detection circuit Expired JPS5930304B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4569176A JPS5930304B2 (en) 1976-04-21 1976-04-21 Deadlock detection circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4569176A JPS5930304B2 (en) 1976-04-21 1976-04-21 Deadlock detection circuit

Publications (2)

Publication Number Publication Date
JPS52128029A JPS52128029A (en) 1977-10-27
JPS5930304B2 true JPS5930304B2 (en) 1984-07-26

Family

ID=12726398

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4569176A Expired JPS5930304B2 (en) 1976-04-21 1976-04-21 Deadlock detection circuit

Country Status (1)

Country Link
JP (1) JPS5930304B2 (en)

Also Published As

Publication number Publication date
JPS52128029A (en) 1977-10-27

Similar Documents

Publication Publication Date Title
EP0142820B1 (en) Method of controlling multiprocessing system and hardware arrangement for accomplishing the method
US5497501A (en) DMA controller using a predetermined number of transfers per request
EP0172522B1 (en) Data processing machine suitable for high-speed processing
US5666515A (en) Information processing system having multiple modules and a memory on a bus, where any module can lock an addressable portion of the memory by sending retry signals to other modules that try to read at the locked address
US6792497B1 (en) System and method for hardware assisted spinlock
US5442755A (en) Multi-processor system with lock address register in each processor for storing lock address sent to bus by another processor
JPS5841538B2 (en) Multiprocessor system instructions
US4905145A (en) Multiprocessor
US5487154A (en) Host selectively determines whether a task should be performed by digital signal processor or DMA controller according to processing time and I/O data period
JPH10143467A (en) Method and device for arbitrating bus ownership in data processing system
US5051946A (en) Integrated scannable rotational priority network apparatus
EP0217350B1 (en) Data transfer control unit and system
US6502150B1 (en) Method and apparatus for resource sharing in a multi-processor system
JP2004062910A (en) Method for realizing semaphore to multi-core processor and controlling access to common resource
JPS5930304B2 (en) Deadlock detection circuit
JPH0855097A (en) Data processing system and memory access method thereof
JP2995666B2 (en) Microcomputer system
JP3093374B2 (en) Interrupt controller
JPS6048795B2 (en) deadlock detector
JP2591211B2 (en) High-speed interrupt processing device
JPS59103155A (en) Data processing module
JP2806700B2 (en) Multi-processing system
JP2635863B2 (en) Central processing unit
JP2825589B2 (en) Bus control method
JPH0736820A (en) I/o controller