JPH03174633A - Multi-task control system - Google Patents

Multi-task control system

Info

Publication number
JPH03174633A
JPH03174633A JP1313416A JP31341689A JPH03174633A JP H03174633 A JPH03174633 A JP H03174633A JP 1313416 A JP1313416 A JP 1313416A JP 31341689 A JP31341689 A JP 31341689A JP H03174633 A JPH03174633 A JP H03174633A
Authority
JP
Japan
Prior art keywords
task
state
counter
tasks
deadlock
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.)
Pending
Application number
JP1313416A
Other languages
Japanese (ja)
Inventor
Yasuyuki Harada
原田 耕之
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 Solution Innovators Ltd
Original Assignee
NEC Solution Innovators 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 NEC Solution Innovators Ltd filed Critical NEC Solution Innovators Ltd
Priority to JP1313416A priority Critical patent/JPH03174633A/en
Publication of JPH03174633A publication Critical patent/JPH03174633A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To eliminate the need for the monitoring job of an operator by providing a deadlock detecting function on the task control function of an operating system. CONSTITUTION:A task group control block TGCB 121 includes a task counter 1211 which shows the number of tasks that are started and not finished yet and a deadlock detection counter 1212 which shows the number of tasks of a practicable state or an executing state. Whether the state of the counter 1212 is '0' or not is decided, and when it is '0' it means that all tasks that are not finished yet are kept waiting and a deadlock state is detected for these unfinished tasks. In this case, the tasks kept waiting are never practicable again and therefore finished forcibly by an operating system. Thus the monitoring jobs of an operator can be omitted.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、情報処理システムにかけるマルチタスク制御
方式に関し1%に一つのジョブe!成する複数タスク間
のデッドロックを検出できるマルチタスク制御方式に関
する。
[Detailed Description of the Invention] [Industrial Field of Application] The present invention relates to a multi-task control method for an information processing system. This invention relates to a multitask control method that can detect deadlocks between multiple tasks.

〔従来の技術〕[Conventional technology]

情報処理におけるマルチタスク処理では、一つのジョブ
を構成する複数タスク間での排他制御および同期化制御
が頻繁に行われる。しかしながら。
In multitask processing in information processing, exclusive control and synchronization control are frequently performed between multiple tasks that constitute one job. however.

