JP2007072958A - Method and device for detecting deray of event synchronization - Google Patents
Method and device for detecting deray of event synchronization Download PDFInfo
- Publication number
- JP2007072958A JP2007072958A JP2005262006A JP2005262006A JP2007072958A JP 2007072958 A JP2007072958 A JP 2007072958A JP 2005262006 A JP2005262006 A JP 2005262006A JP 2005262006 A JP2005262006 A JP 2005262006A JP 2007072958 A JP2007072958 A JP 2007072958A
- Authority
- JP
- Japan
- Prior art keywords
- event
- notification
- thread
- computer
- program
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/485—Task life-cycle, e.g. stopping, restarting, resuming execution
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Hardware Redundancy (AREA)
Abstract
Description
本発明は、計算機で実行するプログラムの動作を監視する技術に係わり、特に、プログラムがイベントで連携している場合に動作遅延を検出する技術に関する。 The present invention relates to a technique for monitoring the operation of a program executed on a computer, and more particularly to a technique for detecting an operation delay when a program is linked by an event.
高度な応答性能が要求される計算機システムや、処理完了までの時間が厳密に規定されている計算機システムでは、個々のプログラムの処理実行を予め定められた一定時間内に納めることが重要となる。このようなシステムの構築では、処理時間を一定時間内に収めるように設計するか、決められた時間を越えても処理が終了しないイベントを監視することが重要となる。 In a computer system that requires a high level of response performance and a computer system in which the time until the completion of processing is strictly defined, it is important that the processing execution of each program is accommodated within a predetermined time. In the construction of such a system, it is important to design the processing time so as to be within a certain time, or to monitor an event in which the processing does not end even if a predetermined time is exceeded.
一般にリアルタイムOSと呼ばれるOSを用いて構築されるシステムでは、計算機で実行されるすべての処理の処理時間が計算可能であり、それによって、利用者が実行するプログラムの動作時間を予め設計できる。これによって、システムで実行する処理を一定の時間内に収めることが可能である。 In a system constructed using an OS generally referred to as a real-time OS, the processing time of all the processes executed by the computer can be calculated, whereby the operation time of the program executed by the user can be designed in advance. As a result, it is possible to keep processing executed in the system within a certain period of time.
一方、汎用のOSにおいては、プログラムの処理時間を予め求めることはできない。これは、利用者からは制御できない処理がOS内で実行されるためである。このようなOSにおいては、プログラムが予め想定している通りに実行しているか否かを監視することが重要である。このために、特許文献1では、特定のプログラムを実行するプロセスについて、そのプロセスの状態を管理し、表示する方法を実現している。
On the other hand, in a general-purpose OS, the processing time of a program cannot be obtained in advance. This is because processing that cannot be controlled by the user is executed in the OS. In such an OS, it is important to monitor whether or not the program is executing as expected. For this reason,
また、汎用のOSは、複数のプロセスの連係動作が滞らないようにする機能を組み込んでいる場合もある。例えば、特許文献2では、プロセスの連係動作に利用する排他制御機能を用いて、プログラムの異常を検知する方法を開示している。また、非特許文献1では、プロセスのスケジューリングにおいて、優先度の高いプロセスが実行しているため、走行可能であってもCPUを与えられないプロセスを走行させる仕掛けとして、プロセスの優先度を一時的に高くする方法を開示している。
In addition, a general-purpose OS may incorporate a function that prevents the linkage operation of a plurality of processes from being delayed. For example, Patent Document 2 discloses a method of detecting an abnormality in a program using an exclusive control function used for process linkage operation. In
他にも、プログラムが正常に実行していることを一定周期で連絡して、その状況を監視するウォッチドッグタイマと呼ばれる方法も一般的である。 In addition, there is also a general method called a watch dog timer which notifies that a program is normally executed at a constant cycle and monitors the situation.
汎用OS向けの従来技術では、あるイベントによるプログラム間の連係動作を監視できないという問題がある。特に、イベント通知を待機しているプロセスが、イベント通知されたにも関わらず、システム内の他の高優先度プロセスのために走行不能である状況を検知できないという問題がある。プロセスをスレッドの単位で実行するときのスレッドについても同様である。 In the conventional technology for general-purpose OS, there is a problem that the linked operation between programs due to a certain event cannot be monitored. In particular, there is a problem that a process waiting for an event notification cannot detect a situation in which it cannot run due to another high priority process in the system despite the event notification. The same applies to threads when a process is executed in units of threads.
従来技術による個々のプログラムの動作監視では、何をもってそれぞれのプログラムが正常に実行しているとするのかを定めるのが困難であるという問題がある。例えば、ウォッチドッグタイマによる監視においては、プログラムは正常に動作していることを知らせるために、一定時間内にウォッチドッグタイマにアクセスするが、この動作は必ずしもプログラムが正常に実行していることを反映しないため、プログラムの動作監視にならない場合があり問題である。 In the operation monitoring of individual programs according to the prior art, there is a problem that it is difficult to determine what causes each program to execute normally. For example, in monitoring by the watchdog timer, the watchdog timer is accessed within a certain period of time in order to notify that the program is operating normally, but this operation does not necessarily indicate that the program is running normally. Because it does not reflect, there is a case that the operation of the program may not be monitored, which is a problem.
本発明の目的は、複数のプログラムがイベントにより連携している場合の動作遅延を検出することにある。 An object of the present invention is to detect an operation delay when a plurality of programs are linked by an event.
本発明は、イベントによるプログラムの連係動作を監視するために、監視対象とするイベントを指定し、監視対象として指定されているイベント通知に対する待機、通知の操作を記録し、待機しているスレッドの実行再開を記録し、この記録を検査してイベント通知されたにも関わらず走行を再開しないスレッドが存在することを検知する技術を特徴とする。 The present invention specifies an event to be monitored in order to monitor a program linkage operation by an event, records a standby for an event notification specified as a monitoring target, records a notification operation, and The technique is characterized by recording a restart of execution and detecting the existence of a thread that does not resume running despite being notified of an event by checking the record.
本発明によれば、汎用OSを利用するシステムにおいて、特定のイベントによるプログラムの連携が滞りなく動作しているか否かを監視できる。これによって、システム内で不正なプロセスがCPUを占有する場合や、過負荷のために、所定のスレッドが所定の時間内に実行を再開できない事象を確実かつ迅速に検知できる。 According to the present invention, in a system using a general-purpose OS, it is possible to monitor whether or not the cooperation of a program due to a specific event is operating without delay. As a result, it is possible to reliably and quickly detect a case where an unauthorized process occupies the CPU in the system or an event in which a predetermined thread cannot resume execution within a predetermined time due to overload.
本発明を複数の計算機から構成するクラスタシステムに適用すれば、イベント連携による遅延を異常として検知し、それを契機にクラスタの構成変更を開始できる。 If the present invention is applied to a cluster system composed of a plurality of computers, a delay due to event cooperation can be detected as an abnormality, and a cluster configuration change can be started on that occasion.
また、本発明を非同期I/O操作の完了通知に適用すれば、I/O操作が完了しているのに実行を再開できないプログラムを検知できる。 Further, when the present invention is applied to a notification of completion of an asynchronous I / O operation, it is possible to detect a program whose execution cannot be resumed even though the I / O operation is completed.
以下に、図を用いて本発明の実施形態について説明する。 Embodiments of the present invention will be described below with reference to the drawings.
以下、実施例1について説明する。図5は、実施例1の計算機500の構成例を示す図である。ここに示した構成は一例であって、本発明が実施可能な計算機の構成を限定するものではない。
Example 1 will be described below. FIG. 5 is a diagram illustrating a configuration example of the
計算機500は、CPU501、主記憶装置502、外部記憶装置503、通信制御部504、入出力装置、および、それらを接続する制御部から成る。CPU501は、主記憶装置(メモリ)502にロードされたプログラムを実行する。以下、CPUがプログラムを実行することを、単にプログラムが実行すると説明する。また、OSは、プログラムの実行をスレッドの単位でスケジュールする。
The
外部記憶装置503は、計算機500の実行に必要なOS、プログラム、監視対象イベントを登録する登録プログラム120、設定ファイル520などのファイルを格納している。図5の主記憶装置502は、OS、プログラム121、およびプログラム122がロードされている様子を示している。
The
OS内には、イベント連携監視用のイベント監視管理データ100とイベント処理部511が存在している。OSは、様々の処理間の連携のために、イベントオブジェクト(以下、イベントと略称する場合がある)を提供する。スレッドは、OS内に割り当てたイベントに対し、待機の操作ができる。あるイベントを待機するスレッドは、他の処理がそのイベントについて通知操作をするまで実行を中断して待機する。別の処理がそのイベントについて通知操作を実行すると、OSはそのイベントで待機しているスレッドが実行を再開するようにスケジューラに指示する。
In the OS, event
実施例1では、プログラム121とプログラム122がイベントによる同期をとるものとして説明する。また、外部記憶装置503はイベント監視に関する設定ファイル520を保持し、登録プログラム120が、設定ファイル520の内容に従ってOSに監視対象イベントを登録するものとする。
In the first embodiment, it is assumed that the
図1は、実施例1のデータ構造と処理モジュールの関係を示す図である。まず、データ構造について説明する。 FIG. 1 is a diagram illustrating a relationship between a data structure and a processing module according to the first embodiment. First, the data structure will be described.
計算機500が実行するOSは、イベント監視管理データ100を保持する。イベント監視管理データ100は、監視イベントテーブル101と通知リスト102から成る。通知リスト102は、少なくとも1つの通知ブロック103ないし105から成る。監視イベントテーブル101は、登録プログラム120が監視対象として登録したイベントの情報を保持する。
The OS executed by the
監視イベントテーブル101は、各対象イベントオブジェクトについて、イベントオブジェクトのアドレス、イベント通知されてから待機スレッドが走行を再開するまでの許容時間、および、イベント通知操作それぞれについて待機スレッドの再開状況を保持する通知リスト102の先頭アドレスを保持する。
The monitoring event table 101 holds, for each target event object, the event object address, the allowable time from when the event is notified until the standby thread resumes running, and the standby thread restart status for each event notification operation. The head address of the
通知リスト102は、イベントに対して通知操作が実行されたときに待機しているスレッドの実行再開状況を記録する。通知リスト102は、少なくとも1つの通知ブロックから構成される。通知ブロックは、初期化処理によって1つ生成され、その後各イベント通知が行われるごとに1つずつ生成されて通知リスト102に追加される。通知ブロックは、イベントで待機した後に実行を再開していない待機スレッド数、イベント通知が受け付けられた通知時刻、より古いイベント通知記録を保持する次の通知ブロックのアドレスを保持する。
The
通知リスト102の先頭の通知ブロック103は、その時点での当該イベントに関するスレッドの待機状況を示している。通知ブロック105も同様である。通知リスト102の先頭以降のブロック104は、当該イベントで待機していたがイベント通知により実行を再開するはずのスレッドの状況を示している。図1の例では、通知リスト102は、通知ブロック103と104で構成されている。通知ブロック104は、以前にイベント通知されたが実行を再開していないスレッドが2つあることを示している。また、通知ブロック103は、現時点でイベント待機しているスレッドが3つあることを示している。
A
次に、実施例1のイベント操作の処理手順について説明する。イベント処理部511は、イベント登録処理部111、イベント待機処理部112、イベント通知処理部113およびイベント監視処理部114から構成される。
Next, an event operation processing procedure according to the first embodiment will be described. The
イベント登録処理部111は、監視イベントテーブル101へのイベントオブジェクトの登録や削除を実施する。登録処理は、イベントオブジェクトの名称と待機スレッドが実行を再開するまでの許容時間を受けて、必要に応じて指定されたイベントオブジェクトをそのスレッドに割り当て、監視イベントテーブル101にイベント用のエントリを割り当て、そのエントリにイベントオブジェクトのアドレスと許容時間を記録する。そして、通知リスト102を初期化する。初期化処理は、通知リスト102の先頭として通知ブロック103を割り当てて、そのアドレスを監視イベントテーブル101の当該エントリの通知リスト先頭アドレスに記録する。
The event registration processing unit 111 registers and deletes event objects in the monitoring event table 101. The registration process receives the name of the event object and the allowable time until the standby thread resumes execution, assigns the specified event object to the thread as necessary, and assigns an entry for the event to the monitoring event table 101 Record the event object's address and allowable time in the entry. Then, the
登録処理は、イベント連携遅延検出時の動作の登録も含む。この処理では、指定された異常時動作を示す識別子を、異常時処理モード110に記録する。
The registration process includes registration of an operation when an event linkage delay is detected. In this processing, an identifier indicating the specified abnormal operation is recorded in the
登録プログラム120は、システム起動時に実行して、設定ファイル520の内容に従って、監視対象イベントとイベント連携異常時の処理を示す識別子を登録する。設定ファイル520の例を図6に示す。設定ファイル520は、監視対象のイベント毎に、イベント名、イベント連携についての遅延の許容時間を指定する。また、設定ファイル502は、イベント連携の異常を検知したときの動作識別子(この例では“panic”)も指定している。
The
イベント待機処理部112とイベント通知処理部113は、ユーザプログラムが利用するイベント連携処理である。本実施形態では、OSが基本的なイベント連携機能を提供しており、それにイベント連携監視のための処理を加える。これらの処理部は、監視イベントテーブル101を参照してイベント連携操作を記録する。各処理部の処理手順は、後述する。
The event
イベント監視処理部114は、監視イベントテーブル101を参照して、イベント通知操作がなされたが許容時間を経過しても実行を再開していないスレッドが存在していないかを検査する。イベント監視処理部114は、OSが一定周期で受け付けるタイマ割り込み処理の中で実行されるように、OS自身がOS初期化処理時に監視周期を設定する。例えば、OSは、イベント監視処理部114が1秒毎に実行されるように登録する。この周期は外部からも設定可能であってよい。イベント監視処理部114の処理手順は、後述する。
The event
イベント監視処理部114が再開の遅れているスレッドを見つけた場合は、異常時処理モード110に設定された処理を実行する。この処理としては、例えば、OSの異常終了、通信制御部504を介する他の計算機への異常通知、主記憶装置502内への異常発生の記録、等が可能である。ここで可能な処理は、この記載の限りではない。
When the event
OSは、ユーザプログラムが利用可能なOSインターフェイス115を提供する。インターフェイス115は、イベント待機と通知処理、及び、監視設定を登録するインターフェイスを含む。登録プログラム120、プログラム121、プログラム122は、インターフェイス115を介して、OSのイベント待機、通知、登録処理を実行する。
The OS provides an
次に、OSのイベント処理手順について説明する。ここでは、プログラム121が、あるイベントについてイベント通知を待機し、プログラム122がそのイベントへの通知を行うものとして説明する。
Next, an OS event processing procedure will be described. Here, it is assumed that the
図2は、実施例1のイベント待機処理手順である。プログラム121がOSのイベント待機処理を呼び出すと、イベント待機処理部112はステップ201からの処理を実行する。まず、イベント待機処理部112は、監視イベントテーブル101を参照して、対象のイベントが監視対象か否かを判定する(ステップ201)。監視対象でないならば、イベント待機を要求した当該スレッドをイベント待機状態とする(ステップ211)。この処理は、対象イベントオブジェクトに当該スレッドの識別子を登録し、スレッド状態をイベント待ち状態とし、スレッドのスケジュール処理を実行する。これは、一般的なOSのイベント待機処理と同等の処理である。イベントに対する通知操作が実行されるとスレッドは実行を再開し、プログラム121の処理に復帰する。
FIG. 2 is an event standby process procedure according to the first embodiment. When the
対象イベントが監視対象である場合は、イベント待機処理部112は、当該イベントへの操作を禁止する(ステップ202)。これは、当該イベントのロックの獲得等によって実現される。次に、当該イベントの通知リスト102の先頭の通知ブロックの待機スレッド数に1を加えて、待ちスレッドがあることを登録する(ステップ203)。
If the target event is a monitoring target, the event
その後、スレッド待ちを記録した通知ブロックのアドレスを当該スレッドのメモリ領域に記録して(ステップ204)、当該スレッドをイベント待機状態とする(ステップ205)。通知ブロックのアドレスは、実行しているスレッドのスタック等を格納するメモリ領域に記録すればよい。ステップ203と204の処理は、当該スレッドと対応づけて待機を示す情報を記録する処理であれば、他の方法を用いてもよい。ステップ205の処理は、ステップ211と同様の処理である。本実施形態では、イベント待機を要求した当該スレッドの実行はステップ205とステップ206の間で待ち状態にあるものとする。
Thereafter, the address of the notification block in which the thread wait is recorded is recorded in the memory area of the thread (step 204), and the thread is set in the event wait state (step 205). The address of the notification block may be recorded in a memory area that stores the stack of the thread being executed. As long as the processing of
ステップ206以降の処理は、別の処理が当該イベントに対してイベント通知処理を実行し、待機しているスレッドが実行を再開するときの処理である。
The processes after
イベント通知処理で詳細説明するが、プログラム122がイベントに通知処理を実行すると、通知リスト102の先頭に新しい通知ブロックが挿入される。以降の説明では、ステップ204でそのアドレスを記録した通知ブロックは図1の通知ブロック104であるとして説明する。
As will be described in detail in the event notification processing, when the
当該スレッドが実行を再開すると、イベント待機処理部112は、まず、当該イベントに対する操作を禁止し(ステップ206)、そのアドレスを当該スレッドのメモリ領域に記録した通知ブロック104の待機スレッド数から1を減じる(ステップ207)。待機スレッド数が0になった場合(ステップ208yes)、その通知ブロックに関する待機スレッドがすべて実行を再開したことを意味する。この場合、イベント待機処理部112は、当該通知ブロック104を通知リスト102から削除する(ステップ209)。ステップ208,209の処理は、ステップ203,204で記録した対応するスレッドの待機記録を消し込む処理であればよい。
When the thread resumes execution, the event waiting
最後に、当該イベントへの操作禁止を解除して(ステップ210)、プログラム121の処理に復帰する。
Finally, the prohibition of operation for the event is canceled (step 210), and the processing returns to the
次に、イベント通知の処理手順を説明する。図3は、実施例1のイベント通知処理の手順である。プログラム122がイベント通知処理を呼び出すと、イベント通知処理部113はステップ301からの処理を実行する。
Next, an event notification processing procedure will be described. FIG. 3 is a procedure of event notification processing according to the first embodiment. When the
まず、イベント通知処理部113は、監視イベントテーブル101を参照して、対象イベントが監視対象か否かを判定する(ステップ301)。監視の対象でないならば、イベント通知処理部113は、通常のイベント通知操作を実行する。すなわち、イベントで待機しているスレッドの状態を走行可能に設定し、イベントオブジェクトから待機スレッドの識別子を削除し、スケジューリング要求を登録し(ステップ308)、終了する。イベント通知処理部113は、プログラム122に復帰する過程でスケジューリング要求を検査し、スレッドのスケジュール処理を実行し、待機していたスレッドが走行を再開することとなる。
First, the event
イベントが監視対象である場合、イベント通知処理部113は、まず、対象イベントに対する操作を禁止する(ステップ302)。そして、通知リスト102の先頭の通知ブロックの待機スレッド数を参照して、スレッドが待機しているか否かを判定する(ステップ303)。待機していない場合は、ステップ307に進み、イベント通知処理を完了する。
If the event is a monitoring target, the event
待機しているスレッドがある場合、イベント通知処理部113は、通知リスト102の先頭の通知ブロックの通知時刻に、現在の時刻を記録する(ステップ304)。次に、イベント通知処理部113は、以降のイベント通知処理に備えて、通知リスト102の先頭に新しく割り当てた通知ブロックを挿入する(ステップ305)。この先頭の通知ブロックの「待機スレッド数」には、0が設定される。ステップ209を実行したとき、その通知リスト102の先頭の通知ブロックは、次のイベント待機と通知を記録するための空きブロックとなっている。図1の通知リスト102は、通知ブロック103を挿入後のデータ構造を示している。ステップ304で通知時刻を記録した通知ブロックは、通知ブロック104になっている。
If there is a waiting thread, the event
続いて、イベント通知処理部113は、待機しているスレッドを走行可能としてスケジューリングを要求し(ステップ306)、イベント操作禁止を解除し(ステップ307)、プログラム122の処理に復帰する。
Subsequently, the event
以上の処理により、通知リスト102は、次のイベント通知操作を記録する通知ブロック103と、過去の通知操作に対するスレッド待機状況を記録した通知ブロック104からなるリストとなる。イベントで待機しているスレッドが正常にスケジュールされて実行を再開すれば、ステップ206からの処理によって、待機状況を記録している通知ブロック104は通知リスト102から削除される。しかし、待機しているスレッドが走行を再開しない場合、通知ブロック104はリストに残り続ける。
As a result of the above processing, the
図4は、イベント監視処理部114の処理手順を示す。この手順は、監視イベントテーブル101および通知リスト102を検査して、実行の再開が遅延しているスレッドを検知する。以下に、この処理手順を説明する。
FIG. 4 shows a processing procedure of the event
図4に示した処理は、監視イベントテーブル101に登録されているすべてのイベントについて実行する。ステップ401では、イベント監視処理部114は、処理対象イベントを選択する。監視イベントテーブル101のイベントをすべて処理したとき、処理を終了する。
The process shown in FIG. 4 is executed for all events registered in the monitoring event table 101. In
次に、イベント監視処理部114は、処理対象のイベントの通知リスト102を取得し(ステップ402)、リストに含まれるそれぞれのイベント通知ブロックを処理する。ステップ403では、リスト中のすべての通知ブロックを処理したか否かを判定し、残りの通知ブロックがあればその1つを選択する。すべての通知ブロックを処理したとき、ステップ401に戻り処理を繰り返す。
Next, the event
イベント監視処理部114は、選択した通知ブロックについて、以下の処理を実行する。まず、通知ブロックが通知リストの先頭である場合、ステップ403に戻り、次の通知ブロックを選択する。通知リストの先頭は、次のイベント通知を記録するための空きブロックであるためである。
The event
通知ブロックがイベント通知されていてその待機スレッド数が0でない場合には、イベント監視処理部114は、現在時刻が通知ブロックに記載の通知時刻に監視イベントテーブル101に記載の許容時間を加えた時刻を過ぎているか否か検査する(ステップ405)。過ぎていない場合、つまり、待機スレッド数が0か、あるいはイベント通知されてからまだ設定されている許容時間を経過していない場合は、ステップ403に戻り、次の通知ブロックを選択する。
When the notification block is notified of an event and the number of waiting threads is not 0, the event
イベント通知されてから許容時間が経過している場合は、OSは、異常時処理モード110で指定される処理を実行する(ステップ406)。この処理が終了して復帰した場合は、他のイベントを検査するためにステップ401に戻る。 If the allowable time has elapsed since the event notification, the OS executes the process specified in the abnormal time processing mode 110 (step 406). When this process is completed and the process returns, the process returns to step 401 to check another event.
実施例1の代替方式として、例えばスレッドから待機要求を受けるごとに時系列にそのスレッド識別子をテーブルに記録し、イベント通知があるごとにその通知時刻を時系列に記録されたスレッド識別子をテーブルに記録し、イベント通知があるごとにその通知時刻を時系列に記録されたスレッド識別子に対応づけて記録し、各スレッドが実行再開されるごとにスレッド識別子と対応する通知時刻を記録から削除する方式でもよい。イベント監視処理部114は、現在時刻が残っている通知時刻より所定の許容時間以上過ぎているか否か判定する。
As an alternative method of the first embodiment, for example, each time a standby request is received from a thread, the thread identifier is recorded in a time series in the table, and each time an event notification is received, the notification time is recorded in the time series in the thread identifier. A method of recording, recording the notification time in association with the thread identifier recorded in time series every time there is an event notification, and deleting the notification time corresponding to the thread identifier from the recording each time execution of each thread is resumed But you can. The
以上のイベント通知と待機処理およびイベント監視処理により、イベント連係操作を介して実行されるプログラムの連係動作の遅延を検知することが可能となる。 By the event notification, the standby process, and the event monitoring process described above, it is possible to detect a delay in the linkage operation of the program executed through the event linkage operation.
実施例1では、ステップ401からのイベント監視処理をタイマ割り込み処理の中で実行するため、計算機500内で優先度の高い処理が不正にCPUを占有した場合でも、イベント連携の遅延を迅速に検知できる。加えて、異常の検知時に異常処理を実行することができるため、イベント連携の異常に対して迅速な対処が可能となる。
In the first embodiment, since the event monitoring process from
実施例1は、特に、汎用のOSを用いたシステムを構成する場合に有効である。すなわち、汎用OSでは、利用者が制御できない処理が走行するため、これによるイベント連携の遅延の可能性が避けられない。本発明によれば、この遅延を検知することができ、それに対応するための処理の実行も可能となる。 The first embodiment is particularly effective when configuring a system using a general-purpose OS. That is, in the general-purpose OS, a process that cannot be controlled by the user travels, so that the possibility of event linkage delay is unavoidable. According to the present invention, this delay can be detected, and processing for responding to the delay can be performed.
なお、実施例1においては、監視イベントテーブル101と通知リスト102のデータ構造をOSのイベントオブジェクトとは別に設けたが、これらは、イベントオブジェクトに統合されていても良い。例えば、イベントオブジェクトに、監視対象であるかを示すフラグ、遅延許容時間、通知リストのアドレスといったデータを含めることによって、同等の処理が実現可能である。
In the first embodiment, the data structure of the monitoring event table 101 and the
また、実施例1においては、イベント監視処理部114をタイマ割り込みの処理内で実行するとしたが、通常のプログラムで実行しても良い。この場合には、イベント監視管理データ100がそのプログラムから参照可能なように設定されている必要がある。また、そのプログラムの優先度を高くしておく、そのプログラムの実行をウォッチドッグタイマで監視する、といったことをしても良い。
In the first embodiment, the event
次に、実施例2について説明する。実施例1では、汎用のOSインタフェイスを利用し、イベント処理部511の中で監視対象のイベントとそうでないイベントに対する操作を分けていた。しかしイベント監視のために別のOSインターフェイスを設けても良い。実施例2では、監視対象イベントに関するOSインターフェイス115を、汎用のイベント操作インターフェイスとは別に専用的に設ける方法を示す。
Next, Example 2 will be described. In the first embodiment, a general-purpose OS interface is used, and the
ここでは、デバイスドライバによって新しいイベント操作インターフェイスを導入する構成を示す。図7が、実施例2の構成を示す図である。 Here, a configuration in which a new event operation interface is introduced by a device driver is shown. FIG. 7 is a diagram illustrating a configuration of the second embodiment.
実施例2においては、連携遅延監視を行うイベントに関する待機処理は、図2のステップ202からの処理、通知処理は図3のステップ302からの処理となる。これらの処理部は、デバイスドライバ内に実装される。但し、ステップ211およびステップ308の処理はOS標準のイベント処理であって、デバイスドライバから呼び出し可能であるとする。
In the second embodiment, the standby process related to the event for which the cooperation delay monitoring is performed is the process from
プログラム121,122は、新しく導入したデバイスドライバへの指示によって、イベント待機と通知処理を実行する。通常、OSインターフェイス115は、デバイスドライバに対して指示を発行するためのインターフェイスを含んでおり、プログラムはそれを用いて、イベント操作を実行できる。
The
以上のように実施例2により、既存の汎用OSのイベント連携方法を用いて、連携遅延の検知が可能なイベント連携処理を実現できる。 As described above, according to the second embodiment, it is possible to realize an event cooperation process capable of detecting a cooperation delay by using an existing general-purpose OS event cooperation method.
次に、実施例3について説明する。実施例3は、実施例1または実施例2を適用するクラスタ構成の計算機システムを特徴とする。 Next, Example 3 will be described. The third embodiment is characterized by a computer system having a cluster configuration to which the first or second embodiment is applied.
クラスタ構成の計算機システムは、主系と従系となる2台の計算機で構成される。主系である計算機が実際の処理を行い、従系である計算機は主系での障害発生に備えて待機している。従系は、主系の障害発生を検知すると主系として実行するように切り替わる。これを系切り替えと呼ぶ。クラスタ構成によれば、計算機に障害が発生してもシステム全体としての処理を継続することができる。 A cluster-structured computer system is composed of two computers, a primary system and a secondary system. The computer that is the main system performs the actual processing, and the computer that is the secondary system waits for a failure in the main system. When the slave system detects the occurrence of a fault in the master system, it switches to execute as the master system. This is called system switching. According to the cluster configuration, it is possible to continue the processing of the entire system even if a failure occurs in the computer.
クラスタ構成の計算機システムにおける課題の1つは、迅速に主系の障害を検知することである。本発明は、この障害検知方法の1つとして用いることができる。以下に、図面を用いて説明する。 One of the problems in a cluster-structured computer system is to quickly detect a main system failure. The present invention can be used as one of the failure detection methods. Below, it demonstrates using drawing.
図8は、実施例3のクラスタ構成の計算機システムの構成例と、クラスタ制御手順を示す。計算機800と計算機810の2台の計算機が、通信制御部802と812を介して接続し、クラスタを構成する。クラスタ制御部811は、通信制御部を介してクラスタ制御部801と周期的に通信し、計算機800が正常に動作しているか否かを常に検知する。また、各計算機で実行するOSは、本実施形態のイベント処理部511とイベント監視管理データ100を保持している。各計算機で実行するプログラムは、実施例1,2のイベント待機と通知処理により連係動作を実行する。図には示していないが、登録プログラム120が指定されたイベントを監視対象としてOSに登録し、また、連携遅延検知時の動作をOSの異常終了として設定する。
FIG. 8 shows a configuration example of a computer system having a cluster configuration according to the third embodiment and a cluster control procedure. Two computers of the
例えば、計算機800が主系として実行しているとして、処理の流れを説明する。850はその処理フローを示す図である。
For example, the processing flow will be described assuming that the
計算機800上のプログラム803と804は、イベントによって連携して処理を実行している(ステップ851)。連携するイベントは任意のものでよい。ここで、何らかの原因により、イベントによる連携に遅延が発生したとする(ステップ852)。イベント監視処理部114は、ステップ401からの処理によってイベント連携の遅延を検知し、OSを異常終了する(ステップ853)。ここでOS異常終了の意味は、計算機800がシステムとして異常終了したことと同意である。
The
待機系の計算機810のクラスタ制御部811は、計算機800からの通信が途絶えたことを検知して、主系であった計算機800が停止したと判定し(ステップ854)、計算機810を主系として実行するように設定し(ステップ855)、対応するプログラムをイベント連携により実行する(ステップ856)。
The
以上により、本発明によるイベント連携の遅延の検知と、クラスタの系切り替え制御を連携できる。これによって、クラスタの系切り替えの要因とする異常の種類を追加でき、更に、イベント連携の遅延という異常を迅速にシステム構成の変更に反映できる。 As described above, detection of event linkage delay and cluster system switching control according to the present invention can be linked. As a result, the type of abnormality that causes cluster system switching can be added, and an abnormality such as event linkage delay can be quickly reflected in a change in system configuration.
以上実施例3の説明では、連携の遅延の検知時にOSを異常終了するとしたが、その代わりに通信制御部を介して相手系に異常を通知してもよい。この場合、更に、迅速な異常の検知が可能となる。 In the above description of the third embodiment, the OS is abnormally terminated when the cooperation delay is detected. Instead, an abnormality may be notified to the partner system via the communication control unit. In this case, it is possible to quickly detect an abnormality.
実施例4は、プログラムが実行を起動するする入出力(I/O)操作からの復帰の遅延を検知する制御手順を示す。実施例4は、実施例1あるいは実施例2を利用して構成される。 The fourth embodiment shows a control procedure for detecting a return delay from an input / output (I / O) operation that starts execution of a program. The fourth embodiment is configured by using the first or second embodiment.
ネットワーク受信やディスク読み取りなど、時間がかかることが予想されるI/O操作を、プログラムの実行とは非同期に実行できるOSがある。このようなOSの中には、非同期に実行したI/O操作の完了を、プログラムが割り当てたイベントへの通知操作によってプログラムに通知できるものがある。 There are OSs that can execute I / O operations that are expected to take time, such as network reception and disk reading, asynchronously with program execution. Some OSs can notify the program of completion of an asynchronously executed I / O operation by a notification operation for an event assigned by the program.
このようなOSに本発明を適用することにより、I/O操作が完了しているにも関わらず、I/Oの完了を待機しているプログラムの再開が遅延する障害を検知可能となる。図9に、実施例4のプログラムおよびOSの処理手順を示す。 By applying the present invention to such an OS, it is possible to detect a failure that delays the resumption of a program that is waiting for I / O completion despite completion of the I / O operation. FIG. 9 shows the processing procedure of the program and OS of the fourth embodiment.
まず、プログラムは、I/O処理完了をOSに通知してもらうためのイベントを割り当て(ステップ901)、監視対象として登録する(ステップ902)。そして、プログラムは、このイベントをI/O完了時の通知イベントに指定して、OSに非同期でI/O操作を実行するように要求する(ステップ903)。 First, the program assigns an event for notifying the OS of completion of I / O processing (step 901) and registers it as a monitoring target (step 902). Then, the program designates this event as a notification event when I / O is completed, and requests the OS to execute an I / O operation asynchronously (step 903).
OSは、I/O操作要求を受けて、指示されたI/O操作を開始する(ステップ904)。OSは、非同期にI/O操作を実行するよう指示されているので、I/O操作を開始してプログラムに制御を戻す。プログラムは、I/O操作の完了を割り当てたイベントで待機する(ステップ905)。このイベント待機処理は、実施例1又は2のイベント待機処理とする。 In response to the I / O operation request, the OS starts the instructed I / O operation (step 904). Since the OS is instructed to execute the I / O operation asynchronously, the OS starts the I / O operation and returns control to the program. The program waits at the event assigned to complete the I / O operation (step 905). This event standby process is the event standby process of the first or second embodiment.
OSは、非同期に実行しているI/O操作が完了すると、I/O操作開始時に指定されたイベントに対して通知操作を実行し、プログラムにI/O完了を通知する(ステップ906)。このイベント通知処理は、実施例1又は2のイベント通知処理とする。 When the I / O operation being executed asynchronously is completed, the OS executes a notification operation for the event designated at the start of the I / O operation and notifies the program of the completion of the I / O (step 906). This event notification process is the event notification process of the first or second embodiment.
その後、OSのスケジューラによってイベント待機しているプログラムの実行が再開し(ステップ907)、プログラムは処理を継続する。 Thereafter, the execution of the program waiting for the event is resumed by the scheduler of the OS (step 907), and the program continues processing.
I/Oが完了してOSがイベント通知操作を実行したがプログラムの実行が再開されない場合、イベント監視処理部114が遅延を検知し、異常処理を実行することができる。
When the I / O is completed and the OS executes the event notification operation, but the execution of the program is not resumed, the event
以上により、本発明によれば、I/O操作が完了し走行可能となっているにも関わらず、何らかの原因で実行の再開が遅延しているプログラムを検知できる。 As described above, according to the present invention, it is possible to detect a program that is delayed in restarting execution for some reason even though the I / O operation is completed and the vehicle can run.
101…監視イベントテーブル、102…通知リスト、103ないし105…通知ブロック、111…イベント登録処理部、112…イベント待機処理部、113…イベント通知処理部、114…イベント監視処理部、115…OSインターフェイス、120…登録プログラム、121、122…プログラム
DESCRIPTION OF
Claims (10)
前記イベントに関して前記スレッドから待機の要求を受けたとき、当該スレッドと対応づけて待機することを示す情報をメモリに記録するステップと、
前記イベントに関して前記他のプログラムの処理から通知を受けたとき、その通知ごとに通知時刻を前記メモリに記録するステップと、
待機中の前記スレッドが実行再開されたとき、各々対応する前記の待機記録と該当する前記通知時刻を消し込むステップと、
前記待機記録と該当する前記通知記録が残っている状態で、現在時刻が残っている前記通知時刻より所定の許容時間以上過ぎているか否か判定するステップとを有し、
前記現在時刻が前記許容時間以上過ぎている場合に、該当するスレッドの実行再開遅れと判定することを特徴とするイベント同期の遅延検出方法。 In a computer in which at least one thread executing a program synchronizes with another program processing by an event, a delay detection method for detecting an execution restart delay of the thread,
When receiving a wait request from the thread in relation to the event, recording information indicating that the event is waiting in association with the thread;
Recording a notification time in the memory for each notification when the notification is received from the processing of the other program regarding the event;
When the waiting thread is resumed, the corresponding waiting record and the corresponding notification time are erased.
Determining whether or not the standby record and the corresponding notification record remain, and whether or not a predetermined allowable time has passed from the notification time when the current time remains,
An event-synchronized delay detection method, wherein, when the current time exceeds the allowable time, it is determined that the execution delay of the corresponding thread is delayed.
前記イベントに関して前記スレッドから待機の要求を受けたとき、当該スレッドと対応づけて待機することを示す情報を前記メモリに記録する手段と、
前記イベントに関して前記他のプログラムの処理から通知を受けたとき、その通知ごとに通知時刻を前記メモリに記録する手段と、
待機中の前記スレッドが実行再開されたとき、各々対応する前記の待機記録と該当する前記通知時刻を消し込む手段と、
前記待機記録と該当する前記通知記録が残っている状態で、現在時刻が残っている前記通知時刻より所定の許容時間以上過ぎているか否か判定する手段とを有し、
前記現在時刻が前記許容時間以上過ぎている場合に、該当するスレッドの実行再開遅れと判定することを特徴とする計算機。 A computer comprising a CPU and a memory, wherein at least one thread executing a program synchronizes with another program process and an event, and detects a delay in restarting the execution of the thread, the computer comprising:
Means for recording in the memory information indicating that a wait is made in association with the thread when a wait request is received from the thread with respect to the event;
Means for recording a notification time in the memory for each notification when the notification is received from the processing of the other program regarding the event;
Means for erasing the corresponding waiting record and the corresponding notification time when the waiting thread is resumed;
Means for determining whether or not the standby record and the corresponding notification record remain, and whether or not a predetermined allowable time has passed beyond the notification time when the current time remains;
When the current time has passed the allowable time or more, it is determined that the execution delay of the corresponding thread is delayed.
The event is an event for notifying completion of the input / output operation, the thread issues a request for waiting for the completion of the input / output operation, and the processing of the other program is completion of the input / output operation. 7. The computer according to claim 6, wherein the computer is notified.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2005262006A JP2007072958A (en) | 2005-09-09 | 2005-09-09 | Method and device for detecting deray of event synchronization |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2005262006A JP2007072958A (en) | 2005-09-09 | 2005-09-09 | Method and device for detecting deray of event synchronization |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2007072958A true JP2007072958A (en) | 2007-03-22 |
Family
ID=37934322
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2005262006A Pending JP2007072958A (en) | 2005-09-09 | 2005-09-09 | Method and device for detecting deray of event synchronization |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2007072958A (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH11237995A (en) * | 1998-02-23 | 1999-08-31 | Matsushita Electric Ind Co Ltd | Event controller |
JP2001022709A (en) * | 1999-07-13 | 2001-01-26 | Toshiba Corp | Cluster system and computer-readable storage medium storing program |
-
2005
- 2005-09-09 JP JP2005262006A patent/JP2007072958A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH11237995A (en) * | 1998-02-23 | 1999-08-31 | Matsushita Electric Ind Co Ltd | Event controller |
JP2001022709A (en) * | 1999-07-13 | 2001-01-26 | Toshiba Corp | Cluster system and computer-readable storage medium storing program |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7062676B2 (en) | Method and system for installing program in multiple system | |
JP4489802B2 (en) | Multi-CPU computer and system restart method | |
EP2431876B1 (en) | Method and device for exception handling in embedded system | |
US9335998B2 (en) | Multi-core processor system, monitoring control method, and computer product | |
US20090144742A1 (en) | Method, system and computer program to optimize deterministic event record and replay | |
US8499143B2 (en) | Method for shortening the boot time of a computer system | |
JPH06110740A (en) | Method and means for measuring channel-using time | |
US20130036299A1 (en) | Method for increasing free memory amount of main memory and computer therefore | |
US6308243B1 (en) | Method and system for controlling exclusive access to shared resources in computers | |
WO2008101386A1 (en) | Method of recovering single core exception in multi-core system | |
WO2016000298A1 (en) | System exception capturing method, main system, shadow system and intelligent device | |
JPH07311749A (en) | Multiprocessor system and kernel substituting method | |
CN110895486A (en) | Distributed task scheduling system | |
JP4992740B2 (en) | Multiprocessor system, failure detection method, and failure detection program | |
WO2009123343A1 (en) | Contention analysis device, contention analysis method, and program | |
US7797473B2 (en) | System for executing system management interrupts and methods thereof | |
US8799903B1 (en) | Systems and methods for exchanging runtime functionalities between software stacks | |
JPH06274354A (en) | Method and system for control of operation of destructive hardware | |
US20130318310A1 (en) | Processor processing method and processor system | |
JP2007072958A (en) | Method and device for detecting deray of event synchronization | |
JP2018092571A (en) | Electronic equipment, reactivation method, and program | |
JP6060781B2 (en) | Fault diagnosis apparatus and program | |
JP4773715B2 (en) | How to get checkpoint | |
US20130007758A1 (en) | Multi-core processor system, thread switching control method, and computer product | |
JP6547363B2 (en) | Management device, control method of management device, and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20071220 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20090724 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20090728 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20090925 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20100427 |