JP2735514B2 - Process status management method - Google Patents

Process status management method

Info

Publication number
JP2735514B2
JP2735514B2 JP7191744A JP19174495A JP2735514B2 JP 2735514 B2 JP2735514 B2 JP 2735514B2 JP 7191744 A JP7191744 A JP 7191744A JP 19174495 A JP19174495 A JP 19174495A JP 2735514 B2 JP2735514 B2 JP 2735514B2
Authority
JP
Japan
Prior art keywords
management
resident
processes
child
semaphore
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
JP7191744A
Other languages
Japanese (ja)
Other versions
JPH0944376A (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.)
NIPPON DENKI SOFUTOEA KK
NEC Corp
Original Assignee
NIPPON DENKI SOFUTOEA KK
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 DENKI SOFUTOEA KK, Nippon Electric Co Ltd filed Critical NIPPON DENKI SOFUTOEA KK
Priority to JP7191744A priority Critical patent/JP2735514B2/en
Publication of JPH0944376A publication Critical patent/JPH0944376A/en
Application granted granted Critical
Publication of JP2735514B2 publication Critical patent/JP2735514B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Description

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

【0001】[0001]

【発明の属する技術分野】本発明はプロセス状態管理方
式に関し、特に並列に動作する複数の常駐プロセスを監
視するための即応性があり簡潔でCPUに高負荷をかけ
ないプロセス状態管理方式に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a process state management method, and more particularly to a responsive, simple, and low CPU load state management method for monitoring a plurality of resident processes operating in parallel.

【0002】[0002]

【従来の技術】最近の汎用コンピュータなどの情報処理
システムにおいては、複数のユーザプログラムを並行し
て効率的に処理するために、頻繁に使用される共通的な
プロセスを常駐プロセスとして常時稼働させておく方法
が採用されている。この場合、稼働中の常駐プロセスが
何らかの原因で異常終了したときは、速やかに再起動し
て稼働させる必要がある。
2. Description of the Related Art In a recent information processing system such as a general-purpose computer, a frequently used common process is constantly operated as a resident process in order to efficiently process a plurality of user programs in parallel. Is adopted. In this case, if the running resident process terminates abnormally for some reason, it must be restarted and run immediately.

【0003】一般に、プロセスの稼働状態はシステムの
OSが管理しており、稼働中の全プロセスの状態を把握
し、異常を検出するとそのプロセスを異常終了させる機
能を備えている。しかしながら、あるプロセスに異常終
了が発生したときに、当該プロセスを再起動したり関連
するプロセスに対し必要な処理を実行するためには、そ
れらの内容を把握して制御を実行する別のプロセスが必
要である。このような制御を行うための代表的な従来の
方法が、特開平5―342058号公報および特開平1
―206437号公報に記載されている。
In general, the operating state of a process is managed by the OS of the system, and has a function of grasping the state of all running processes and abnormally terminating the process when an abnormality is detected. However, when an abnormal termination occurs in a certain process, another process that understands the contents of the process and executes control must be executed in order to restart the process or perform necessary processing for related processes. is necessary. Representative conventional methods for performing such control are disclosed in Japanese Patent Application Laid-Open Nos.
-206437.

【0004】特開平5―342058号公報に記載され
ている第1の方法は、関連のある複数のプロセスを子プ
ロセスとして起動する親プロセスを設け、親子関係を利
用して異常終了した子プロセスの情報(プロセスIDな
ど)をOSから受け必要な制御を行うようにしたもので
ある。このためには、親プロセスが稼働していることが
必要なことから、親プロセスを監視するために別の監視
プロセスを子プロセスとして起動し、親プロセスが稼働
中であることを確認するためにOSに対するシステムコ
ールを周期的に使用している。
A first method described in Japanese Patent Application Laid-Open No. 5-342008 discloses a method of providing a parent process that starts a plurality of related processes as child processes, and using a parent-child relationship to execute a child process abnormally terminated. Information (process ID, etc.) is received from the OS to perform necessary control. To do this, the parent process must be running, so start another monitoring process as a child process to monitor the parent process, and confirm that the parent process is running. System calls to the OS are used periodically.

【0005】特開平1―206437号公報に記載され
ている第2の方法は、親プロセスが監視対象となる複数
の子プロセスの状態をプロセス管理テーブルを設けて直
接に管理するもので、プロセス間およびモジュール間の
処理の受け渡しをディスパッチャを介して行い、その都
度プロセス管理テーブルを更新するようにし、親プロセ
スのプロセス管理モジュールがタイマ割り込みによって
周期的にプロセス管理テーブルをチェックして異常な子
プロセスを検出する構成となっている。
A second method described in Japanese Patent Application Laid-Open No. 1-206437 directly manages the states of a plurality of child processes to be monitored by a parent process by providing a process management table. And process transfer between modules is performed via the dispatcher, and the process management table is updated each time, and the process management module of the parent process periodically checks the process management table by a timer interrupt and identifies abnormal child processes. It is configured to detect.