排他制御および同期化制御にグログラムミスがあると、
そのマルチタスク処理プログラム全体がストール状態(
デッドロック状態)になることがある。
If there is a programmatic error in exclusive control or synchronization control,
The entire multitasking program is stalled (
(deadlock situation) may occur.

従来のシステムでは、マルチタスク処理プログラムの排
他制御、同期化制御のプログラムミスにより発生するデ
ッドロックを検出する手段がなかった。そのため、7′
″クドロツクが発生しているかどうかをオペレータが判
断し、オ槓レータの人力するコマンドによシブラドロッ
クが発生したマルチタスク処理プログラム全体を強制終
了させていた。
In conventional systems, there was no means to detect deadlocks caused by program errors in exclusive control or synchronization control of multitasking programs. Therefore, 7'
``The operator determined whether or not a black lock had occurred, and the entire multitasking program in which the black lock occurred was forcibly terminated using a manual command from the operator.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

上述のように、システムにマルチタスク処理グロダラム
のデッドロック状態を検出する手段がないため、オペレ
ータがデッドロック状態かどうかを判断しなければなら
ず、また、対処もオペレータが行わなければならないた
め、手間と時間がかかるという問題があった。
As mentioned above, the system does not have a means to detect a deadlock situation in multitasking Grodarum, so the operator must determine whether or not there is a deadlock situation, and the operator must also take action. The problem was that it took time and effort.

〔課題を解決するための手段及び作用〕本発明は。[Means and effects for solving the problems] The present invention has the following features.

マルチタスクジョブを構成する各々のタスクの実行状態
から、待機状態、および待機状態から実行状態への状態
遷移が、前記ジョブ内の他のタスクの実行に起因して発
生する事象にのみ依存するマルチタスクジョブにかいて
、一つのジョブヲ構成する複数タスクの共通領域に、実
行可能タスク数を保持するカウンタを有し、タスク生成
時、およびタスクが待機状態から実行可能状態となる時
、および実行状態から待機状態となる時、およびタスク
の実行終了時、に前記カウンタを更新する手段と、該更
新結果が示す実行タスク数がOであることを検出する手
段とを有する。
A multitasking job in which the state transitions of each task constituting a multitask job from the execution state to the standby state and from the standby state to the execution state depend only on events that occur due to the execution of other tasks within the job. A task job has a counter that holds the number of executable tasks in the common area of multiple tasks that make up one job, and when the task is created, when the task changes from the standby state to the executable state, and when the task is in the execution state. and means for detecting that the number of executed tasks indicated by the updated result is O.

本発明によれば、システムにデッドロック状態の監視手
段として、実行可能タスク数カウンタを備えることによ
って、オペレータの監視作業を不要とすることができる
According to the present invention, by providing the system with an executable task number counter as deadlock monitoring means, it is possible to eliminate the need for operator monitoring work.

〔実施例〕〔Example〕

本発明について図面を参照して説明する。 The present invention will be explained with reference to the drawings.

なか、本明細書で使用する「タスクの待機状態」とは、
該タスクが実行可能状態になるために他のタスクの実行
に依存するような状態をいう。(I10待ち等は含まな
い) 81図は1本発明の一実施例を説明するための構成図で
ある。
As used in this specification, "task standby state" means
A state in which a task depends on the execution of another task in order to become executable. (I10 wait etc. are not included) FIG. 81 is a configuration diagram for explaining one embodiment of the present invention.

同図にかいて、主記憶装置1はシステム領域11とユー
ザ領域12に分けられる。
In the figure, the main storage device 1 is divided into a system area 11 and a user area 12.

システム領域11には、タスクの実行を管理するための
実行待行列111.待機状態のタスクを管理する待機中
待行列112がある。
The system area 11 includes an execution queue 111 for managing task execution. There is a waiting queue 112 that manages waiting tasks.

またユーザ領域12はさらに、同一マルチタスクジョブ
グから共通にアクセスされるタスクグループ共通領域と
、タスク毎に用意されるタスク個別領域とに分けられる
The user area 12 is further divided into a task group common area that is commonly accessed from the same multitasking job group, and a task individual area that is prepared for each task.

タスクグループ共通領域には、マルチタスクプログラム
の制御情報の集シであるTGCB (TASKGROU
P C0NTR0L BLOCK ) 121 、タス
ク間の同期を取るためのセマフオ123がある。TGC
B 121には、起動されて実行を終了していないタス
クの数を表わすタスクカウンタ1211と、実行可能状
態lたは実行状態のタスク数を表わすデッドロック検出
カウンタ1212とが含1れる。TGCB 121は、
マルチタスクプログラムの実行開始前にオペレーティン
グシステムによシ初期設定され、特にタスクカウンタ1
211よびデッドロック検出カウンタ1212には、初
期設定値として「0」がセットされる。セマフオ123
には、イベントの状態を表わすステータスワード123
1.待機中待行列112へのポインタ1232が台筐れ
る。
The task group common area contains TGCB (TASKGROU), which is a collection of control information for multitask programs.
There is a semaphore 123 for synchronizing tasks. T.G.C.
B 121 includes a task counter 1211 that represents the number of tasks that have been activated but have not finished executing, and a deadlock detection counter 1212 that represents the number of tasks that are in an executable state or an execution state. TGCB 121 is
Initialized by the operating system before the start of execution of a multitasking program, in particular task counter 1
211 and the deadlock detection counter 1212 are set to "0" as initial setting values. Semapho 123
contains a status word 123 representing the state of the event.
1. A pointer 1232 to the waiting queue 112 is displayed.

タスク個別領域には、タスクに関する制御情報の集シで
あるTCB (TASK C0NTR0L BLOCK
 ) 122(図中では1221〜122Cで表示)が
ある。TCB122内にTGCB 121のポインタ1
221(図中1221a〜1221eで表示)がセット
されている。
In the task individual area, there is a TCB (TASK C0NTR0L BLOCK) which is a collection of control information regarding tasks.
) 122 (indicated by 1221 to 122C in the figure). Pointer 1 of TGCB 121 in TCB 122
221 (indicated by 1221a to 1221e in the figure) is set.

