JP2621777B2 - Deadlock avoidance method in distributed system - Google Patents

Deadlock avoidance method in distributed system

Info

Publication number
JP2621777B2
JP2621777B2 JP31887093A JP31887093A JP2621777B2 JP 2621777 B2 JP2621777 B2 JP 2621777B2 JP 31887093 A JP31887093 A JP 31887093A JP 31887093 A JP31887093 A JP 31887093A JP 2621777 B2 JP2621777 B2 JP 2621777B2
Authority
JP
Japan
Prior art keywords
transaction
deadlock
condition
information storage
information
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 - Fee Related
Application number
JP31887093A
Other languages
Japanese (ja)
Other versions
JPH07175764A (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
NEC Corp
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 NEC Corp filed Critical NEC Corp
Priority to JP31887093A priority Critical patent/JP2621777B2/en
Publication of JPH07175764A publication Critical patent/JPH07175764A/en
Application granted granted Critical
Publication of JP2621777B2 publication Critical patent/JP2621777B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)
  • Multi Processors (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は、情報処理の分散処理シ
ステムにおけるデッドロック回避方式に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a deadlock avoiding method in a distributed information processing system.

【0002】[0002]

【従来の技術】分散処理システムにおけるデッドロック
はグローバルデッドロックとも呼ばれているが、このデ
ッドロックの検出は、大別するとwait−forグラ
フによる方法と時限ロックによる方法とがある。これら
は共立出版から出版された刊行物「分散オペレーティン
グシステム−UNIXの次にくるもの」を参照できる。
2. Description of the Related Art A deadlock in a distributed processing system is also called a global deadlock. The detection of this deadlock can be roughly classified into a method using a wait-for graph and a method using a timed lock. These can be referred to the publication "Distributed Operating System-Next to UNIX" published by Kyoritsu Shuppan.

【0003】(1)wait−forグラフによる方法 トランザクション間の待ち状態によって有効枝によるグ
ラフをつくり、閉路となったらデッドロックが発生して
いることになる。分散システムの場合には、システム間
でトランザクションと資源との関係を表すロッキング情
報を通信することによって、デッドロックを検出してい
る。
(1) Method using wait-for graph A graph based on valid branches is created depending on the waiting state between transactions, and when a closed circuit is established, deadlock has occurred. In the case of a distributed system, deadlock is detected by communicating locking information indicating a relationship between a transaction and a resource between the systems.

【0004】この方法を応用した技術は、特開昭62−
208139号公報、特開昭62−203259号公報
および特開昭63−52263号公報などに開示されて
いる。
A technique using this method is disclosed in
No. 208139, JP-A-62-203259 and JP-A-63-52263.

【0005】(2)時限ロックによる方法 資源に対してロックを行えなかった場合、予め決められ
た時間だけ待ち、時間経過した場合はデッドロックが発
生したと判断する。
[0005] (2) Time-based locking method [0005] If the resource cannot be locked, it waits for a predetermined time, and if the time has elapsed, it is determined that a deadlock has occurred.

【0006】デッドロックを回避する手段としては、有
向グラフを用いて、あるトランザクションがロック待ち
になる前に常に有向グラフを確認し、デッドロックの可
能性を判定することができる。
As a means for avoiding deadlock, a directed graph can be used to always check the directed graph before a transaction waits for a lock to determine the possibility of deadlock.

【0007】[0007]

【発明が解決しようとする課題】上述した分散処理シス
テムにおけるデッドロック検出方式には、以下に示すよ
うな問題点がある。
The deadlock detection method in the above-mentioned distributed processing system has the following problems.

【0008】すなわち、wait−forグラフ方式で
は、ロッキング情報をシステム間で通信し合うことが不
可欠であり、通信回線に負荷をかけることになる。
[0008] That is, in the wait-for graph system, it is indispensable that the locking information is communicated between the systems, which imposes a load on the communication line.

【0009】ファイル入出力においては、アクセスする
ファイル全体にロックする場合と、ディレクトリの一部
やファイルブロックの一部にロックする場合があり、ロ
ックによる競合状態を管理するための情報量が膨大とな
る。
In file input / output, there are cases where the entire file to be accessed is locked and a case where the lock is applied to a part of a directory or a file block. Become.

【0010】そこで、本発明では通信量を減らすため、
デッドロックになったトランザクションの関係を予め記
憶しておき、トランザクションからあるトランザクショ
ンを呼び出す前にデッドロックに陥る可能性を判定し、
事前にデッドロックを回避させることを目的とする。
Therefore, in the present invention, in order to reduce the amount of communication,
The relationship between deadlocked transactions is stored in advance, and the possibility of falling into a deadlock is determined before calling a transaction from a transaction.
The purpose is to avoid deadlocks in advance.

【0011】[0011]

【課題を解決するための手段】本発明の第1の方式は、
並列実行を行うとデッドロックになる可能性がある複数
のトランザクションのうち、起動抑止したいトランザク
ション情報と抑止時の条件を入力装置から入力し、登録
する登録手段(以下登録部)と、デッドロックに関係す
るトランサグションをこの登録手段から入力し、対象と
なるトランザクションの情報や状態をメモリやファイル
などに記憶するデッドロック情報記憶手段(以下デッド
ロック情報記憶部)と、あるトランザクションから別の
トランザクションを起動する時にデッドロック情報記憶
手段を参照して、トランザクションの起動判定を行い、
条件が成立する場合はトランザクション起動を抑止する
トランザクション起動判定手段(以下トランザクション
起動判定部)とトランザクションの起動や終了時に、デ
ッドロック情報記憶手段の状態を変更するトランザクシ
ョン制御手段(以下トランザクション制御部)とを有す
ることを特徴とする。
A first method of the present invention is as follows.
A registration unit (hereinafter referred to as “registration unit”) for inputting transaction information to be suppressed and a condition at the time of the suppression from an input device and registering the deadlock among a plurality of transactions that may be deadlocked when the parallel execution is performed. Deadlock information storage means (hereinafter referred to as a deadlock information storage unit) for inputting relevant transaction from the registration means and storing information and status of a target transaction in a memory or a file; When starting, refer to the deadlock information storage means, determine the start of the transaction,
A transaction activation determination unit (hereinafter, transaction activation determination unit) for suppressing transaction activation when the condition is satisfied, and a transaction control unit (hereinafter, transaction control unit) for changing the state of the deadlock information storage unit when the transaction is activated or terminated. It is characterized by having.

【0012】本発明の第2の方式は、前記第1の方式を
採用した分散処理システムにおけるデッドロック回避方
式において、前記トランザクション起動判定手段は、ト
ランザクション起動抑止を行うとともに、トランザクシ
ョンに制御を戻さずに、トランザクション起動要求を行
ったトランザクションを一度異常終了させ、そのトラン
ザクションが占有している資源を開放した後に、そのト
ランザクションを再起動させることを特徴とする。
According to a second method of the present invention, in the deadlock avoiding method in the distributed processing system adopting the first method, the transaction activation determining means suppresses transaction activation and does not return control to the transaction. Further, the transaction which has issued the transaction start request is abnormally terminated once, the resources occupied by the transaction are released, and then the transaction is restarted.

【0013】本発明の第3の方式は前記第1の方式を採
用した分散処理システムにおけるデッドロック回避方式
において、前記登録部は、前記トランザクション情報に
加えてデッドロック発生時に異常終了させるトランザク
ションを入力し、前記デッドロック情報記憶手段は、デ
ッドロック発生時に異常終了させるトランザクションを
記憶し、前記トランザクション起動判定部は、条件が成
立する場合、登録部によって入力された異常終了となる
トランザクションをデッドロック情報記憶手段から得
て、そのトランザクションを終了させることを特徴とす
る。
According to a third method of the present invention, in the deadlock avoiding method in the distributed processing system employing the first method, the registration unit inputs a transaction to be abnormally terminated when a deadlock occurs, in addition to the transaction information. The deadlock information storage unit stores a transaction to be abnormally terminated when a deadlock occurs, and the transaction activation determining unit determines, when the condition is satisfied, the transaction that is abnormally terminated and input by the registration unit as deadlock information. The transaction is obtained by obtaining from the storage means.

【0014】本発明の第4の方式は、第1の方式を採用
した分散処理システムにおけるデッドロック回避方式に
おいて、前記登録部は、前記トランザクション情報とと
もに、トランザクションを抑止する条件として、トラン
ザクションが占有している資源との関係を入力し、前記
デッドロック情報記憶部は、トランザクション情報とと
もに資源との関係を記憶し、前記トランザクション起動
判定手段は、資源とトランザクションと関係を判定条件
とすることを特徴とする。
According to a fourth method of the present invention, in the deadlock avoiding method in the distributed processing system employing the first method, the registration unit, together with the transaction information, occupies the transaction as a condition for suppressing the transaction. The deadlock information storage unit stores the relationship with the resource together with the transaction information, and the transaction start determination unit uses the relationship between the resource and the transaction as a determination condition. I do.

【0015】[0015]

【実施例】次に本発明の一実施例について図面を参照し
て詳細に説明する。
Next, an embodiment of the present invention will be described in detail with reference to the drawings.

【0016】本発明の一実施例を示す図1を参照する
と、まず、登録部1を説明する。登録部1では、並列実
行をさせるとデッドロックを発生させる可能性があるト
ランザクション情報をキーボードなどの入力装置5から
入力する。入力情報は、トランザクション関係とそれぞ
れのトランザクションが動作する装置名およびトランザ
クションに付与されたトランザクション識別子である。
例えば、デッドロックが図2に示すように発生した場
合、トランザクション識別子としてT1,T2,T3お
よびT4と動作する装置名としてS1およびS2を入力
し、また各トランザクションの待ち関係を入力する。図
2で示される2装置間のデッドロックでは、デッドロッ
クが発生するための前提条件として、他装置上のトラン
ザクションとそのトランザクションから起動された自装
置のトランザクションとの関係をコマンドで入力装置5
から入力する。図2で示される装置間のデッドロックの
場合、装置名S1の装置を自装置とすれば、トランザク
ションT1はトランザクションT2の実行完了を待ち合
わせていることを、デッドロックが発生するための前提
条件として入力する。
Referring to FIG. 1 showing one embodiment of the present invention, the registration section 1 will be described first. The registration unit 1 inputs, from an input device 5 such as a keyboard, transaction information that may cause a deadlock when executed in parallel. The input information is a transaction relationship, a device name on which each transaction operates, and a transaction identifier assigned to the transaction.
For example, if a deadlock occurs as shown in FIG. 2, S1 and S2 are input as the names of the devices operating with T1, T2, T3 and T4 as the transaction identifiers, and the waiting relationship of each transaction is input. In the deadlock between the two devices shown in FIG. 2, as a precondition for occurrence of the deadlock, a relation between a transaction on another device and a transaction of the own device started from the transaction is input by the input device 5.
Enter from. In the case of the deadlock between the devices shown in FIG. 2, if the device with the device name S1 is its own device, the fact that the transaction T1 is waiting for the completion of the execution of the transaction T2 is a precondition for the occurrence of the deadlock. input.

【0017】次に、前提条件が成り立つときに、起動抑
止したいトランザクション情報として、自装置上のトラ
ンザクションとそのトランザクションから起動抑止を行
う他装置上のトランザクションとの関係をコマンドで入
力装置5から入力する。図2に示される2装置間のデッ
ドロックの場合、装置名S1の装置を自装置とすれば、
前提条件が成り立つときに、トランザクションT3はト
ランザクションT4の起動抑止したいことを入力する。
Next, when the preconditions are satisfied, the relationship between the transaction on its own device and the transaction on another device whose startup is to be inhibited from the transaction is input from the input device 5 as the transaction information to be inhibited from being activated. . In the case of a deadlock between the two devices shown in FIG. 2, if the device having the device name S1 is its own device,
When the precondition is satisfied, the transaction T3 inputs that the activation of the transaction T4 is to be suppressed.

【0018】登録部1は入力されたコマンドが起動され
たときに制御移行される。登録部1では、入力装置5か
ら入力したデッドロックが発生するための前提条件に関
する情報と起動抑止したいトランザクション情報をデッ
ドロック情報記憶部2の条件判定テーブル31に設定す
る。
The control of the registration unit 1 is shifted when the input command is activated. The registration unit 1 sets, in the condition determination table 31 of the deadlock information storage unit 2, information relating to a precondition for the occurrence of a deadlock input from the input device 5 and transaction information whose activation is to be suppressed.

【0019】次にデッドロック情報記憶部2を説明す
る。
Next, the deadlock information storage unit 2 will be described.

【0020】デッドロック情報記憶部2は、メモリまた
はファイルなどに設けられ、制御表を形成する。この実
施例では図3に示すような条件判定テーブル31をメモ
リ上に実装する。条件判定テーブル31はデッドロック
が発生するための前提条件検出用の情報と起動抑止を行
うトランザクション情報を設定するために使用する。
The deadlock information storage unit 2 is provided in a memory or a file, and forms a control table. In this embodiment, a condition determination table 31 as shown in FIG. 3 is mounted on a memory. The condition determination table 31 is used to set information for detecting a precondition for generating a deadlock and transaction information for suppressing startup.

【0021】図2の場合を、条件判定テーブル31に設
定した例を図3に示す。図2で示す2装置間のデッドロ
ック状態は条件判定テーブル31のエントリ32の第2
エントリに設定されている。条件判定テーブル31の第
2エントリの中の自装置条件トランザクション識別子3
3にトランザクションT2の識別子であるT2が設定さ
れる。同様に条件判定テーブル31の第2エントリの中
の条件他装置名称34にはS2、他装置条件トランザク
ション識別子35にはT1,自装置抑止トランザクショ
ン識別子36にはT3、他装置抑止トランザクション識
別子37にはT4、抑止他装置名称38にはS2が設定
される。条件カウンタ39は初期値として“0”が設定
される。
FIG. 3 shows an example in which the condition shown in FIG. 2 is set in the condition determination table 31. The deadlock state between the two devices shown in FIG.
Is set in the entry. Own device condition transaction identifier 3 in the second entry of condition judgment table 31
3 is set to T2 which is an identifier of the transaction T2. Similarly, in the second entry of the condition determination table 31, the condition S2 is assigned to the other device name 34, T1 is assigned to the other device condition transaction identifier 35, T3 is assigned to the own device suppression transaction identifier 36, and T2 is assigned to the other device suppression transaction identifier 37. S2 is set in T4 and the other device name 38 of inhibition. The condition counter 39 is set to “0” as an initial value.

【0022】次にトランザクション制御部3を説明す
る。
Next, the transaction control unit 3 will be described.

【0023】トランザクション制御部3では、他装置か
らのトランザクション起動要求を受け付けるデッドロッ
ク情報記憶部2の条件判定テーブル31の第1エントリ
から最終エントリまでの自装置条件トランザクション識
別子33の中から、他装置から起動要求された自装置上
のトランザクション識別子と一致するものがあるかを調
べる。該当するエントリ32が存在すれば、起動元のト
ランザクション識別子と装置名が、該当するエントリ3
2の中の他装置条件トランザクション識別子35と条件
他装置名称34と一致するかを判定して、一致していれ
ば、条件カウンタ39の値を“1”加算する。条件カウ
ンタが1以上であればデッドロックが発生するための前
提条件が満足されることになる。また、条件カウンタ3
9を加算させたトランザクションが終了する場合は、ト
ランザクション制御部3に制御が移行され、この条件カ
ウンタ39の値から“1”減算される。
The transaction control unit 3 determines the condition of the own device condition transaction identifier 33 from the first entry to the last entry of the condition determination table 31 of the deadlock information storage unit 2 for receiving a transaction start request from another device. A check is made to see if there is a transaction identifier that matches the transaction identifier on the own device requested to be started by the device. If the corresponding entry 32 exists, the transaction identifier of the activation source and the device name are set to the corresponding entry 3.
It is determined whether or not the other device condition transaction identifier 35 in 2 matches the condition other device name 34, and if they match, the value of the condition counter 39 is incremented by "1". If the condition counter is 1 or more, the precondition for deadlock occurrence is satisfied. Also, condition counter 3
When the transaction to which 9 has been added ends, control is transferred to the transaction control unit 3, and “1” is subtracted from the value of the condition counter 39.

【0024】図2の場合では、トランザクションT1が
トランザクションT2を起動するときに、トランザクシ
ョン制御部3によって、図3の条件判定テーブル31の
第2エントリの条件カウンタ39の値が“1”加算され
る。
In the case of FIG. 2, when the transaction T1 activates the transaction T2, the value of the condition counter 39 of the second entry of the condition judgment table 31 of FIG. .

【0025】次にトランザクション起動判定部4を説明
する。
Next, the transaction start determination unit 4 will be described.

【0026】トランザク起動判定部4は、自装置上のト
ランザクション6から他装置上のトランザクション起動
が要求された時に制御移行される。他装置上のトランザ
クション起動を要求された場合、デッドロック情報記憶
部2の条件判定テーブル31の第1エントリから最終エ
ントリまでの自装置抑止トランザクション識別子36の
中から、他装置のトランザクション起動要求をした自装
置上のトランザクション識別子と一致するものがあるか
を調べる。該当するエントリ32がある場合、そのエン
トリ32の中の他装置抑止トランザクション識別子37
と起動要求する他装置上のトランザクション識別子が一
致し、かつ、該当エントリ32の条件カウンタ39の値
が“1”以上であれば、デッドロックの可能性があるた
め、他装置のトランザクション起動を行わず、他装置の
トランザクション起動を要求したトランザクションにエ
ラーとして制御を戻す。制御移行されたトランザクショ
ンでは、必要な後処理を行ったあとで、トランザクショ
ンを終了させる。
The transaction start determination unit 4 is controlled when a transaction start on another device is requested from the transaction 6 on the own device. When a request to start a transaction on another device is made, a transaction start request for another device is issued from the own device-suppressed transaction identifier 36 from the first entry to the last entry of the condition determination table 31 of the deadlock information storage unit 2. Check whether there is a transaction identifier that matches the transaction identifier on the own device. If there is a corresponding entry 32, the other device-suppressed transaction identifier 37 in the entry 32
If the transaction identifier on the other device requesting activation matches the value of the condition counter 39 of the corresponding entry 32 is "1" or more, there is a possibility of deadlock, and the transaction of the other device is activated. Control is returned as an error to the transaction that requested the transaction start of the other device. In the transaction whose control has been transferred, the transaction is terminated after performing necessary post-processing.

【0027】図2に示す装置間のデッドロックでは、ト
ランザクションT3,トランザクションT4を起動する
ときに、トランザクション起動判定部4は条件判定テー
ブル31の第2エントリの条件カウンタ33の値が
“1”であるため、トランザクションT4の起動を行わ
ずに、トランザクションT3に制御を戻す。トランザク
ションT3では、トランザクションを終了させる。トラ
ンザクションT3が終了すると、占有していた資源を開
放することになり、トランザクションT2の資源占有が
開始される。これによって、デッドロック状態に陥る事
なく、トランザクションT2はWAIT状態が解除さ
れ、処理を継続することができる。この動作を表したも
のが図4である。
In the deadlock between the devices shown in FIG. 2, when the transactions T3 and T4 are activated, the transaction activation determining unit 4 determines that the value of the condition counter 33 of the second entry of the condition determination table 31 is "1". Therefore, control is returned to the transaction T3 without activating the transaction T4. In transaction T3, the transaction ends. When the transaction T3 ends, the occupied resources are released, and the resource occupation of the transaction T2 is started. As a result, the transaction T2 is released from the WAIT state without falling into a deadlock state, and can continue processing. FIG. 4 shows this operation.

【0028】図2に示す2装置間のデッドロックの場合
では、装置が2つの場合であるが、図5に示すように装
置が3つある場合でも、本発明は適用することが可能で
ある。図5の場合では、条件判定テーブル31の他装置
抑止トランザクション識別子37としてT5,抑止他装
置名称38としてS3を設定するように入力すれば、自
装置トランザクションT3から他装置S3上のトランザ
クションを起動するときに、条件カウンタ39の値が
“1”以上であればトランザクションT5の起動が抑止
され、デッドロックを防止することが可能となる。
In the case of a deadlock between two devices shown in FIG. 2, there are two devices, but the present invention can be applied even when there are three devices as shown in FIG. . In the case of FIG. 5, if T5 is set as the other device-suppressed transaction identifier 37 of the condition determination table 31 and S3 is set as the suppressed other device name 38, a transaction on the other device S3 is started from the own device transaction T3. At this time, if the value of the condition counter 39 is “1” or more, the activation of the transaction T5 is suppressed, and deadlock can be prevented.

【0029】次に本発明の第2の実施例について図面を
参照して詳細に説明する。
Next, a second embodiment of the present invention will be described in detail with reference to the drawings.

【0030】図1を参照すると、トランザクション起動
判定部4は、条件判定テーブル31の第2エントリの条
件カウンタ39の値が“1”である時、すなわちトラン
ザクション起動抑止を行う場合に、他装置へのトランザ
クション起動要求を行った自装置上のトランザクション
に制御を戻さずに、自装置上のトランザクションを一度
異常終了させる。以上終了することによって、そのトラ
ンザクションが占有している資源を開放した後に、その
トランザクションを再起動させる。この動作により、デ
ッドロックを防止できるとともに、抑止されたトランザ
クションを自動的に再開することが可能となる。この動
作を説明したものが図6である。図6では、トランザク
ションT3からトランザクションT4を一度目に起動す
るときにはトランザクション起動判定部4によって抑止
され、トランザクションT3が再起動された後の状態を
表している。
Referring to FIG. 1, when the value of the condition counter 39 of the second entry of the condition judgment table 31 is "1", that is, when the transaction start is inhibited, the transaction start judging unit 4 sends the request to another device. The transaction on the own device is abnormally terminated once without returning control to the transaction on the own device that issued the transaction start request. By ending the above, the transaction is restarted after releasing the resources occupied by the transaction. By this operation, it is possible to prevent a deadlock and automatically restart a suppressed transaction. FIG. 6 illustrates this operation. FIG. 6 shows a state after the transaction T3 is restarted for the first time from the transaction T3 and is suppressed by the transaction startup determining unit 4, and the transaction T3 is restarted.

【0031】再起動後、トランザクションT2が終了
し、資源開放されれば、トランザクションT3が資源を
占有でき、トランザクションT4を起動する。トランザ
クションT2終了時には、トランザクション制御部3に
より図3の条件判定テーブル31の第2エントリの条件
カウンタ39の値は“1”減算されて“0”になる。こ
のため、トランザクションT4を起動時にトランザクシ
ョン起動判定部4では、トランザクション抑止しないた
め、トランザクションT4は起動される。
After the restart, if the transaction T2 ends and the resources are released, the transaction T3 can occupy the resources and activate the transaction T4. At the end of the transaction T2, the value of the condition counter 39 of the second entry of the condition determination table 31 in FIG. Therefore, when the transaction T4 is activated, the transaction activation determination unit 4 activates the transaction T4 because the transaction is not suppressed.

【0032】次に本発明の第3の実施例について図面を
参照して詳細に説明する。
Next, a third embodiment of the present invention will be described in detail with reference to the drawings.

【0033】図1を参照すると、登録部1は、前述のト
ランザクション情報とともにデッドロック発生時に異常
終了させるトランザクションとして前提条件となるトラ
ンザクションの方を異常終了させるパラメータを入力す
る。このパラメータが入力されたときは、図7に示す条
件判定テーブル31のエントリ32の中の異常終了フラ
グ40をオンにする。
Referring to FIG. 1, the registration unit 1 inputs a parameter for abnormally terminating a prerequisite transaction as a transaction to be abnormally terminated when a deadlock occurs, together with the transaction information described above. When this parameter is input, the abnormal end flag 40 in the entry 32 of the condition determination table 31 shown in FIG. 7 is turned on.

【0034】トランザクション起動判定部4は、トラン
ザクション抑止条件が成立する場合は、条件判定テーブ
ル31の該当するエントリ32の中の異常終了フラグ4
0がオンである場合は、該当エントリ32の中の自装置
条件トランザクション識別子33を持つトランザクショ
ンを強制的に異常終了させる。図2に示す2装置間のデ
ッドロックの場合では、トランザクションT3からトラ
ンザクションT4を起動させた時に、トランザクション
T2の方が異常終了し、その異常終了結果がトランザク
ションT1に通知される。トランザクションT1は終了
し占有していた資源を開放するので、トランザクション
T4は資源占有待ちにならず、デッドロック状態を防止
することができる。
When the transaction suppression condition is satisfied, the transaction activation determination unit 4 determines whether the abnormal termination flag 4 in the corresponding entry 32 of the condition determination table 31 is satisfied.
If 0 is on, the transaction having the own device condition transaction identifier 33 in the entry 32 is forcibly abnormally terminated. In the case of the deadlock between the two devices shown in FIG. 2, when the transaction T4 is started from the transaction T3, the transaction T2 ends abnormally, and the abnormal end result is notified to the transaction T1. Since the transaction T1 terminates and releases the occupied resources, the transaction T4 does not wait for resource occupation and can prevent a deadlock state.

【0035】次に本発明の第4の実施例について図面を
参照して詳細に説明する。図2に示す2装置間のデッド
ロックの場合で、トランザクションT3が資源占有して
いない場合はデッドロックにはならない。しかし、前述
の実施例では、資源占有をしていないトランザクション
に関してもトランザクション起動を抑止してしまう。予
め対象となる資源が判明している場合は、資源占有の有
無を考慮して、トランザクション起動判定を行った方
が、システムのスループットの向上につながる。このよ
うに、資源占有の有無を考慮した実施例を次に説明す
る。図1に示される登録部1は、トランザクション関係
とともに資源との関係を入力する。
Next, a fourth embodiment of the present invention will be described in detail with reference to the drawings. In the case of the deadlock between the two devices shown in FIG. 2, if the transaction T3 does not occupy resources, the deadlock does not occur. However, in the above-described embodiment, transaction activation is also suppressed for a transaction that does not occupy resources. If the target resource is known in advance, it is better to make a transaction start determination in consideration of whether or not the resource is occupied, which leads to an improvement in system throughput. An embodiment in which the presence / absence of resource occupancy is thus considered will be described below. The registration unit 1 shown in FIG. 1 inputs a relationship with a resource together with a transaction relationship.

【0036】自装置上のトランザクションから他装置の
トランザクション起動を抑止する場合、自装置上のトラ
ンザクションが既に占有している資源の名称を入力す
る。
In order to suppress the activation of the transaction of another device from the transaction on the own device, the name of the resource already occupied by the transaction on the own device is input.

【0037】デッドロック情報記憶部は、トランザクシ
ョン関係とともに資源との関係を記憶する。この場合の
条件判定テーブル31の例を図8に示す。エントリ32
の中に資源名41を設定する。
The deadlock information storage unit stores a transaction relationship and a resource relationship. FIG. 8 shows an example of the condition determination table 31 in this case. Entry 32
Is set to the resource name 41.

【0038】トランザクション起動判定部4は、図8に
おいて条件判定テーブル31の該当するエントリ32の
中の条件カウンタ39の値が“1”以上である場合で、
かつ、資源名41が既に自装置抑止トランザクション識
別子36を持つトランザクションで占有されている場
合、他装置のトランザクション起動を抑止する。
In the case where the value of the condition counter 39 in the corresponding entry 32 of the condition judgment table 31 is "1" or more in FIG.
If the resource name 41 is already occupied by a transaction having the own device suppression transaction identifier 36, the activation of the transaction of another device is suppressed.

【0039】図2で示す2装置間のデッドロックの場合
で説明すると、資源R1をトランザクションT3が既に
占有しているかどうかを、トランザクション起動判定部
4で判定を行う。このために、資源R1は登録部1によ
って登録され、図8の条件判定テーブル31の第2エン
トリの資源名41に設定される。
In the case of a deadlock between the two devices shown in FIG. 2, the transaction start determination unit 4 determines whether or not the transaction T3 has already occupied the resource R1. For this purpose, the resource R1 is registered by the registration unit 1 and set in the resource name 41 of the second entry of the condition determination table 31 in FIG.

【0040】[0040]

【発明の効果】本発明は、分散処理システムにおいて、
トランザクション起動を抑止することにより、デッドロ
ックの防止を行うことが可能となる。加えて、本発明
は、トランザクションを自動的に抑止し、資源を一旦開
放した後に、そのトランザクションを自動的に再開始が
可能であり、また、抑止するトランザクションを選択す
ることも可能である。
According to the present invention, in a distributed processing system,
By suppressing transaction activation, it is possible to prevent deadlock. In addition, the present invention can automatically suppress a transaction and, after releasing resources once, automatically restart the transaction, and can also select a transaction to be suppressed.

【0041】本発明は、資源占有の有無によりトランザ
クション起動抑止を制御することが可能となり、これら
の効果によって、システムのスループットが向上すると
いう結果をもたらす。
According to the present invention, it is possible to control the suppression of transaction startup depending on whether or not resources are occupied. These effects result in an improvement in system throughput.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明の一実施例を示す図。FIG. 1 is a diagram showing one embodiment of the present invention.

【図2】分散システムにおける2装置間のデッドロック
例を示す図。
FIG. 2 is a diagram illustrating an example of a deadlock between two devices in a distributed system.

【図3】デッドロック情報記憶部の一例を示す図。FIG. 3 is a diagram illustrating an example of a deadlock information storage unit.

【図4】デッドロック抑止動作例を説明するための図。FIG. 4 is a diagram for explaining an example of a deadlock suppression operation.

【図5】分散システムにおける3装置間のデッドロック
例を説明するための図。
FIG. 5 is a diagram for explaining an example of deadlock between three devices in a distributed system.

【図6】トランザクション抑止後の再開動作例を説明す
るための図。
FIG. 6 is a diagram illustrating an example of a restart operation after a transaction is suppressed.

【図7】抑止トランザクション選択機能を付加したデッ
ドロック情報記憶部の一例を示す図。
FIG. 7 is a diagram illustrating an example of a deadlock information storage unit to which a suppression transaction selection function is added.

【図8】資源占有の有無による抑止制御を負荷したデッ
ドロック情報記憶部の一例を示す図。
FIG. 8 is a diagram illustrating an example of a deadlock information storage unit on which suppression control based on whether or not resources are occupied is loaded.

【符号の説明】[Explanation of symbols]

1 登録部 2 デッドロック情報記憶部 3 トランザクション制御部 4 トランザクション起動判定部 5 入力装置 6 トランザクション 7 自装置 8 他装置 REFERENCE SIGNS LIST 1 registration unit 2 deadlock information storage unit 3 transaction control unit 4 transaction start determination unit 5 input device 6 transaction 7 own device 8 other device

Claims (4)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 並列実行を行うとデッドロックになりう
る複数のトランザクションのうち、起動抑止したいトラ
ンザクション情報と抑止時の条件を入力装置から入力
し、登録する登録手段と、 デッドロックに関係するトランサグションをこの登録手
段から入力し、対象となるトランザクションの情報や状
態を記憶するデッドロック情報記憶手段と、 あるトランザクションから別のトランザクションを起動
する時に該デッドロック情報記憶手段を参照して、トラ
ンザクションの起動判定を行い、条件が成立する場合は
トランザクション起動を抑止するトランザクション起動
判定手段とトランザクションの起動や終了時に、デッド
ロック情報記憶手段の状態を変更するトランザクション
制御手段とを有することを特徴とする分散処理システム
におけるデッドロック回避方式。
1. A registration unit for inputting and registering, from an input device, transaction information whose activation is to be suppressed and conditions for suppressing the transaction, among a plurality of transactions which may be deadlocked when the parallel execution is performed, and a transaction related to the deadlock. A deadlock information storage means for inputting a segment from the registration means and storing information and a state of a target transaction; and referring to the deadlock information storage means when starting another transaction from one transaction, and And a transaction control unit that changes the state of the deadlock information storage unit when the transaction is started or terminated when the condition is satisfied. Distributed processing system Deadlock avoidance scheme that.
【請求項2】 前記トランザクション起動判定手段は、
トランザクション起動抑止を行うとともに、トランザク
ションに制御を戻さずに、トランザクション起動要求を
行ったトランザクションを一度異常終了させ、そのトラ
ンザクションが占有している資源を開放した後に、その
トランザクションを再起動させることを特徴とする請求
項1記載の分散処理システムにおけるデッドロック回避
方式。
2. The method according to claim 2, wherein
In addition to suppressing transaction startup, without returning control to the transaction, the transaction that made the transaction startup request is terminated abnormally once, the resources occupied by the transaction are released, and then the transaction is restarted. 2. A method for avoiding deadlock in a distributed processing system according to claim 1.
【請求項3】 前記登録手段は、前記トランザクション
情報に加えてデッドロック発生時に異常終了させるトラ
ンザクションを入力し、 前記デッドロック情報記憶手段は、デッドロック発生時
に異常終了させるトランザクションを記憶し、 前記トランザクション起動判定手段は、条件が成立する
場合、前記登録手段によって入力された異常終了となる
トランザクをデッドロック情報記憶手段から得て、その
トランザクションを終了させることを特徴とする請求項
1記載の分散処理システムにおけるデッドロック回避方
式。
3. The registration means inputs, in addition to the transaction information, a transaction to be abnormally terminated when a deadlock occurs. The deadlock information storage means stores a transaction to be abnormally terminated when a deadlock occurs. 2. The distributed processing according to claim 1, wherein, if the condition is satisfied, the activation determining unit obtains, from the deadlock information storage unit, the transaction which is input abnormally by the registration unit and terminates the transaction. Deadlock avoidance method in the system.
【請求項4】 前記登録手段は、前記トランザクション
情報とともに、トランザクションを抑止する条件とし
て、トランザクションが占有している資源との関係を入
力し、 前記デッドロック情報記憶手段は、トランザクション情
報とともに資源との関係を記憶し、 前記トランザクション起動判定手段は、資源とトランザ
クションと関係を判定条件とすることを特徴とする請求
項1記載の分散処理システムにおけるデッドロック回避
方式。
4. The registration unit inputs a relationship with a resource occupied by the transaction as a condition for suppressing the transaction together with the transaction information, and the deadlock information storage unit inputs the relationship with the resource together with the transaction information. 2. The deadlock avoidance method in a distributed processing system according to claim 1, wherein a relationship is stored, and said transaction activation determination means uses a relationship between a resource and a transaction as a determination condition.
JP31887093A 1993-12-20 1993-12-20 Deadlock avoidance method in distributed system Expired - Fee Related JP2621777B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP31887093A JP2621777B2 (en) 1993-12-20 1993-12-20 Deadlock avoidance method in distributed system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP31887093A JP2621777B2 (en) 1993-12-20 1993-12-20 Deadlock avoidance method in distributed system

Publications (2)

Publication Number Publication Date
JPH07175764A JPH07175764A (en) 1995-07-14
JP2621777B2 true JP2621777B2 (en) 1997-06-18

Family

ID=18103891

Family Applications (1)

Application Number Title Priority Date Filing Date
JP31887093A Expired - Fee Related JP2621777B2 (en) 1993-12-20 1993-12-20 Deadlock avoidance method in distributed system

Country Status (1)

Country Link
JP (1) JP2621777B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100317229B1 (en) * 1998-11-23 2002-02-28 오길록 Mutual Exclusion of Locked Standby Information for Deadlock Detection
KR100319763B1 (en) * 1999-12-23 2002-01-05 오길록 Method of detection and resolution thread-combined-deadlock in a thread pool based transaction processing system
KR100327113B1 (en) * 1999-12-24 2002-03-06 오길록 Method for detecting shared resource usage errors in distributed systems
CN113205422A (en) * 2021-05-28 2021-08-03 中国工商银行股份有限公司 Transaction deadlock testing method and device

Also Published As

Publication number Publication date
JPH07175764A (en) 1995-07-14

Similar Documents

Publication Publication Date Title
CN109828847B (en) Block chain-based lock processing method, device, computer equipment and storage medium
JP4241940B2 (en) A method for doing transactions in a distributed database.
US6397381B1 (en) System and method for repairing a damaged application program
JP3707273B2 (en) Process control system
CN106844014B (en) Method and device for realizing suspension prevention of distributed transactions
JPH05173988A (en) Decentralized processing system and transaction processing system applied to the same
US7668831B2 (en) Assigning unique identification numbers to new user accounts and groups in a computing environment with multiple registries
JPH0831047B2 (en) Apparatus and method for inter-partition control in a logical partition data processor
EP0457159B1 (en) Control method for preventing incorrect reset of common resource and multicomputer system executing the method
EP2357560B1 (en) Method and system for managing by a controller a generic data lock to a data object
JP2621777B2 (en) Deadlock avoidance method in distributed system
CN116489179A (en) Service processing system and service processing method
CN116302623A (en) Idempotent control method, device, equipment and storage medium based on interaction request
US20220116213A1 (en) Method and apparatus for managing cryptographic keys
US9286244B2 (en) Method and device for monitoring an unauthorized memory access of a computing device, in particular in a motor vehicle
JP6802764B2 (en) Arithmetic logic unit
CN113703831A (en) Method, device, equipment and medium for realizing service idempotency
JPH0822393A (en) Dynamic loading controller
CN113342511A (en) Distributed task management system and method
US20050198005A1 (en) Systems and methods for controlling access to an object
JP2000047875A (en) Class loader
US7555614B1 (en) Methods, systems, and computer program products for preventing concurrent execution of conflicting software operations on the same and different storage processors having access to a common storage medium while avoiding deadlocks
CN114880116A (en) Multi-version operation method, electronic equipment and storage medium
JP2001306380A (en) Two-phase commitment evading system and its program recording medium
JP2868501B1 (en) How to avoid processing stop

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 19970128

LAPS Cancellation because of no payment of annual fees