【0006】[0006]

【発明が解決しようとする課題】上述した従来のプロセ
ス状態管理方式は、いずれも起動した子プロセスの異常
を監視するために親プロセスが常時稼働してCPUタイ
ムを消費している。すなわち、特開平5―342058
号公報記載の第1の方法では、異常終了した子プロセス
のプロセスIDを受信し認識するために親プロセスが稼
働していることが必要でCPUの負荷となるほか、更に
親プロセスを監視するための監視プロセスが周期的にC
PUに負荷を与えている。又、特開平1―206437
号公報記載の第2の方法は、プロセス管理テーブルの更
新およびチェックのためにCPUに負荷をかけるだけで
なく、タイマ割り込みによる周期的チェックのため異常
を検知するまでに時差が生じる欠点がある。
In each of the above-mentioned conventional process state management systems, the parent process is always running to monitor the abnormality of the activated child process, and consumes CPU time. That is, JP-A-5-342058
In the first method described in Japanese Patent Application Laid-Open Publication No. H10-207, a parent process needs to be running in order to receive and recognize the process ID of a child process that has terminated abnormally, which imposes a load on the CPU and further monitors the parent process. Monitoring process periodically
A load is being applied to the PU. Also, Japanese Patent Application Laid-Open No. 1-206437
The second method described in the above publication has a drawback that not only does the CPU load a process for updating and checking the process management table, but also a time difference occurs until an abnormality is detected due to a periodic check by a timer interrupt.

【0007】本発明の目的は、簡潔な構成でCPUに対
して高負荷をかけることなく複数の常駐プロセスを効率
よく管理し、異常終了するプロセスが発生しても速やか
に再起動を行い信頼性を向上できるプロセス状態管理方
式を提供することである。
It is an object of the present invention to efficiently manage a plurality of resident processes without imposing a heavy load on a CPU with a simple configuration, and to immediately restart even if an abnormally terminated process occurs, thereby improving reliability. The object of the present invention is to provide a process state management method capable of improving the process status.

【0008】[0008]

【課題を解決するための手段】請求項1のプロセス状態
管理方式は、並列に動作する複数の常駐プロセスの動作
状態を管理するためのプロセス状態管理方式であって、
前記複数の常駐プロセスを子プロセスとして起動する親
プロセスとしての管理プロセスと、初期設定値を前記管
理プロセスが起動する常駐プロセス数と同一値とした計
数セマフォとを設け、前記複数の常駐プロセスはそれぞ
れ起動時に前記計数セマフォをロックし異常終了時の通
知先を前記計数セマフォのロック解除信号とする指定を
行うプロセス起動通知手段を備え、前記管理プロセス
は、前記複数の常駐プロセスを順次起動した後に前記計
数セマフォに対してロックを試み前記管理プロセスをロ
ック待ち状態とするプロセス起動手段と、起動した前記
常駐プロセスのプロセスIDをメモリ上のプロセスID
管理テーブルに登録し管理するプロセスID管理手段
と、ロック待ち状態の前記管理プロセスのロックが成功
した時点で前記常駐プロセスの異常終了の発生を自動的
に認識するプロセス監視手段と、前記プロセス監視手段
により起動され前記プロセスID管理テーブルに登録さ
れたプロセスに対して順次確認のためのシグナルを送信
し異常終了したプロセスに対してのシグナル送信が正常
に行えないことを利用して異常終了したプロセスを検出
する障害プロセス抽出手段とを備えて構成されている。
According to a first aspect of the present invention, there is provided a process state management system for managing operation states of a plurality of resident processes operating in parallel,
A management process as a parent process that starts the plurality of resident processes as child processes, and a counting semaphore having an initial setting value equal to the number of resident processes started by the management process are provided. A process start notifying means for locking the counting semaphore at the time of activation and designating a notification destination at the time of abnormal termination as an unlock signal of the counting semaphore, wherein the management process sequentially starts the plurality of resident processes, A process starting unit that attempts to lock the counting semaphore and puts the management process in a lock waiting state, and stores a process ID of the started resident process into a process ID in a memory.
Process ID management means for registering and managing in a management table, process monitoring means for automatically recognizing the occurrence of abnormal termination of the resident process when lock of the management process in the lock waiting state succeeds, and the process monitoring means A process for sequentially transmitting a signal for confirmation to the process registered in the process ID management table and starting the process which has been abnormally terminated by utilizing the fact that the signal transmission to the process which has abnormally terminated cannot be performed normally. And a faulty process extracting means for detecting the faulty process.

