JPH0452492B2 - - Google Patents

Info

Publication number
JPH0452492B2
JPH0452492B2 JP59061544A JP6154484A JPH0452492B2 JP H0452492 B2 JPH0452492 B2 JP H0452492B2 JP 59061544 A JP59061544 A JP 59061544A JP 6154484 A JP6154484 A JP 6154484A JP H0452492 B2 JPH0452492 B2 JP H0452492B2
Authority
JP
Japan
Prior art keywords
task
deadlock
reprocessing
processing
waiting
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 - Lifetime
Application number
JP59061544A
Other languages
Japanese (ja)
Other versions
JPS60205634A (en
Inventor
Akira Myajima
Toshihiko Takahashi
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 JP6154484A priority Critical patent/JPS60205634A/en
Publication of JPS60205634A publication Critical patent/JPS60205634A/en
Publication of JPH0452492B2 publication Critical patent/JPH0452492B2/ja
Granted legal-status Critical Current

Links

Description

【発明の詳細な説明】[Detailed description of the invention]

<技術分野> 本発明は、複数のタスクが複数のフアイル資源
を共有して処理を実行し、デツドロツク自動解除
方式を有するシステムにおけるデツドロツク発生
時の処理方式に関する。 <従来技術> 従来、複数のタスクが複数のフアイル資源を共
有して処理を実行するデータ処理システムでは、
資源単位の排他制御によりタスク間でデツドロツ
ク状態が発生すると、フアイル更新とともに出力
されている更新前のデータである履歴情報により
バツクアウト処理を行ない、デツドロツク自動解
除を行なつて、即時に自タスクの処理の再実行を
行なつている。通常は上記のような方式によつて
デツドロツクが発生しても再実行をすることによ
り処理が完了している。ところが、第1図に示す
ように複数のタスクで複数のフアイル資源を異な
る順序でアクセスする処理の場合、デツドロツク
自動解除を行ない再処理をしても、複数のタスク
間で再びデツドロツク状態となる。こうなると、
デツドロツクおよび再処理が複数のタスク間で発
生し、処理が完了しないことになる。 上記の問題点を第1図を参照しながら具体的に
説明する。第1図において、タスクt1,t2が複数
のフアイル資源R1,R2,…Rnをタスクt1では
P11,P12,…の順序でタスクt2ではP21,P22
…,の順序で、それぞれ逆にアクセスする場合、
タスクt1がフアイル資源Rmまでアクセスし排他
保持したとき、タスクt2がフアイル資源Rnから
アクセスしフアイル資源Rmをアクセスすると、
タスクt2は資源単位の排他制御により待ちとな
る。そこでタスクt1がフアイル資源Rn+1をアクセ
スしようとすると、フアイル資源Rn+1はタスクt2
が排他的に保持しているデツドロツクとなり、デ
ツドロツク自動解除が行なわれ再処理を行ない、
タスクt1は再びフアイル資源R1からアクセスす
る。タスクt2は待ちが解除され処理が進むことに
なる。タスクt2がフアイル資源Rn-〓をアクセス
し、排他的に保持したとき、タスクt1がフアイル
資源Rn-〓にアクセスすると待ちとなる。その後、
タスクt2がフアイル資源Rn--1をアクセスすると
フアイル資源Rn--1はタスクt1が排他的に保持し
ているためデツドロツクとなり、タスクt2ではデ
ツドロツク自動解除が行なわれ、再処理を行な
う。タスクt2は再びフアイル資源Roからアクセス
することになる。今度はフアイル資源Rn+〓の資
源で同様なデツドロツクが発生する。このように
複数のタスクt1,t2間でデツドロツクおよび再処
理が繰り返されることになる。こうなつたとき、
従来は複数タスクt1,t2の処理のスループツトが
下がるだけでなく、タスクt1,t2のいずれかの処
理を強制的に止め、再び起動しなければならなか
つた。 <発明の目的> したがつて、本発明の目的は、複数のタスクが
複数のフアイル資源を共有して処理を実行しデツ
ドロツク自動解除方式を有するデータ処理システ
ムにおいて、資源単位の排他制御によりタスク間
でデツドロツク状態が発生したとき、デツドロツ
クおよび再処理が繰り返されて処理が完了しない
ような状態を解決した、デツドロツク発生時の遅
延再処理方式を提供することにある。 <発明の構成> 本発明は、タスクごとに再処理回数および待ち
タスクを発生させるタスクのリンク情報を記録す
る再処理管理表を設け、タスク間でデツドロツク
状態が発生しデツドロツク自動解除処理が完了す
ると前記再処理管理表の再処理回数をカウントア
ツプし、この再処理回数が所定値になると待ちタ
スクと待ちを発生させるタスクのリンク情報を登
録し、待ちタスクを待状態にし、待ちを発生させ
たタスクの処理が終了し資源を解放したら前記リ
ンク情報により待ちタスクを起動させ、再処理を
行なわせるようにしたものである。 <実施例> 以下、本発明の一実施例を図面を参照しながら
説明する。第2図は、本発明の第1の実施例で、
2つのタスクt1,t2の処理の時間的な流れを示し
ている。タスクt1,t2が複数のフアイルアクセス
処理P1o,P2oをしているとき、タスクt1において
デツドロツク状態Dlが発生すると、タスクt1にお
いてはデツドロツク自動解除処理Boが行なわれ
る。デツドロツク自動解除処理Boが完了すると、
再処理管理表のタスク識別子Tidが再処理回数Nr
(処理開始時は初期値0)のうちタスクt1の分を
カウントアツプする。そしてタスク1の再処理回
数Nrは所定値1に等しいので、待ちタスクと待
ちを発生させるタスクのリンク情報Tlkが再処理
管理表に登録され、待ちタスクであるタスクt1
待ち状態W1になる。次の表−1はこの時の再処
理管理表を示している。
<Technical Field> The present invention relates to a processing method when a deadlock occurs in a system in which a plurality of tasks execute processing by sharing a plurality of file resources and has an automatic deadlock release method. <Prior art> Conventionally, in a data processing system in which multiple tasks share multiple file resources to execute processing,
When a deadlock state occurs between tasks due to exclusive control on a resource basis, backout processing is performed using the history information that is the data before the update that is output with the file update, the deadlock is automatically released, and the current task is immediately processed. is being re-executed. Normally, even if a deadlock occurs using the method described above, the process can be completed by re-executing. However, in the case of processing in which multiple tasks access multiple file resources in different orders as shown in FIG. 1, even if automatic deadlock release is performed and reprocessing is performed, deadlock will again occur between the multiple tasks. This happens when,
Deadlocks and reprocessing occur between multiple tasks, resulting in incomplete processing. The above problem will be specifically explained with reference to FIG. In Figure 1, tasks t 1 and t 2 store multiple file resources R 1 , R 2 ,...Rn in task t 1.
In the order of P 11 , P 12 , ... , P 21 , P 22 ,
…, when accessing in reverse order,
When task t 1 accesses file resource Rm and holds it exclusively, when task t 2 accesses from file resource Rn and accesses file resource Rm,
Task t2 is placed in a waiting state due to exclusive control of each resource. Then, when task t 1 attempts to access file resource R n+1 , file resource R n+1 is accessed by task t 2.
becomes an exclusively held deadlock, automatically releases the deadlock, and performs reprocessing.
Task t 1 again accesses file resource R 1 . Task t2 is released from the waiting state and processing proceeds. When task t 2 accesses file resource R n- 〓 and holds it exclusively, task t 1 becomes waiting when it accesses file resource R n- 〓. after that,
When task t 2 accesses file resource R n--1 , file resource R n--1 is held exclusively by task t 1 , so it becomes deadlocked, and task t 2 automatically releases the deadlock. Perform reprocessing. Task t 2 will access file resource R o again. This time, a similar deadlock occurs with the file resource R n+ 〓. In this way, deadlock and reprocessing are repeated between multiple tasks t 1 and t 2 . When this happens,
Conventionally, not only the throughput of processing multiple tasks t 1 and t 2 was reduced, but also the processing of either task t 1 or t 2 had to be forcibly stopped and restarted. <Object of the Invention> Therefore, an object of the present invention is to provide a data processing system in which a plurality of tasks execute processing by sharing a plurality of file resources and which has an automatic deadlock release method, by controlling intertasks by exclusive control on a resource basis. To provide a delayed reprocessing system when a deadlock occurs, which solves the problem that when a deadlock occurs, deadlock and reprocessing are repeated and the process is not completed. <Structure of the Invention> The present invention provides a reprocessing management table that records the number of times of reprocessing and link information of tasks that generate waiting tasks for each task, and when a deadlock state occurs between tasks and automatic deadlock release processing is completed. The number of times of reprocessing in the reprocessing management table is counted up, and when this number of reprocessing reaches a predetermined value, the link information of the waiting task and the task that causes waiting is registered, the waiting task is placed in a waiting state, and waiting is generated. When the processing of the task is completed and the resources are released, the waiting task is activated by the link information and reprocessed. <Example> An example of the present invention will be described below with reference to the drawings. FIG. 2 shows a first embodiment of the present invention,
It shows the temporal flow of processing of two tasks t 1 and t 2 . When tasks t 1 and t 2 are performing a plurality of file access processes P 1o and P 2o , when a deadlock state D l occurs in task t 1 , automatic deadlock release processing Bo is performed in task t 1 . When the automatic de-locking process Bo is completed,
The task identifier T id in the reprocessing management table is the number of reprocessing times N r
(The initial value is 0 at the start of processing), which is counted up for task t1 . Since the reprocessing count Nr of task 1 is equal to the predetermined value 1, the link information T lk between the waiting task and the task that causes the waiting is registered in the reprocessing management table, and task t 1 , which is the waiting task, is placed in the waiting state W 1 become. The following Table 1 shows the reprocessing management table at this time.

【表】 待ちを発生させたタスクt2の処理P2oが完了す
ると、表−1の再処理管理表のリンク情報T1kを
再び参照し、リンクがあるので該タスクt1にイベ
ントIwを発行する。タスクt1はイベントIwによ
り待ち状態W1が解除され起動されて再処理P1r
行なう。このようにして再処理を遅延させること
によつて第1図のような処理のときにデツドロツ
クが発生しても、デツドロツクおよび再処理が繰
り返されることなく処理が完了する。 第3図は本発明の第2の実施例で2つのタスク
t1,t2の処理の時間的な流れを示している。タス
クt1,t2が複数のフアイルアクセス処理P1o,P2o
をしているとき、タスクt1においてデツドロツク
状態Dlが発生すると、タスクt1においてデツドロ
ツク自動解除処理Boが行なわれている。デツド
ロツク自動解除処理Boが完了すると、再処理管
理表のタスク識別子Tidが再処理回数Nr(処理開
始時は初期値0)のうちタスクt1の分をカウント
アツプする。そして、タスク1の再処理回数Nr
は所定値1に等しいので、待ちタスクと待ちを発
生させるタスクのリンク情報Tlkが再処理管理表
に登録され、待ちタスクであるタスクt1が待ち状
態W1になるとともにタイマ処理タスクtxに対し、
タイマセツトのイベントIsを発行する。このとき
のタイマ値は乱数によつて決定される。次の表−
2はこのときの再処理管理表を示している。
[Table] When the processing P 2o of the task t 2 that caused the wait is completed, the link information T1k in the reprocessing management table in Table 1 is referenced again, and since there is a link, an event Iw is issued to the task t 1 . . Task t 1 is released from the waiting state W 1 by event Iw, is activated, and performs reprocessing P 1r . By delaying the reprocessing in this manner, even if deadlock occurs during the processing as shown in FIG. 1, the processing is completed without repeating the deadlock and reprocessing. Figure 3 shows a second embodiment of the present invention with two tasks.
It shows the temporal flow of processing at t 1 and t 2 . Tasks t 1 and t 2 perform multiple file access processing P 1o and P 2o
When the deadlock state Dl occurs in the task t1 , the automatic deadlock release process Bo is performed in the task t1 . When the deadlock automatic release processing Bo is completed, the task identifier Tid in the reprocessing management table counts up the number of reprocessing times Nr (initial value 0 at the start of processing) for task t1 . And the number of reprocessing times for task 1 Nr
is equal to the predetermined value 1, the link information Tlk between the waiting task and the task that causes the waiting is registered in the reprocessing management table, and the waiting task, task t 1 , enters the waiting state W 1 , and the timer processing task tx is ,
Issues the timer set event Is. The timer value at this time is determined by a random number. The following table −
2 shows the reprocessing management table at this time.

【表】 セツトした時間が経過するとタイマ処理タスク
txからタスクt1に対してタイムアツプのイベント
Ieが発行され、タスクt1の待ち状態W1が解除さ
れ、起動されて再処理P1rが行なわれる。このよ
うにして再処理を遅延させることによつて、第1
図のような処理のときにデツドロツクが発生して
もデツドロツクおよび再処理とが繰り返されるこ
となく処理が完了する。 <発明の効果> 本発明は以上説明したように、複数のタスクが
複数のフアイル資源をアクセスするとき、資源単
位の排他制御によりデツドロツクが発生しても、
再処理を遅延することにより、デツドロツクおよ
び再処理の繰り返しを回避し、複数のタスクによ
る処理のスループツトを上げることができる。
[Table] When the set time elapses, the timer processing task
Time-up event from tx to task t 1
Ie is issued, the waiting state W1 of the task t1 is released, and the task t1 is activated to perform reprocessing P1r . By delaying reprocessing in this way, the first
Even if a deadlock occurs during the process shown in the figure, the process is completed without repeating the deadlock and reprocessing. <Effects of the Invention> As explained above, the present invention can prevent deadlock from occurring due to exclusive control in resource units when multiple tasks access multiple file resources.
By delaying reprocessing, deadlock and repeated reprocessing can be avoided and processing throughput with multiple tasks can be increased.

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

第1図はデツドロツク状態と再処理が繰り返さ
れる従来のデータ処理システムにおけるアクセス
順序例を示す図、第2図は本発明の第1の実施例
で、タスクt1,t2の処理の時間的な流れを示す
図、第3図は本発明の第2の実施例で、タスク
t1,t2の処理の時間的な流れを示す図である。 t1,t2:タスク、tx:タイマ処理タスク、P1o
P2o:フアイルアクセス処理、Dl:デツドロツ
ク、Bo:デツドロツク自動解除処理、W1:待
ち、Iw,Is,Ie:イベント、P1r:再処理。
FIG. 1 is a diagram showing an example of the access order in a conventional data processing system in which a deadlock state and reprocessing are repeated, and FIG. 2 is a diagram showing a first embodiment of the present invention. FIG. 3 is a diagram showing the flow of the task, and is a second embodiment of the present invention.
FIG. 3 is a diagram showing the temporal flow of processing at t 1 and t 2 ; t 1 , t 2 : task, t x : timer processing task, P 1o ,
P 2o : File access processing, Dl: Deadlock, Bo: Automatic deadlock release processing, W 1 : Wait, Iw, Is, Ie: Event, P 1r : Reprocessing.

Claims (1)

【特許請求の範囲】 1 複数のタスクが複数のフアイル資源を共有し
て処理を実行するデータ処理システムであつて、
フアイル資源共有のためにデツドロツク検出機構
を持つ資源単位の排他制御機構を備え、この排他
制御機構によりデツドロツク状態の発生を検出し
たときバツクアウトできるようにフアイル更新と
ともに更新前のデータを履歴情報として出力して
おき、タスク間でデツドロツク状態が発生する
と、上記更新前のデータによりバツクアウト処理
を行なつてフアイルを復元しタスクの占有資源を
解放するデツドロツク自動解除方式を備えるシス
テムにおいて、 タスクごとに再処理回数および待ちタスクと待
ちを発生させるタスクのリンク情報を記録する再
処理管理表を設け、タスク間でデツドロツク状態
が発生しデツドロツク自動解除処理が完了すると
前記再処理管理表の再処理回数をカウントアツプ
し、この再処理回数が所定値になると、待ちタス
クと待ちを発生させるタスクのリンク情報を登録
し、待ちタスクを待状態にし、待ちを発生させた
タスクの処理が終了し資源を解放したら前記リン
ク情報により待ちタスクを起動させ、再処理を行
なわせることを特徴とするデツドロツク発生時の
遅延再処理方式。
[Claims] 1. A data processing system in which multiple tasks share multiple file resources to execute processing,
It is equipped with an exclusive control mechanism for each resource that has a deadlock detection mechanism for file resource sharing, and when it detects the occurrence of a deadlock state, this exclusive control mechanism outputs the data before the update as history information along with file updates so that backup can be performed. In a system equipped with an automatic deadlock release method, when a deadlock state occurs between tasks, backout processing is performed using the data before the update, the file is restored, and the resources occupied by the task are released. A reprocessing management table is provided to record the link information of the waiting task and the task causing the waiting task, and when a deadlock state occurs between tasks and the automatic deadlock release process is completed, the number of reprocessings in the reprocessing management table is counted up. , when this reprocessing count reaches a predetermined value, the link information of the waiting task and the task that causes the wait is registered, the waiting task is placed in the waiting state, and when the processing of the task that caused the wait is completed and the resources are released, the link information is registered. A delayed reprocessing method when a deadlock occurs, which is characterized by activating a waiting task based on information and causing it to perform reprocessing.
JP6154484A 1984-03-29 1984-03-29 System for delay reprocessing in deadlock occurrence Granted JPS60205634A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6154484A JPS60205634A (en) 1984-03-29 1984-03-29 System for delay reprocessing in deadlock occurrence

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6154484A JPS60205634A (en) 1984-03-29 1984-03-29 System for delay reprocessing in deadlock occurrence

Publications (2)

Publication Number Publication Date
JPS60205634A JPS60205634A (en) 1985-10-17
JPH0452492B2 true JPH0452492B2 (en) 1992-08-24

Family

ID=13174164

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6154484A Granted JPS60205634A (en) 1984-03-29 1984-03-29 System for delay reprocessing in deadlock occurrence

Country Status (1)

Country Link
JP (1) JPS60205634A (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07271617A (en) * 1994-03-30 1995-10-20 Nec Corp Recovery system with deadlock recurrence preventing function

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5443644A (en) * 1977-09-13 1979-04-06 Fujitsu Ltd Processing system for deadlock automatic release at exclusive control time

Also Published As

Publication number Publication date
JPS60205634A (en) 1985-10-17

Similar Documents

Publication Publication Date Title
US5274809A (en) Task execution control method for a multiprocessor system with enhanced post/wait procedure
CN101236509B (en) System and method for managing locks
US10140329B2 (en) Processing transactions in a distributed computing system
US8140483B2 (en) Transaction log management
CN101089857A (en) Internal store data base transaction method and system
WO1998003913A1 (en) Method and apparatus for synchronizing transactions in a distributed system
JPH077379B2 (en) Interrupt selection method for multi-processing system
CN106503001A (en) Data-updating method and device in distributed type assemblies environment
EP0343646B1 (en) Task execution control method for a multiprocessor system with enhanced post/wait procedure
JPH0452492B2 (en)
US6427090B1 (en) Requalification controller for durables
CN115292092B (en) Data rollback method, device, equipment and storage medium thereof
JPH04192021A (en) Collective device sharing control device
KR19980049353A (en) How to recover distributed transactions
CN121233240B (en) Data processing methods, apparatus, electronic devices and storage media
CN109710690B (en) Service driving calculation method and system
JP3422504B2 (en) Exclusive control method between tasks
JP3005397B2 (en) Deadlock frequent automatic avoidance method
US6453323B1 (en) Resolving long-busy conditions for synchronized data sets
CN113296966B (en) Data processing method and device
JPH0527993A (en) Deadlock detection processing method
CN118260296A (en) Transaction processing method, control device, storage medium and equipment for multiple data sources
JP2560514B2 (en) Deadlock suppression method
CN120762967A (en) Fault-tolerant method, device, electronic device, and storage medium for restarting an autonomous driving process
CN121277636A (en) Script dynamic scheduling and interrupt processing method