第2図は、上述した本実施例の構成に釦けるタスク起動
処理の流れ図である。タスク起動時に#i。
FIG. 2 is a flowchart of task activation processing that is performed in the configuration of this embodiment described above. #i when starting a task.

タスクカウンタ1211を+I L(821)、デッド
ロック検出カウンタ1212も+1する( 822)。
The task counter 1211 is increased by +IL (821), and the deadlock detection counter 1212 is also increased by 1 (822).

第3図は、タスク実行終了処理の流れ図でるる。FIG. 3 is a flowchart of the task execution termination process.

タスク実行終了処理時には、タスクカウンタ1211を
−tL(S3x)、デッドロック検出カウンタ1212
も−1する(832)。
During task execution termination processing, the task counter 1211 is set to -tL (S3x), and the deadlock detection counter 1212 is set to -tL (S3x).
is also -1 (832).

次にタスクカウンタ1211がr’=OJで、かつデッ
ドロック検出カウンタ1212が「O」であるかを判定
しく 833)、該状態であれば、待機状態で実行を終
えていないタスクが存在することを意味し、デッドロッ
ク状態に陥ったことが検出できる。この場合、待機状態
のタスクは再び実行可能状態となることはないので、オ
ペレーティングシステム′ムによう強制終了させる(8
34)。
Next, determine whether the task counter 1211 is r'=OJ and the deadlock detection counter 1212 is "O" (833), and if this is the case, there is a task that is in a standby state and has not finished executing. This means that a deadlock situation can be detected. In this case, the task in the standby state will never become executable again, so the operating system will forcefully terminate it (8
34).

タスクカウンタ1211が「0」であれば、プログラム
全体の終了を意味し、該ノログラムの終了処理を行う。
If the task counter 1211 is "0", it means the end of the entire program, and the end processing of the program is performed.

第4図は、イベント待ち処理の流れ図である。FIG. 4 is a flowchart of event waiting processing.

イベント待ち処理でば、まずセマフォ123のステータ
スワード1231を読取り(841)、該ステータスワ
ード1231の状態を判定する(842)。
In the event waiting process, first, the status word 1231 of the semaphore 123 is read (841), and the state of the status word 1231 is determined (842).

イベントが通知されていなければ、該タスクを待機状態
にしく 843)、デッドロック検出カウンタ1212
を−1する(844)。
If the event has not been notified, the task is placed in a waiting state (843), and the deadlock detection counter 1212
is decreased by 1 (844).

次にデッドロック検出カウンタ1212が「0」である
か判定しく545)、該状態であれば、実行を終えてい
ないタスクが全て待機状態になることを意味し、デッド
ロック状態に陥ったことが検出できる。この場合、待機
状態のタスクは再び実行可能状態となることはないので
、オペレーティングシステムにより強制終了させる(8
46)。
Next, it is determined whether the deadlock detection counter 1212 is "0" (545), and if it is in this state, it means that all tasks that have not finished executing are in the waiting state, and the deadlock state has not occurred. Can be detected. In this case, the task in the standby state will never become executable again, so it is forcibly terminated by the operating system (8
46).

第5図は、イベント通知処理の流れ図である。FIG. 5 is a flowchart of event notification processing.

イベント通知処理では、セマフォ123のステータスワ
ード1231をイベント発生状態にしく851)。
In the event notification process, the status word 1231 of the semaphore 123 is set to an event occurrence state (851).

イベント待ちのタスクがあるかを判断しく852)。It is determined whether there is a task waiting for an event (852).

該イベントを待合わせているタスクがあれば実行可能状
態にして(853)、デッドロック検出カウンタ121
2に実行可能状態にしたタスク数を加える( 854)
If there is a task waiting for the event, it is set to executable state (853) and the deadlock detection counter 121 is set.
Add the number of tasks made executable to 2 (854)
.