【0009】請求項2のプロセス状態管理方式は、請求
項1記載のプロセス状態管理方式において、前記障害プ
ロセス抽出手段の代わりに、コマンドを発行してOSか
ら稼働中プロセスに関する情報を取得し前記プロセスI
D管理テーブル上のプロセスIDとの対応を調べること
により異常終了したプロセスを検出する稼働プロセス状
態参照手段を備えたことを特徴としている。
According to a second aspect of the present invention, there is provided a process status management system according to the first aspect, wherein a command is issued instead of the faulty process extraction means to obtain information on a running process from an OS. I
An operating process status reference unit for detecting a process that has terminated abnormally by checking the correspondence with the process ID on the D management table is provided.

【0010】請求項3のプロセス状態管理方式は、請求
項1又は請求項2記載のプロセス状態管理方式におい
て、前記複数の常駐プロセスが備える前記プロセス起動
通知手段が起動時に実行する処理を、前記管理プロセス
の前記プロセス起動手段が当該常駐プロセスの起動の直
前に代わって実行するように構成されたことを特徴とし
ている。
According to a third aspect of the present invention, in the process state management method according to the first or second aspect, the process executed by the process activation notifying means provided in the plurality of resident processes is executed at the time of the activation. The method is characterized in that the process starting means of the process is configured to execute instead of immediately before starting the resident process.

【0011】[0011]

【発明の実施の形態】次に、本発明の実施形態について
図面を参照して説明する。
Next, embodiments of the present invention will be described with reference to the drawings.

【0012】図1は本発明の第1の実施形態の構成を示
すブロック図である。
FIG. 1 is a block diagram showing the configuration of the first embodiment of the present invention.

【0013】本実施形態のプロセス状態管理方式は、図
1に示すように、並列に動作する複数の常駐プロセスで
ある子プロセスP1〜Pnと、子プロセスP1〜Pnを
監視して制御する管理プロセスである親プロセス1a
と、プロセスID管理テーブル21を登録するための共
有メモリ2と、セマフォ値の初期設定値が子プロセス数
nと同じ値である計数型のセマフォ3とから構成されて
いる。なお、親プロセス1aと子プロセスP1〜Pnと
はシステムの制御部4内に、共有メモリ2とセマフォ3
とは記憶部5内に含まれる。親プロセス1aは、子プロ
セスP1〜Pnを順次起動した後にセマフォ3に対して
ロックを試みプロセス監視手段13をロック待ち状態と
するプロセス起動手段11と、起動した子プロセスのプ
ロセスIDを共有メモリ2のプロセスID管理テーブル
21に登録し管理するプロセスID管理手段12と、ロ
ックが成功した時点で子プロセスの異常終了の発生を自
動的に認識するプロセス監視手段13と、プロセス監視
手段13により起動されプロセスID管理テーブル21
に登録されたプロセスに対して順次確認のためのシグナ
ルを送信して異常終了したプロセスを検出する障害プロ
セス抽出手段14とを備え、子プロセスP1〜Pnは、
それぞれ起動時にセマフォ3をロックし異常終了時の通
知先をセマフォ3のロック解除信号とする指定を行うプ
ロセス起動通知手段PP1〜PPnを備えている。
As shown in FIG. 1, the process state management method according to the present embodiment comprises a plurality of resident processes P1 to Pn operating in parallel, and a management process for monitoring and controlling the child processes P1 to Pn. Parent process 1a
And a shared memory 2 for registering the process ID management table 21, and a counting type semaphore 3 whose initial value of the semaphore value is the same as the number n of child processes. The parent process 1a and the child processes P1 to Pn are stored in the control unit 4 of the system in the shared memory 2 and the semaphore 3
Are included in the storage unit 5. The parent process 1a attempts to lock the semaphore 3 after sequentially activating the child processes P1 to Pn, and places the process monitoring unit 13 in a lock waiting state. A process ID management means 12 for registering and managing the process ID in the process ID management table 21, a process monitoring means 13 for automatically recognizing the occurrence of abnormal termination of a child process when locking is successful, and a process monitoring means 13 activated by the process monitoring means 13. Process ID management table 21
And a failure process extraction unit 14 for sequentially detecting a process which has been abnormally terminated by transmitting a signal for confirmation to the processes registered in the subprocesses P1 to Pn.
Each is provided with process start notifying means PP1 to PPn for locking the semaphore 3 at the time of startup and designating a notification destination at the time of abnormal termination as a lock release signal of the semaphore 3.

【0014】親プロセス1aは、プロセス起動手段11
により子プロセスP1〜Pnを起動し(図1の参
照)、プロセスID管理手段12により起動した子プロ
セスP1〜PnのプロセスIDを共有メモリ2上のプロ
セスID管理テーブル21に登録する(図1の参
照)。起動された子プロセスP1〜Pnは、プロセス起
動通知手段PP1〜PPnによりセマフォ3に対し1プ
ロセスずつ順にセマフォロックを要求する(図1の参
照)。セマフォ3はロックに成功したときにはセマフォ
値を1ずつ減じていく。そして、子プロセスP1〜Pn
のすべてがセマフォロックに成功したとき、セマフォ値
は0になる。次に、親プロセス1aのプロセス監視手段
13は、セマフォ3に対しセマフォロックを試みるが
(図1の参照)、セマフォ値は既に0のためにセマフ
ォロック待ち状態が発生する。この状態が起動した常駐
プロセスがすべて正常に稼働している通常の状態であ
る。
The parent process 1a is provided with a process
To start the child processes P1 to Pn (see FIG. 1), and register the process IDs of the child processes P1 to Pn started by the process ID management means 12 in the process ID management table 21 on the shared memory 2 (see FIG. 1). reference). The activated child processes P1 to Pn sequentially request the semaphore 3 for the semaphore lock by the process activation notifying means PP1 to PPn one by one (see FIG. 1). When the semaphore 3 succeeds in locking, the semaphore value is reduced by one. Then, the child processes P1 to Pn
Are all successfully semaphore locked, the semaphore value is zero. Next, the process monitoring means 13 of the parent process 1a attempts semaphore lock on the semaphore 3 (see FIG. 1), but the semaphore value is already 0, so a semaphore lock wait state occurs. This state is a normal state in which all started resident processes are operating normally.

【0015】次に、稼働中の子プロセスP1〜Pnのう
ちの一つの子プロセスPi(i=1〜n)が異常終了し
た場合を説明する。子プロセスPiが異常終了すると、
その情報は起動時にプロセス起動通知手段PPiにより
指定された通知先のセマフォ3に送られ、それまでセマ
フォ3に対して行われていたセマフォロックは無効とな
り、セマフォ3のセマフォ値は0から1に変化する。こ
のため、セマフォロック待ち状態の親プロセス1aはセ
マフォロックに成功することになり、親プロセス1aの
プロセス監視手段13は子プロセスP1〜Pnのいずれ
かが異常終了したことを認識することになる。子プロセ
スの異常終了を認識したプロセス監視手段13は、障害
プロセス抽出手段14に通知し(図1の参照)、障害
プロセス抽出手段14は異常終了した子プロセスのプロ
セスIDを検出する処理を開始する(図1の参照)。
Next, a case where one of the active child processes P1 to Pn (i = 1 to n) abnormally ends will be described. When the child process Pi ends abnormally,
The information is sent to the semaphore 3 of the notification destination specified by the process activation notifying means PPi at the time of startup, and the semaphore lock performed on the semaphore 3 is invalidated, and the semaphore value of the semaphore 3 is changed from 0 to 1. Change. Therefore, the parent process 1a in the semaphore lock waiting state succeeds in the semaphore lock, and the process monitoring unit 13 of the parent process 1a recognizes that one of the child processes P1 to Pn has terminated abnormally. The process monitoring unit 13 that has recognized the abnormal termination of the child process notifies the failed process extraction unit 14 (see FIG. 1), and the failed process extraction unit 14 starts the process of detecting the process ID of the abnormally terminated child process. (See FIG. 1).

【0016】以下、異常終了した子プロセスの検出から
再起動までの処理の詳細を図3を用いて説明する。親プ
ロセス1aの障害プロセス抽出手段14は、子プロセス
P1〜Pnの中のどの子プロセスが異常終了したかを特
定するために、プロセスID管理手段12に依頼して共
有メモリ2のプロセスID管理テーブル21から子プロ
セスP1〜PnのプロセスIDを取得し(図3の参
照)、子プロセスP1〜Pnに対し順次稼働中であるこ
とを確認するためのシグナルを送信する(図3の参
照)。異常終了していない子プロセスP1,P2及びP
nヘのシグナル送信は成功するが、異常終了した子プロ
セスP3に対するシグナル送信は失敗し確認が得られな
いことから、障害プロセス抽出手段14は子プロセスP
3の異常を検出する(図3の参照)。異常終了した子
プロセスを検出した障害プロセス抽出手段14は、プロ
セス起動手段11に対して子プロセスP3の再起動を要
請し、プロセス起動手段11は子プロセスP3を再起動
して新しい子プロセスP3’を生成する(図3の参
照)。子プロセスP3’のプロセス起動通知手段は、セ
マフォ3に対してセマフォロックを行い(図3の参
照)、セマフォ3はセマフォ値を1から0に更新する。
プロセス起動手段11は、プロセスID管理手段12に
子プロセスP3’のプロセスIDを通知し、プロセスI
D管理手段12は共有メモリ2のプロセスID管理テー
ブル21の子プロセスP3のプロセスIDを子プロセス
P3’のプロセスIDに更新する(図3の参照)。子
プロセスの再起動を終了したプロセス起動手段11は、
プロセス監視手段13に再起動の完了を通知する。プロ
セス監視手段13は、セマフォ3にセマフォロックを要
求するがセマフォ値は既に0のためセマフォロック待ち
状態(図3の参照)、すなわち通常の状態に戻りプロ
セス監視を再開する。
The details of the processing from detection of a child process that has terminated abnormally to restart will be described below with reference to FIG. The faulty process extraction means 14 of the parent process 1a requests the process ID management means 12 to identify which child process among the child processes P1 to Pn has abnormally terminated. The process IDs of the child processes P1 to Pn are acquired from the sub-process 21 (see FIG. 3), and signals for confirming that the child processes P1 to Pn are sequentially operating are transmitted (see FIG. 3). Child processes P1, P2, and P not abnormally terminated
n, the signal transmission to the abnormally terminated child process P3 fails and no confirmation is obtained.
3 is detected (see FIG. 3). The failed process extraction unit 14 that has detected the abnormally terminated child process requests the process activation unit 11 to restart the child process P3, and the process activation unit 11 restarts the child process P3 and restarts the child process P3 ′. (See FIG. 3). The process activation notifying means of the child process P3 'performs semaphore lock on the semaphore 3 (see FIG. 3), and the semaphore 3 updates the semaphore value from 1 to 0.
The process initiating means 11 notifies the process ID managing means 12 of the process ID of the child process P3 '.
The D management means 12 updates the process ID of the child process P3 in the process ID management table 21 of the shared memory 2 to the process ID of the child process P3 '(see FIG. 3). The process starting means 11 which has finished restarting the child process,
It notifies the process monitoring means 13 of the completion of the restart. The process monitoring means 13 requests the semaphore 3 to perform a semaphore lock, but since the semaphore value has already been set to 0, the process monitor returns to the semaphore lock wait state (see FIG. 3), that is, returns to the normal state and resumes the process monitoring.