第6図および第7図は、マルチタスキングプログラムを
実行した時のタスクカウンタ1211Thよびデッドロ
ック検出力ウンタエ212の変化を示した実施例である
FIGS. 6 and 7 are examples showing changes in the task counter 1211Th and the deadlock detection power counter 212 when a multitasking program is executed.

第1図〜第5図を参照し、第6図の実施例を説明する。The embodiment shown in FIG. 6 will be described with reference to FIGS. 1 to 5.

第6図は、デッドロックを検出しない場合の例である。FIG. 6 is an example where deadlock is not detected.

タスクlが起動されると(861)、タスク起動処理(
第2図)によう、タスクカウンタ1211およびプツト
90ツク検出カウンタ1212を+1する。
When task l is activated (861), task activation processing (
As shown in FIG. 2), the task counter 1211 and the put-90 detection counter 1212 are incremented by 1.

タスク2が起動されると(862)、タスク起動処理(
第2図)によシ、タスクカウンタ1211およびデッド
ロック検出カウンタ1212fc+1する。
When task 2 is activated (862), task activation processing (
According to FIG. 2), the task counter 1211 and the deadlock detection counter 1212fc+1.

タスクlがイベント待ちになると(863)、イベント
待ち処理(第4図)により、デッドロック検出カウンタ
1212’t−−1する。この時、デッドロック検出カ
ウンタ1212がF”−zOJなのでデッドロックを検
出しない。
When task l becomes event wait (863), the deadlock detection counter 1212't--1 is incremented by the event wait process (FIG. 4). At this time, since the deadlock detection counter 1212 is F''-zOJ, no deadlock is detected.

タスク2がイベント通知を行うと(S64)%イベント
通知処理(第5図)にょう、デッドロック検出カウンタ
1212を+1する。タスクlは、実行可能状態となり
実行が再開される。
When task 2 issues an event notification (S64), the deadlock detection counter 1212 is incremented by 1 as per the event notification process (FIG. 5). Task l becomes executable and execution is resumed.

タスク2の実行が終了すると、タスク実行終了処理(第
3図)によシ、タスクカウンタ1211およびデッドロ
ック検出カウンタ1212を−1する。
When the execution of task 2 is completed, the task counter 1211 and the deadlock detection counter 1212 are decremented by 1 according to the task execution termination process (FIG. 3).

この時、デッドロック検出カウンタ1212がr)OJ
なので、デッドロックを検出しない。
At this time, the deadlock detection counter 1212 indicates r)OJ
Therefore, deadlock is not detected.

タスク1の実行が終了すると(866)、タスク実行終
了処理(第3図)により、タスクカウンタ1211>よ
びデッドロック検出カウンタ1212i−1する。この
時、タスクカウンタ1211が−」なので、デッドロッ
クを検出しない。
When the execution of task 1 ends (866), the task counter 1211> and the deadlock detection counter 1212i-1 are set by the task execution end process (FIG. 3). At this time, since the task counter 1211 is -'', no deadlock is detected.

次に、第1図〜第5図を参照し、第7図の実施例を説明
する。第7図は、デッドロックを検出する場合の例であ
る。
Next, the embodiment shown in FIG. 7 will be described with reference to FIGS. 1 to 5. FIG. 7 is an example of detecting deadlock.

タスク1が起動されると(S71)、タスク起動処理(
第2図)によう、タスクカウンタ1211およびデッド
ロック検出カウンタ1212を+1する。
When task 1 is activated (S71), task activation processing (
As shown in FIG. 2), the task counter 1211 and deadlock detection counter 1212 are incremented by 1.

タスク2が起動されると(872)、タスク起動処理(
第2図)によシ、タスクカウンタ1211よびデッドロ
ック検出カウンタ1212t−+1する。
When task 2 is activated (872), task activation processing (
According to FIG. 2), the task counter 1211 and the deadlock detection counter 1212 are incremented by 1.