【0017】以上詳細に説明したように、本実施形態の
プロセス状態管理方式は、常駐の複数の子プロセスP1
〜Pnを管理する親プロセス1aが、初期設定値を子プ
ロセス数nとした共通のセマフォ3を子プロセスP1〜
Pnと共用し、プロセス監視手段13をセマフォロック
待ち状態とすることにより子プロセスを監視する構成と
なっている。従って、監視のために親プロセス1aは待
ち状態にあってCPUに余分な負荷をかけることなく、
子プロセスのいずれかに異常終了が発生した場合、異常
終了した子プロセスのCPUタイムを引き継ぐ形で直ち
に稼働して異常を検知することができる。異常終了の発
生を検知した時点で、障害プロセス抽出手段14がプロ
セスID管理テーブル21を参照し、登録されているn
個の子プロセスP1〜Pnのみに確認信号を送信して異
常終了した子プロセスを特定し、その子プロセスを速や
かに再起動することが可能である。すなわち、監視のた
めにはCPUに負荷を与えず、異常終了が発生した場合
には遅滞なく稼働して必要な処理を行うことができる。
As described in detail above, the process state management method of the present embodiment employs a plurality of resident child processes P1.
To a common semaphore 3 whose initial setting value is the number n of child processes,
Pn is shared, and the process monitoring unit 13 is set to a semaphore lock wait state to monitor a child process. Therefore, the parent process 1a is in a waiting state for monitoring and does not impose an extra load on the CPU.
When an abnormal termination occurs in any of the child processes, the operation can be immediately performed and the abnormality can be detected by taking over the CPU time of the abnormally terminated child process. When the occurrence of the abnormal end is detected, the faulty process extracting unit 14 refers to the process ID management table 21 and registers the registered n.
It is possible to identify the abnormally terminated child process by transmitting a confirmation signal only to the child processes P1 to Pn, and to immediately restart the child process. That is, a load is not applied to the CPU for monitoring, and if an abnormal end occurs, the CPU can be operated without delay to perform necessary processing.

【0018】図2は本発明の第2の実施形態の構成を示
すブロック図である。図2に示す第2の実施形態と上述
した図1に示した第1の実施形態との相違点は、親プロ
セス1bが、第1の実施形態における障害プロセス抽出
手段14の代わりに、稼働プロセス状態参照手段15を
備えていることである。その他の構成は第1の実施形態
と同じであり図1と同一参照番号で示してある。親プロ
セス1bが子プロセスP1〜Pnを順次起動し、通常の
状態であるセマフォロック待ち状態となるまでの過程、
及び子プロセスに異常終了が発生しプロセス監視手段1
3がこれを検知するまでの過程は、第1の実施形態の場
合と同一である。異常終了が発生した場合に異常終了し
た子プロセスを特定する検出方法に相違があるため、こ
の点について以下に説明する。
FIG. 2 is a block diagram showing the configuration of the second embodiment of the present invention. The difference between the second embodiment shown in FIG. 2 and the first embodiment shown in FIG. 1 is that the parent process 1b is different from the first embodiment in that the operation process It is provided with the state reference means 15. Other configurations are the same as those of the first embodiment, and are indicated by the same reference numerals as in FIG. A process in which the parent process 1b sequentially activates the child processes P1 to Pn and enters a semaphore lock waiting state, which is a normal state;
And abnormal termination occurs in the child process and the process monitoring means 1
The process until 3 detects this is the same as in the first embodiment. Since there is a difference in a detection method for specifying a child process that has terminated abnormally when an abnormal termination has occurred, this point will be described below.

【0019】子プロセスP1〜Pnの中の一つの子プロ
セスが異常終了した場合、それまでセマフォ3に対して
行われていたセマフォロックが無効となりセマフォ値が
0から1に変化し、セマフォロック待ち状態のプロセス
監視手段13が異常終了を検知して稼働プロセス状態参
照手段15に通知する(図2の参照)。稼働プロセス
状態参照手段15は、プロセスID管理手段12から子
プロセスP1〜PnのプロセスIDを獲得すると共に
(図2の参照)、コマンドを送ってシステムのOSか
ら現在稼働中の子プロセスのプロセスIDを獲得し(図
2の参照)、両者の差分をとることにより異常終了し
た子プロセスを検出する。検出した子プロセスをプロセ
ス起動手段11により再起動させる以降の処理は、第1
の実施形態の場合と同一である。なお、稼働プロセス状
態参照手段15の異常終了した子プロセスの検出方法と
しては、OSからプロセスIDを取得して直接比較する
以外に、プロセスIDを示して稼働中か否かの応答をO
Sから求めてもよい。
When one of the child processes P1 to Pn terminates abnormally, the semaphore lock that has been performed on the semaphore 3 is invalidated, the semaphore value changes from 0 to 1, and the semaphore lock waits. The process monitoring unit 13 in the state detects the abnormal end and notifies the operating process state reference unit 15 (see FIG. 2). The running process status reference means 15 acquires the process IDs of the child processes P1 to Pn from the process ID management means 12 (see FIG. 2), and sends a command to send the process ID of the currently running child process from the system OS. (See FIG. 2), and the abnormally terminated child process is detected by taking the difference between the two. The process after the detected child process is restarted by the process starting unit 11 is the first process.
This is the same as the embodiment. As a method of detecting the abnormally terminated child process of the operating process status referring means 15, in addition to directly obtaining the process ID from the OS and directly comparing it, an O / O response indicating whether or not the process is active is indicated by O.
It may be obtained from S.

【0020】上述したように、第2の実施形態は、プロ
セス監視手段13がいずれかの子プロセスが異常終了し
たことを検知した後、異常終了した子プロセスを特定す
る際に、稼働プロセス状態参照手段15がOSからの稼
働情報を使用する。これに対して、第1の実施形態にお
いては、障害プロセス抽出手段14が各子プロセスに対
して順次稼働中であることを確認するためのシグナルを
送信し、OSに頼ることなく自ら異常終了した子プロセ
スを特定している。
As described above, according to the second embodiment, when the process monitoring means 13 detects that one of the child processes has terminated abnormally, and identifies the abnormally terminated child process, the operating process state reference means 15 Uses operating information from the OS. On the other hand, in the first embodiment, the faulty process extraction unit 14 sends a signal to each child process to confirm that it is operating sequentially, and terminates abnormally without relying on the OS. Identify child processes.

【0021】上述した第1及び第2の実施形態の説明に
おいては、親プロセスのプロセス起動手段により起動さ
れた各子プロセスが、起動した直後にプロセス起動通知
手段によりセマフォをロックし、ロックに成功した後に
それぞれ本来の処理を開始するものとしたが、セマフォ
をロックする処理は子プロセスを起動する親プロセスの
プロセス起動手段が行うように構成することもできる。
又、プロセスID管理テーブルは記憶部の共有メモリ上
に作成するものとしたが、共有メモリに限定されるもの
ではない。
In the above description of the first and second embodiments, each child process started by the process start unit of the parent process locks the semaphore by the process start notifying unit immediately after starting, and succeeds in locking. Although the original process is started after each process, the process of locking the semaphore may be performed by the process starting means of the parent process that starts the child process.
Further, the process ID management table is created on the shared memory of the storage unit, but is not limited to the shared memory.

【0022】[0022]

【発明の効果】以上説明したように、本発明のプロセス
状態管理方式は、管理プロセスが複数の常駐プロセスを
管理するにあたり、セマフォを利用することで常駐プロ
セスの監視をセマフォロック待ち状態で行うことがで
き、監視のためにCPUタイムを消費することがない。
更に、常駐プロセスに異常終了が発生した場合には自動
的に稼働を開始し、異常終了した常駐プロセスを特定し
て再起動させることができる。すなわち、CPUに負荷
をかけることなくプロセス状態を監視し、異常終了の発
生に即応して対処することができ、効率的な常駐プロセ
スの管理が行える効果がある。
As described above, according to the process state management method of the present invention, when a management process manages a plurality of resident processes, the semaphore is used to monitor the resident processes in a semaphore lock wait state. And no CPU time is consumed for monitoring.
Further, when an abnormal termination occurs in the resident process, the operation is automatically started, and the abnormally terminated resident process can be specified and restarted. In other words, the process state can be monitored without imposing a load on the CPU, and the abnormal termination can be dealt with immediately, thereby effectively managing the resident process.

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