タスク1がイベント待ちになると(873)、イベント
待ち処理(第4図)により、デッドロック検出カウンタ
1212を−1する。この時、7″ツドロツク検出カウ
ンタ1212が「NO」なのでデッドロックを検出しな
い。
When task 1 enters the event wait state (873), the deadlock detection counter 1212 is decremented by 1 through the event wait process (FIG. 4). At this time, since the 7'' deadlock detection counter 1212 is "NO", no deadlock is detected.

この状態で、もしタスク2もイベント待ちになったとす
ると(874)、イベント待ち処理(第4図)により、
デッドロック検出カウンタ1212が−1され、デッド
ロック検出カウンタ1212がrOJとなるため、デッ
ドロックを検出する。デッドロックを検出すると該マル
チタスクグループの全タスク(この場合、タスク1およ
びタスク2)を強制終了させる(875)。
In this state, if task 2 also waits for an event (874), the event wait process (Figure 4) will cause
Since the deadlock detection counter 1212 is incremented by 1 and the deadlock detection counter 1212 becomes rOJ, a deadlock is detected. When a deadlock is detected, all tasks in the multitask group (in this case, task 1 and task 2) are forcibly terminated (875).

タスクカウンタ1211.デツドロツク検出カウンタ1
212.Dよびセマフオ123のアクセスは。
Task counter 1211. Deadlock detection counter 1
212. D and semaphore 123 access.

マルチプロセッサ間で排他制御される。Exclusive control between multiple processors.

なか、この実施例ではマルチタスクプログラム実行時の
最終タスクの実行終了をタスクカウンタ1211で検出
しているが、最終タスクを別の方法で知れば特にタスク
カウンタ1211を使用する必要はない。
In this embodiment, the task counter 1211 detects the end of execution of the final task when executing a multitask program, but if the final task is known by another method, there is no need to use the task counter 1211.

〔発明の効果〕〔Effect of the invention〕

以上説明したように本発明は、オペレーティングシステ
ムのタスク管理機能にデッドロック検出機能を設け、デ
ッドロックを確実に検出することができるという効果が
ある。
As described above, the present invention provides a deadlock detection function in the task management function of the operating system, and has the advantage of being able to reliably detect deadlocks.

!た。そのため、オペレータの監視や、デッドロック時
の対処といった、手間と時間を不要にすることができる
効果がある。
! Ta. This has the effect of eliminating the need for labor and time such as monitoring operators and dealing with deadlocks.

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

第1図は1本発明を実施した場合の主記憶装置内の構成
例である。 第2図は、タスク起動処理の流れ図である。 第3図は、タスク実行終了処理の流れ図である。 第4図は、イベント待ち処理の流れ図である。 W15図は、イベント通知処理の流れ図である。 第6図は、マルチタスキングプログラムの実行でデッド
ロックを検出しなかった場合の実施例である。 第7図は、マルチタスキングプログラムの実行でデッド
ロックを検出した場合の実施例である。 1・・・主記憶装置、11・・・システム領域、12・
・・ユーザ領域、111・・・実行待行列、112・・
・待機中待行列、121・・・TGCB (TASK 
GROUP C0NTR0LBLOCK )、1211
・・・タスクカウンタ、1212・・・デッドロック検
出カウンタ、122・・・TCB (TASKCONT
ROL BLOCK ) 、1221・・・TGCBポ
インタ、123・・・セマフォ、1231・・・ステー
タスワード、1232・・・待機中待行列ポインタ。
FIG. 1 shows an example of the configuration inside the main storage device when the present invention is implemented. FIG. 2 is a flowchart of task activation processing. FIG. 3 is a flowchart of task execution termination processing. FIG. 4 is a flowchart of event waiting processing. Figure W15 is a flowchart of event notification processing. FIG. 6 shows an example in which no deadlock is detected during execution of a multitasking program. FIG. 7 shows an example in which a deadlock is detected during execution of a multitasking program. 1... Main storage device, 11... System area, 12.
...User area, 111...Execution queue, 112...
・Waiting queue, 121...TGCB (TASK
GROUP C0NTR0LBLOCK), 1211
...Task counter, 1212...Deadlock detection counter, 122...TCB (TASKCONT
ROL BLOCK), 1221...TGCB pointer, 123...Semaphore, 1231...Status word, 1232...Waiting queue pointer.