【図1】本発明の第1の実施形態の構成を示すブロック
図である。
FIG. 1 is a block diagram illustrating a configuration of a first exemplary embodiment of the present invention.

【図2】本発明の第2の実施形態の構成を示すブロック
図である。
FIG. 2 is a block diagram illustrating a configuration of a second exemplary embodiment of the present invention.

【図3】本発明の第1の実施形態における異常終了プロ
セスの検出から再起動までの処理過程の説明図である。
FIG. 3 is an explanatory diagram of a process from detection of an abnormal end process to restart in the first embodiment of the present invention.

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

1a,1b 親プロセス 2 共有メモリ 3 セマフォ 4 制御部 5 記憶部 11 プロセス起動手段 12 プロセスID管理手段 13 プロセス監視手段 14 障害プロセス抽出手段 15 稼働プロセス状態参照手段 21 プロセスID管理テーブル P1,P2,P3……Pn 子プロセス P3’ 再起動後の子プロセス PP1,PP2……PPn プロセス起動通知手段 1a, 1b Parent process 2 Shared memory 3 Semaphore 4 Control unit 5 Storage unit 11 Process start-up unit 12 Process ID management unit 13 Process monitoring unit 14 Faulty process extraction unit 15 Active process state reference unit 21 Process ID management table P1, P2, P3 ... Pn child process P3 ′ Child process after restart PP1, PP2.

フロントページの続き (72)発明者 西川 かおり 東京都江東区新木場一丁目18番6号 日 本電気ソフトウェア株式会社内 (56)参考文献 特開 平7−200347(JP,A) 特開 平7−141229(JP,A) 特開 平5−334121(JP,A) 特開 平5−46411(JP,A) 特開 昭63−65535(JP,A)Continuation of the front page (72) Inventor Kaori Nishikawa 1-18-6 Shinkiba, Koto-ku, Tokyo Japan Electric Software Co., Ltd. (56) References JP-A-7-200347 (JP, A) JP-A-7-200 141229 (JP, A) JP-A-5-334121 (JP, A) JP-A-5-46411 (JP, A) JP-A-63-65535 (JP, A)

Claims (3)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 並列に動作する複数の常駐プロセスの動
作状態を管理するためのプロセス状態管理方式であっ
て、前記複数の常駐プロセスを子プロセスとして起動す
る親プロセスとしての管理プロセスと、初期設定値を前
記管理プロセスが起動する常駐プロセス数と同一値とし
た計数セマフォとを設け、前記複数の常駐プロセスはそ
れぞれ起動時に前記計数セマフォをロックし異常終了時
の通知先を前記計数セマフォのロック解除信号とする指
定を行うプロセス起動通知手段を備え、前記管理プロセ
スは、前記複数の常駐プロセスを順次起動した後に前記
計数セマフォに対してロックを試み前記管理プロセスを
ロック待ち状態とするプロセス起動手段と、起動した前
記常駐プロセスのプロセスIDをメモリ上のプロセスI
D管理テーブルに登録し管理するプロセスID管理手段
と、ロック待ち状態の前記管理プロセスのロックが成功
した時点で前記常駐プロセスの異常終了の発生を自動的
に認識するプロセス監視手段と、前記プロセス監視手段
により起動され前記プロセスID管理テーブルに登録さ
れたプロセスに対して順次確認のためのシグナルを送信
し異常終了したプロセスに対してのシグナル送信が正常
に行えないことを利用して異常終了したプロセスを検出
する障害プロセス抽出手段とを備えたことを特徴とする
プロセス状態管理方式。
1. A process state management method for managing the operation states of a plurality of resident processes operating in parallel, comprising: a management process as a parent process for starting the plurality of resident processes as a child process; A counting semaphore having a value equal to the number of resident processes started by the management process is provided, and the plurality of resident processes respectively lock the counting semaphore at startup and unlock the counting semaphore at the time of abnormal termination. A process start notifying unit for designating a signal as a signal, wherein the management process attempts to lock the counting semaphore after sequentially starting the plurality of resident processes, and sets the management process to a lock waiting state; and , The process ID of the started resident process in the process
Process ID management means for registering and managing the management process in a D management table; process monitoring means for automatically recognizing the occurrence of abnormal termination of the resident process when the lock of the management process in the lock waiting state has succeeded; A process that is started by the means and sends a signal for confirmation sequentially to the processes registered in the process ID management table, and a process that ends abnormally using the fact that signal transmission cannot be performed normally to a process that ends abnormally And a faulty process extracting means for detecting a faulty process.
【請求項2】 前記障害プロセス抽出手段の代わりに、
コマンドを発行してOSから稼働中プロセスに関する情
報を取得し前記プロセスID管理テーブル上のプロセス
IDとの対応を調べることにより異常終了したプロセス
を検出する稼働プロセス状態参照手段を備えたことを特
徴とする請求項1記載のプロセス状態管理方式。
2. In place of the faulty process extracting means,
Operating process status reference means for detecting a process that has terminated abnormally by issuing a command to acquire information on the running process from the OS and checking the correspondence with the process ID on the process ID management table. The process state management method according to claim 1, wherein
【請求項3】 前記複数の常駐プロセスが備える前記プ
ロセス起動通知手段が起動時に実行する処理を、前記管
理プロセスの前記プロセス起動手段が当該常駐プロセス
の起動の直前に代わって実行するように構成されたこと
を特徴とする請求項1又は請求項2記載のプロセス状態
管理方式。
3. The process startup notifying means of the plurality of resident processes is configured to execute at the time of startup, instead of the process startup means of the management process immediately before the startup of the resident process. 3. The process state management method according to claim 1, wherein
JP7191744A 1995-07-27 1995-07-27 Process status management method Expired - Fee Related JP2735514B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7191744A JP2735514B2 (en) 1995-07-27 1995-07-27 Process status management method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7191744A JP2735514B2 (en) 1995-07-27 1995-07-27 Process status management method