Claims (1)

【特許請求の範囲】[Claims] 情報処理装置におけるマルチタスクジョブを構成する各
々のタスクの、実行状態から待機状態、および待機状態
から実行状態への状態遷移が、前記ジョブ内の他のタス
クの実行に起因して発生する事象にのみ依存するマルチ
タスクジョブにおいて、一つの前記ジョブを構成する複
数タスクの共通領域に実行可能タスク数を保持するカウ
ンタを有し、タスク生成時、およびタスクが待機状態か
ら実行可能状態となる時、および実行状態から待機状態
となる時、およびタスクの実行終了時、に前記カウンタ
を更新する手段と、起動後、実行を終了していないタス
クがあるにもかかわらず、前記カウンタが示す実行可能
タスク数が0であることを検出する手段とを具備し、デ
ッドロック状態を検出することを特徴とするマルチタス
ク制御方式。
The state transition of each task constituting a multitask job in the information processing device from the execution state to the standby state and from the standby state to the execution state is caused by an event that occurs due to the execution of other tasks within the job. In a multi-task job that only depends on the job, a counter that holds the number of executable tasks is provided in a common area of multiple tasks constituting one job, and when a task is generated and when a task changes from a standby state to an executable state, and means for updating the counter when changing from a running state to a standby state and when a task finishes executing, and an executable task indicated by the counter even though there is a task that has not finished executing after being started. 1. A multitask control system comprising: means for detecting that the number is 0, and detecting a deadlock state.
JP1313416A 1989-12-04 1989-12-04 Multi-task control system Pending JPH03174633A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1313416A JPH03174633A (en) 1989-12-04 1989-12-04 Multi-task control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1313416A JPH03174633A (en) 1989-12-04 1989-12-04 Multi-task control system

Publications (1)

Publication Number Publication Date
JPH03174633A true JPH03174633A (en) 1991-07-29

Family

ID=18041027

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1313416A Pending JPH03174633A (en) 1989-12-04 1989-12-04 Multi-task control system

Country Status (1)

Country Link
JP (1) JPH03174633A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7574439B2 (en) 2004-05-20 2009-08-11 International Business Machines Corporation Managing a nested request

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7574439B2 (en) 2004-05-20 2009-08-11 International Business Machines Corporation Managing a nested request

Similar Documents

Publication Publication Date Title
US6101524A (en) Deterministic replay of multithreaded applications
KR930000592B1 (en) Task searching apparatus
US5375239A (en) Use of build status indicators in connection with building of complex computer programs from source code parts
TWI267782B (en) Deallocation of computer data in a multithreaded computer
US4809168A (en) Passive serialization in a multitasking environment
US8327336B2 (en) Enhanced thread stepping
JP2692609B2 (en) Multitask program debugging method and apparatus
US7971205B2 (en) Handling of user mode thread using no context switch attribute to designate near interrupt disabled priority status
JPH07182184A (en) Method for monitoring of overrun state of execution task, method for monitoring and controlling of task-execution -cycle overrun and apparatus for detection of task-execution-cycle overrun
JP2636722B2 (en) Multitask execution management method
JPH03174633A (en) Multi-task control system
JPS586971B2 (en) arithmetic processing unit
JP3422504B2 (en) Exclusive control method between tasks
JPH03260838A (en) Limiting system for cpu using time
JPH01300366A (en) Control system for conflict of shared data
JPH02118733A (en) System for controlling execution of task
JPH06187217A (en) System for synchronization between data base and normal file
CN110764880A (en) Three-state control method based on atomic operation
JPH02266441A (en) Process end monitoring system
JPH04273535A (en) Multitask control system
JPH04195539A (en) System call processing system
JPS6111867A (en) Processing method of abnormality in interface control
JPH0378034A (en) Program parallel execution device
JPH05143422A (en) Updated journal managing system
JPH10312294A (en) Information processor, information processing method, and readable recording medium recorded with information processing program