Publications (2)

Publication Number Publication Date
JPH0944376A JPH0944376A (en) 1997-02-14
JP2735514B2 true JP2735514B2 (en) 1998-04-02

Family

ID=16279786

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7191744A Expired - Fee Related JP2735514B2 (en) 1995-07-27 1995-07-27 Process status management method

Country Status (1)

Country Link
JP (1) JP2735514B2 (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7454753B2 (en) 2001-06-27 2008-11-18 International Business Machines Corporation Semaphore management subsystem for use with multi-thread processor systems
US7089555B2 (en) 2001-06-27 2006-08-08 International Business Machines Corporation Ordered semaphore management subsystem
US7406690B2 (en) 2001-09-26 2008-07-29 International Business Machines Corporation Flow lookahead in an ordered semaphore management subsystem
US7143414B2 (en) 2001-09-26 2006-11-28 International Business Machines Corporation Method and apparatus for locking multiple semaphores
JP2007265137A (en) * 2006-03-29 2007-10-11 Oki Electric Ind Co Ltd Multi-task processing method and multi-task processing apparatus
JP5966678B2 (en) * 2012-06-29 2016-08-10 富士通株式会社 Data transmission method and data transmission apparatus
JP6544413B2 (en) * 2016-12-15 2019-07-17 キヤノンマーケティングジャパン株式会社 Information processing apparatus, control method, program
CN110928596B (en) * 2018-09-04 2024-02-06 三六零科技集团有限公司 Method and device for killing resident process
JP7100260B2 (en) * 2018-11-21 2022-07-13 富士通株式会社 Information processing equipment and information processing programs

Also Published As

Publication number Publication date
JPH0944376A (en) 1997-02-14

Similar Documents

Publication Publication Date Title
EP0351536B1 (en) Systematic recovery of excessive spin loops in an n-way mp environment
WO2018095107A1 (en) Bios program abnormal processing method and apparatus
JP2735514B2 (en) Process status management method
JPH10214208A (en) System for monitoring abnormality of software
CN115904793B (en) Memory transfer method, system and chip based on multi-core heterogeneous system
US5914874A (en) Automatic application restarting system and method
CN107179911B (en) Method and equipment for restarting management engine
JP3269489B2 (en) Process monitoring system and process monitoring method
JP2002149437A (en) Method for restarting software
JP2001101034A (en) Fault restoring method under inter-different kind of os control
CN109032774B (en) Application program recovery method and device
JP3190880B2 (en) Standby system, standby method, and recording medium
JPH10116261A (en) Check point restarting method for parallel computer system
JPH08329006A (en) Fault information system
JPH0764930A (en) Mutual monitoring method between cpus
JP2785992B2 (en) Server program management processing method
CN116991637B (en) Operation control method and device of embedded system, electronic equipment and storage medium
CN113515397B (en) IPMI command processing method, server, and non-transitory computer readable storage medium
JP2998804B2 (en) Multi-microprocessor system
JPH03138753A (en) Boot loader for multiprocessor system
JP2879480B2 (en) Switching system when redundant computer system loses synchronization
JP2908430B1 (en) Host processor monitoring apparatus and monitoring method for multiprocessor system
CN117149562A (en) Method and device for solving CPU abnormal interrupt, server and storage medium
JPH03269759A (en) Multiprocessor control system
TW591376B (en) System and method for detecting server failure and the restoring of the same

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: 19971209

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080109

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090109

Year of fee payment: 11

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100109

Year of fee payment: 12

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110109

Year of fee payment: 13

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110109

Year of fee payment: 13

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120109

Year of fee payment: 14

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130109

Year of fee payment: 15

LAPS Cancellation because of no payment of annual fees