JP5262418B2 - Task scheduling apparatus and task scheduling method - Google Patents
Task scheduling apparatus and task scheduling method Download PDFInfo
- Publication number
- JP5262418B2 JP5262418B2 JP2008210535A JP2008210535A JP5262418B2 JP 5262418 B2 JP5262418 B2 JP 5262418B2 JP 2008210535 A JP2008210535 A JP 2008210535A JP 2008210535 A JP2008210535 A JP 2008210535A JP 5262418 B2 JP5262418 B2 JP 5262418B2
- Authority
- JP
- Japan
- Prior art keywords
- task
- message
- priority
- unit
- executed
- 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
Links
Images
Landscapes
- Telephonic Communication Services (AREA)
Description
本発明は、タスク間で行われるメッセージの送信をスケジューリングするためのタスクスケジューリング装置およびタスクスケジューリング方法に関する。 The present invention relates to a task scheduling apparatus and a task scheduling method for scheduling transmission of messages performed between tasks.
リアルタイムオペレーティングシステム(RTOS)等のオペレーティングシステム(OS)では、複数のタスクが管理される。また、これらのタスク間では、データや制御信号などのメッセージの送受信が行われる。 In an operating system (OS) such as a real-time operating system (RTOS), a plurality of tasks are managed. In addition, messages such as data and control signals are transmitted and received between these tasks.
このメッセージを送受信するタスク間通信方法は、以下のように行われる。 The inter-task communication method for transmitting and receiving this message is performed as follows.
各タスクは、メッセージを蓄えるためのメッセージ受信キューを有する。また、各タスクには、優先度が予め設定される。タスクは、優先度が最も高い順に実行され、実行中のタスクは、自タスクのメッセージ受信キュー内のメッセージを、送信先のメッセージ受信キューに送信する。このとき、タスクは、予め定められたバースト量単位でメッセージを送信していき、自タスクのメッセージ受信キュー内の全てのメッセージを送信すると、次に優先度が高いタスクがメッセージの送信を行う。 Each task has a message reception queue for storing messages. Each task is preset with a priority. The tasks are executed in the order of the highest priority, and the task being executed transmits the message in the message reception queue of its own task to the destination message reception queue. At this time, the task transmits a message in a predetermined burst amount unit, and when all the messages in the message reception queue of its own task are transmitted, the task having the next highest priority transmits the message.
図7は、このタスク間通信方法を実現する情報処理装置の構成を示したブロック図である。図7において、情報処理装置は、OS部50と、アプリケーション部60とを含む。OS部50は、OSにて実現され、レディーキュー管理部51と、ディスパッチ部52と、スケジューリング部53とを含む。また、アプリケーション部60は、アプリケーションプログラムにて実現され、複数のタスクを含む。
FIG. 7 is a block diagram showing a configuration of an information processing apparatus that realizes the inter-task communication method. In FIG. 7, the information processing apparatus includes an
レディーキュー管理部51は、タスクを優先度の高い順にキューイングするための優先度別キュー(以下、レディーキューと称する)を管理する。キューイングとは、メッセージ受信キュー内のメッセージを、送信先の処理の完了を待たずに、順次送信する処理である。
The
ディスパッチ部52は、実行可能なタスクにディスパッチを行う。なお、ディスパッチとは、CPUの処理能力を割り当てる処理である。
The
スケジューリング部53は、アプリケーション部60から通知された各タスクの優先度を、レディーキュー管理部51を介してレディーキューに登録し、その登録内容に応じてタスクを起動する。また、スケジューリング部53は、ディスパッチ部52に、その起動したタスクに対するディスパッチを指示する。
The
このようなタスク間通信方法では、優先度の高いタスクが自タスクのメッセージ受信キュー内のメッセージを全て送信しないと、他のタスクがメッセージを送信することができなかった。 In such an inter-task communication method, if a task with high priority does not transmit all messages in the message reception queue of its own task, other tasks cannot transmit messages.
このため、メッセージ受信キューに輻輳が発生すると、そのメッセージ受信キューがメッセージを蓄えることができなくなるという問題が発生する。例えば、メッセージが突発的に大量発生した場合など、送信先のタスクのメッセージ受信キューに蓄えることが可能なメッセージの量より多いメッセージが送信されると、そのメッセージ受信キューがメッセージを蓄えることができなくなる。この蓄えることができなかったメッセージは、破棄される。 For this reason, when congestion occurs in the message reception queue, there arises a problem that the message reception queue cannot store messages. For example, when a large number of messages occur suddenly, if more messages are sent than can be stored in the message reception queue of the destination task, the message reception queue can store the messages. Disappear. Messages that could not be stored are discarded.
このような問題は、タスク間で行われるキューイングに限らず、一般的なキューイングでも生じる。例えば、特許文献1に記載のキュー制御装置でも発生する。
Such a problem occurs not only in queuing performed between tasks but also in general queuing. For example, it also occurs in the queue control device described in
このキュー制御装置には、送受信用のポートごとに、モジュールが対応付けられている。また、各モジュールは、受信側優先制御キュー部と、送信先ポート用キュー部と、送信側キュー部とを含む。 In this queue control device, a module is associated with each transmission / reception port. Each module includes a reception-side priority control queue unit, a transmission destination port queue unit, and a transmission-side queue unit.
受信側優先制御キュー部は、自己のモジュールに対応するポートが受信したデータを蓄える。送信先ポート用キュー部は、受信側優先制御キュー部に蓄えられたデータを、そのデータを送信するポートの送信側キュー部に送信する。送信側キュー部は、送信先ポート用キュー部から受信したデータを一時的に蓄え、その蓄えたメッセージを送信先の装置に送信する。 The reception-side priority control queue unit stores data received by a port corresponding to its own module. The transmission destination port queue unit transmits the data stored in the reception-side priority control queue unit to the transmission-side queue unit of the port that transmits the data. The transmission side queue unit temporarily stores the data received from the transmission destination port queue unit, and transmits the stored message to the transmission destination device.
ここで、送信側キュー部に蓄えられる量より多いデータが送信先ポート用キュー部から送信されると、送信側キュー部では、その送信されたデータを蓄えることができなくなる。 Here, if more data than the amount stored in the transmission side queue unit is transmitted from the transmission destination port queue unit, the transmission side queue unit cannot store the transmitted data.
このキュー制御装置では、この問題を解決するために、送信側キュー部は、自己に蓄えられたデータの量が予め定められた第一値を超えると、送信先ポート用キュー部によるデータの送信を停止する。また、送信側キュー部は、自己に蓄えられたデータの量が予め定められた第二値を下回ると、送信先ポート用キュー部によるデータの送信を再開する。 In this queue control apparatus, in order to solve this problem, when the amount of data stored in the transmission side queue unit exceeds a predetermined first value, data transmission by the transmission destination port queue unit is performed. To stop. In addition, when the amount of data stored in the transmission side queue unit falls below a predetermined second value, the transmission side queue unit resumes data transmission by the transmission destination port queue unit.
これにより、送信側キュー部では、データを蓄えることができなくなる前に、新たにデータが送信されてくるのを防ぐことが可能になるので、メッセージ受信キューがメッセージを蓄えることができなくなるという問題を解決することができる。
特許文献1に記載のキュー制御装置では、送信先ポート用キュー部と、送信側キュー部とは、互いに独立してデータを送信することができる。しかしながら、タスク間でメッセージの送受信が行われるタスク間通信では、上述のように、優先度の高いタスクが自タスクのメッセージ受信キュー内のメッセージを全て送信しないと、他のタスクは、メッセージを送信することができなかった。このため、特許文献1に記載の発明を、タスク間通信方法に適応すると、以下の問題が生じる。
In the queue control device described in
つまり、タスク間通信では、送信先のタスクのメッセージ受信キューが第一値を超えたときに、送信元のタスクによるメッセージの送信を停止しても、送信先のタスクは、送信元のタスクより優先度が低いために、実行されない。したがって、送信先のタスクは、自タスクのメッセージ受信キュー内のメッセージを送信することができないので、送信先のタスクのメッセージ受信キューが第二値を下回ることがない。 In other words, in inter-task communication, if the message reception queue of the destination task exceeds the first value, the destination task will be sent from the source task even if the source task stops sending messages. Not executed due to low priority. Therefore, since the task at the transmission destination cannot transmit the message in the message reception queue of its own task, the message reception queue of the task at the transmission destination does not fall below the second value.
このため、タスク間でメッセージの送受信が行われる場合には、メッセージ受信キューがメッセージを蓄えることができなくなり、そのメッセージが破棄されるという問題を解決することができない。 For this reason, when messages are transmitted and received between tasks, the message reception queue cannot store messages, and the problem that the messages are discarded cannot be solved.
本発明の目的は、上記の課題である、タスク間でメッセージの送受信を行う場合に、メッセージが破棄されるという問題を解決するタスクスケジューリング装置およびタスクスケジューリング方法を提供することである。 An object of the present invention is to provide a task scheduling apparatus and a task scheduling method that solve the above-described problem that a message is discarded when a message is transmitted and received between tasks.
本発明によるタスクスケジューリング装置は、複数のタスクを優先度の高いタスクから順に実行するタスクスケジューリング装置であって、各タスクの識別情報を、該タスクの優先度と対応付けて記憶する優先度記憶手段と、各タスクに対応し、該タスク用のメッセージを蓄える複数のメッセージ記憶手段と、前記優先度記憶手段内の識別情報のうち、最も高い優先度に対応する識別情報にて特定されるタスクを実行する制御手段と、実行中のタスクに対応するメッセージ記憶手段内のメッセージを、該メッセージの送信先のメッセージ記憶手段に送信する転送手段と、前記送信先のメッセージ記憶手段内のメッセージの量が予め定められた第一閾値以上であるか否かを判断する判断手段と、前記判断手段にて前記メッセージの量が前記第一閾値以上であると判断された場合、前記転送手段による前記メッセージの送信を停止し、かつ、前記優先度記憶手段内の、前記送信先のメッセージ記憶手段に対応するタスクの優先度を、前記実行中のタスクの優先度より高い優先度に変更し、その後、前記実行中のタスクを終了する管理手段と、を含む。 A task scheduling apparatus according to the present invention is a task scheduling apparatus that executes a plurality of tasks in order from a task with a higher priority, and stores priority identification means for storing identification information of each task in association with the priority of the task. A plurality of message storage means corresponding to each task and storing messages for the task, and a task identified by the identification information corresponding to the highest priority among the identification information in the priority storage means. Control means for executing, transfer means for sending a message in the message storage means corresponding to the task being executed to the message storage means of the destination of the message, and the amount of messages in the message storage means of the destination Determining means for determining whether or not a predetermined first threshold value or more; and determining the amount of the message by the determining means When it is determined that the value is greater than or equal to the value, the transmission of the message by the transfer unit is stopped, and the priority of the task corresponding to the message storage unit of the transmission destination in the priority storage unit is executed. Management means for changing the priority to a priority higher than that of the middle task and then terminating the task being executed.
また、本発明によるタスクスケジューリング方法は、複数のタスクの識別情報のそれぞれを、該タスクの優先度と対応付けて記憶する優先度記憶手段と、各タスクに対応し、該タスク用のメッセージを蓄える複数のメッセージ記憶手段と、を含むタスクスケジューリング装置によるスケジューリング方法であって、前記優先度記憶手段内の識別情報のうち、最も高い優先度に対応する識別情報にて特定されるタスクを実行し、実行中のタスクに対応するメッセージ記憶手段内のメッセージを、該メッセージの送信先のメッセージ記憶手段に送信し、前記送信先のメッセージ記憶手段内のメッセージの量が予め定められた第一閾値以上であるか否かを判断し、前記メッセージの量が前記第一閾値以上であると判断された場合、前記メッセージの送信を停止し、かつ、前記優先度記憶手段内の、前記送信先のメッセージ記憶手段に対応するタスクの優先度を、前記実行中のタスクの優先度より高い優先度に変更し、前記実行中のタスクを終了する。 The task scheduling method according to the present invention also stores a priority storage means for storing each piece of identification information of a plurality of tasks in association with the priority of the task, and stores a message for the task corresponding to each task. A scheduling method by a task scheduling device including a plurality of message storage means, and executing a task specified by the identification information corresponding to the highest priority among the identification information in the priority storage means, A message in the message storage means corresponding to the task being executed is transmitted to the message storage means of the transmission destination of the message, and the amount of messages in the message storage means of the transmission destination is a predetermined first threshold value or more And if it is determined that the amount of the message is greater than or equal to the first threshold, The priority of the task corresponding to the message storage means of the transmission destination in the priority storage means is changed to a priority higher than the priority of the task being executed, End the task.
本発明によれば、タスク間でメッセージの送受信が行われる場合に、メッセージが破棄されることを抑制することが可能になる。 ADVANTAGE OF THE INVENTION According to this invention, when transmitting / receiving a message between tasks, it becomes possible to suppress that a message is discarded.
以下、本発明の実施形態について図面を参照して説明する。 Embodiments of the present invention will be described below with reference to the drawings.
図1は、本発明の一実施形態の情報処理装置の構成を示したブロック図である。図1において、情報処理装置100は、記憶部101と、情報処理部102とを含む。
FIG. 1 is a block diagram showing a configuration of an information processing apparatus according to an embodiment of the present invention. In FIG. 1, the
記憶部101は、レディーキュー111と、メッセージ(MSG)受信キュー112とを含む。
The
レディーキュー111は、優先度記憶手段の一例である。レディーキュー111は、複数のタスクのそれぞれの識別情報を、そのタスクの優先度と対応付けて記憶する。 The ready queue 111 is an example of a priority storage unit. The ready queue 111 stores the identification information of each of the plurality of tasks in association with the priority of the task.
メッセージ受信キュー112は、複数ある。メッセージ受信キュー112のそれぞれは、複数のタスクのいずれかに対応する。メッセージ受信キュー112は、自キュー(メッセージ受信キュー112)に対応するタスク用のメッセージを蓄える。
There are a plurality of
情報処理部102は、例えば、CPUであり、CPUにて読み取り可能な記録媒体からOSおよびアプリケーションプログラムを読み取り、その読み取ったOSおよびアプリケーションプログラムを実行する。なお、記録媒体は、記憶部101でもよいし、記憶部101とは別でもよい。
The
図2は、情報処理部102の構成例を示したブロック図である。図2において、情報処理部102は、OS部1と、アプリケーション部11とを含む。
FIG. 2 is a block diagram illustrating a configuration example of the
OS部1は、制御手段の一例であり、情報処理部102がOSを実行することで実現される。OS部1は、システムコール処理部2と、レディーキュー管理部3と、スケジューリング部4と、ディスパッチ部5と、メッセージ受信キュー管理部6とを含む。
The
システムコール処理部2は、アプリケーション部11からシステムコールを受信する。システムコールには、タスクの優先度を変更する変更システムコール、新規のタスクを登録する登録システムコール、メッセージの送信先のメッセージ受信キュー112に蓄えられているメッセージの量を測定する測定システムコール、メッセージの送信元のメッセージ受信キュー112に蓄えられているメッセージの量を測定する監視システムコール、および、実行中のタスクを終了する終了システムコールなどがある。以下、その蓄えられているメッセージの量を滞留量と称する。
The system
レディーキュー管理部3は、記憶部101内のレディーキュー111を管理する。具体的には、レディーキュー管理部3は、レディーキュー111内の情報の変更や削除、および、レディーキュー111への識別情報および優先度の登録などを行う。より具体的には、システムコール処理部2が変更システムコールを受信すると、レディーキュー管理部3は、その変更システムコールに従って、レディーキュー111内のタスクの優先度を変更する。また、システムコール処理部2が登録システムコールを受信すると、その登録システムコールに従って、識別情報および優先度を対応付けてレディーキュー111に登録する。さらに、システムコール処理部2が終了システムコールを受信すると、レディーキュー管理部3は、その終了システムコールに従って、レディーキュー111内の情報を削除する。
The ready queue management unit 3 manages the ready queue 111 in the
スケジューリング部4は、レディーキュー111内の識別情報が特定するタスクを、優先度の高いタスクから順に起動する。具体的には、スケジューリング部4は、レディーキュー111内の最も高い優先度のタスクを起動し、その後、システムコール処理部2が終了システムコールを受信すると、その起動したタスクを終了する。そして、スケジューリング部4は、レディーキュー111内の最も高い優先度のタスクを起動する。
The
ディスパッチ部5は、スケジューリング部4で起動されたタスクにディスパッチを行う。これにより、OS部1がレディーキュー111内の識別情報のうち、最も高い優先度と対応付けられた識別情報のタスクを実行することになる。
The
メッセージ受信キュー管理部6は、メッセージ受信キュー112のそれぞれの滞留量を監視する。より具体的には、システムコール処理部2が測定システムコールまたは監視システムコールを受信すると、メッセージ受信キュー管理部6は、その測定システムコールまたは監視システムコールに従って、メッセージ受信キュー112の滞留量を監視する。
The message reception queue management unit 6 monitors each staying amount in the
アプリケーション部11は、情報処理部102がアプリケーションプログラムを実行することで実現される。
The application unit 11 is realized by the
図3は、アプリケーション部11の構成例を示したブロック図である。図3において、アプリケーション部11は、タスクAないしCを含む。タスクAないしCは、全て同じ構成を有するものとする。以下では、タスクBを例として説明し、タスクAおよびCの説明は省略する。また、タスクBが実行中のタスクであるとしている。 FIG. 3 is a block diagram illustrating a configuration example of the application unit 11. In FIG. 3, the application unit 11 includes tasks A to C. Tasks A to C all have the same configuration. Hereinafter, task B will be described as an example, and descriptions of tasks A and C will be omitted. Further, it is assumed that task B is a task being executed.
タスクBは、メッセージ転送部12と、送信先タスクメッセージ受信キュー輻輳検出部13と、自タスクメッセージ受信キュー輻輳復旧検出部14と、スケジューラ管理部15とを含む。
Task B includes a
メッセージ転送部12は、転送手段の一例である。メッセージ転送部12は、自タスク(タスクB)に対応するメッセージ受信キュー112内のメッセージを、そのメッセージの送信先のメッセージ受信キュー112に送信する。
The
送信先タスクメッセージ受信キュー輻輳検出部(以下、輻輳検出部と略す)13は、判断手段の一例である。輻輳検出部13は、メッセージ転送部12が送信するメッセージの送信先のメッセージ受信キュー112の滞留量を監視する。具体的には、輻輳検出部13は、定期的に、その送信先のメッセージ受信キュー112の滞留量を測定する測定システムコールをOS部1に発行し、その応答情報に基づいて滞留量を監視する。
The destination task message reception queue congestion detection unit (hereinafter abbreviated as congestion detection unit) 13 is an example of a determination unit. The
輻輳検出部13は、その滞留量が予め定められた輻輳発生閾値以上か否かを判断する。なお、輻輳発生閾値は、第一閾値の一例である。
The
自タスクメッセージ受信キュー輻輳復旧検出部(以下、復旧検出部と略す)14は、判定手段の一例である。復旧検出部14は、自タスクに対応するメッセージ受信キュー112の滞留量を測定する。具体的には、復旧検出部14は、定期的に、自タスクのメッセージ受信キュー112の滞留量を測定する監視システムコールをOS部1に発行し、その応答情報に基づいて滞留量を監視する。
The own task message reception queue congestion recovery detection unit (hereinafter abbreviated as a recovery detection unit) 14 is an example of a determination unit. The
復旧検出部14は、予め定められた輻輳復旧閾値以上であった滞留量が、その輻輳復旧閾値を下回ったか否かを判断する。なお、輻輳復旧閾値は、第二閾値の一例であり、輻輳発生閾値より小さい。
The
スケジューラ管理部15は、輻輳検出部13にて滞留量が輻輳発生閾値以上であると判断されると、メッセージ転送部12によるメッセージの送信を停止する。スケジューラ管理部15は、そのメッセージの送信先のメッセージ受信キュー112に対応するタスクの優先度を、自タスクの優先度より高い優先度に変更するための変更システムコールをOS部1に発行して、そのメッセージの送信先のメッセージ受信キュー112に対応するタスクの優先度を、自タスクの優先度より高い優先度に変更する。そして、スケジューラ管理部15は、終了システムコールをOS部1に発行して、自タスクを終了する。
When the
また、スケジューラ管理部15は、復旧検出部14にて滞留量が輻輳復旧閾値を下回ったと判断されると、終了システムコールをOS部1に発行して、自タスクの識別情報をレディーキュー111から削除して、自タスクを終了する。
Further, when the
次に動作を説明する。 Next, the operation will be described.
図4は、情報処理装置100の基本的な動作を説明するための説明図である。なお、タスクAは、情報処理装置100の外部からメッセージを受信するタスクである。タスクCは、情報処理装置100の外部にメッセージを送信するタスクである。また、レディーキュー111内は、空であるとする。
FIG. 4 is an explanatory diagram for explaining a basic operation of the
情報処理装置100が外部から受信したメッセージは、タスクAのメッセージ受信キュー112に記憶される。OS部1のスケジューリング部4は、そのメッセージがメッセージ受信キュー112に記憶されたことを契機に、タスクAの識別情報およびタスクA用の優先度を対応付けてレディーキュー111に登録する。
A message received from the outside by the
続いて、OS部1は、レディーキュー111内の最も高い優先度に対応するタスクを実行する。具体的には、OS部1のスケジューリング部4は、レディーキュー111内の最も高い優先度に対応する識別情報にて特定されるタスクを起動し、その識別情報をディスパッチ部5に通知する。ディスパッチ部5は、その識別情報を受信すると、その識別情報が特定するタスクにディスパッチを行う。
Subsequently, the
これにより、タスクAが実行される。タスクAのメッセージ転送部12は、自タスクのメッセージ受信キュー112内のメッセージを、タスクBのメッセージ受信キュー112に送信する。タスクBのメッセージ受信キュー112は、そのメッセージを受信すると、そのメッセージを記憶する。
Thereby, task A is executed. The
また、OS部1のスケジューリング部4は、そのメッセージがタスクBのメッセージ受信キュー112に記憶されたことを契機に、タスクBの識別情報およびタスクB用の優先度を対応付けてレディーキュー111に記憶する。
Further, the
そして、メッセージ転送部12は、タスクAのメッセージ受信キュー112内のメッセージを全て送信すると、メッセージの送信が完了したことを示す完了報告をスケジューラ管理部15に通知する。スケジューラ管理部15は、完了報告を受信すると、終了システムコールを生成し、その終了システムコールを、システムコール処理部2を介して、OS部1のスケジューリング部4に送信する。なお、終了システムコールは、自タスクの識別情報を含む。
When the
スケジューリング部4は、終了システムコールを受信すると、終了システムコール内の識別情報にて特定されるタスクを終了する終了処理を行う。具体的には、スケジューリング部4は、終了システムコールをレディーキュー管理部3に通知する。レディーキュー管理部3は、終了システムコールを受信すると、その終了システムコール内の識別情報と、その識別情報に対応する優先度を削除する。レディーキュー管理部3は、識別情報および優先度を削除したことを示す削除報告をスケジューリング部4に送信する。スケジューリング部4は、削除報告を受信すると、実行中のタスクを終了する。
When the
これにより、タスクAが終了される。その後、OS部1は、レディーキュー111内の最も高い優先度に対応するタスクBを実行する。
Thereby, the task A is completed. Thereafter, the
タスクBのメッセージ転送部12は、自タスクのメッセージ受信キュー112内のメッセージを、タスクCのメッセージ受信キュー112に送信する。タスクCのメッセージ受信キュー112は、そのメッセージを受信すると、そのメッセージを記憶する。
The
OS部1のスケジューリング部4は、そのメッセージがタスクCのメッセージ受信キュー112に記憶されたことを契機に、タスクCの識別情報およびタスクC用の優先度を対応付けてレディーキュー111に記憶する。
The
ここで、スケジューリング部4は、情報処理装置100の外部からメッセージを受信する受信処理が、情報処理装置100の外部にメッセージを送信する送信処理より高い優先度で実行されるようにスケジューリングする。具体的には、スケジューリング部4は、優先度が高いほうから順にタスクA、タスクBおよびタスクCとなるように、識別情報および優先度をレディーキュー111に記憶する。
Here, the
次に、タスクBのメッセージ受信キュー112に輻輳が発生した場合における情報処理装置100の動作について説明する。具体的には、情報処理装置100が通常状態(状態α)の場合に、タスクBのメッセージ受信キュー112で発生した輻輳が検出され、情報処理装置100が輻輳状態(状態β)に遷移する。その後、タスクBのメッセージ受信キュー112で発生した輻輳が復旧され、情報処理装置100が通常状態(状態γ)に遷移するまでの動作を説明する。
Next, the operation of the
図5は、それらの状態における、メッセージ受信キュー112のそれぞれの滞留量、および、実行権を有するタスクを示した説明図である。図6は、それらの状態における、レディーキュー111内の情報を示した説明図である。なお、図5では、メッセージ受信キュー112を、受信キューと略している。また、図6において、優先度は、[0]が最も高く、数字が大きくなるに従って小さくなるものとする。
FIG. 5 is an explanatory diagram showing the respective retention amounts of the
状態αでは、タスクAが実行されている。また、タスクAおよびBのそれぞれのメッセージ受信キュー112にメッセージが蓄えられている。さらに、レディーキュー111には、タスクAの識別情報(タスクA1)と、タスクBの識別情報(タスクB1)とが記憶される。また、タスクAの優先度は、タスクBの優先度より高い。そして、タスクAのメッセージ転送部12がタスクAのメッセージ受信キュー112内のメッセージを、タスクBのメッセージ受信キュー112に送信している。
In state α, task A is being executed. Messages are stored in the
タスクAの輻輳検出部13は、定期的に、タスクBのメッセージ受信キュー112の滞留量を測定する測定システムコールを生成し、その測定システムコールを、システムコール処理部2を介して、メッセージ受信キュー管理部6に送信する。
The
メッセージ受信キュー管理部6は、測定システムコールを受信すると、タスクBのメッセージ受信キュー112の滞留量を確認する。メッセージ受信キュー管理部6は、その確認した滞留量を示す情報を、測定システムコールの応答情報として生成し、その応答情報を、システムコール処理部2を介してタスクAの輻輳検出部13に送信する。
When the message reception queue management unit 6 receives the measurement system call, the message reception queue management unit 6 checks the staying amount of the
輻輳検出部13は、応答情報を受信すると、その応答情報にて示される滞留量が輻輳発生閾値以上か否かを判断する。輻輳検出部13は、滞留量が輻輳発生閾値未満であると、動作を終了する。一方、輻輳検出部13は、滞留量が輻輳発生閾値以上であると、タスクBのメッセージ受信キュー112で輻輳が発生したと判断する。これにより、情報処理装置100が輻輳検出状態に遷移する。
When the
輻輳検出状態では、輻輳検出部13は、滞留量が輻輳発生閾値以上である旨をスケジューラ管理部15に通知する。スケジューラ管理部15は、その旨を受信すると、メッセージ転送部12にメッセージの送信の停止を指示して、メッセージ転送部12によるメッセージの送信を停止する。
In the congestion detection state, the
スケジューラ管理部15は、タスクBの優先度を変更する変更システムコールを生成し、その変更システムコールを、システムコール処理部2およびスケジューリング部4を介して、レディーキュー管理部3に通知する。変更システムコールは、タスクAの優先度より高いタスクBの優先度と、タスクBの識別情報(タスクB1)を含む。
The
レディーキュー管理部3は、変更システムコールを受信すると、レディーキュー111内の、その変更システムコールに含まれる識別情報に対応するタスクBの優先度を、その変更システムコールに含まれる優先度に変更する。これにより、タスクBの優先度がタスクAより高くなる。その後、レディーキュー管理部3は、優先度の変更が終了したことを示す情報を、変更システムコールの応答情報として生成し、その応答情報を、スケジューリング部4およびシステムコール処理部2を介して、タスクAのスケジューラ管理部15に送信する。
When the ready queue manager 3 receives the changed system call, the ready queue manager 3 changes the priority of the task B corresponding to the identification information included in the changed system call in the ready queue 111 to the priority included in the changed system call. To do. As a result, the priority of task B is higher than that of task A. Thereafter, the ready queue management unit 3 generates information indicating that the priority change has been completed as response information of the changed system call, and the response information is transmitted via the
スケジューラ管理部15は、その応答情報を受信すると、タスクAを登録する登録システムコールを生成し、その登録システムコールを、システムコール処理部2およびスケジューリング部4を介して、レディーキュー管理部3に通知する。なお、登録システムコールは、タスクA用の優先度と、タスクAの識別情報(タスクA2)とを含む。
Upon receiving the response information, the
レディーキュー管理部3は、登録システムコールを受信すると、登録システムコール内の優先度および識別情報を対応付けて、レディーキュー111に登録する。これは、タスクAのメッセージ受信キュー112に残存したメッセージを後で送信するためである。
When receiving the registration system call, the ready queue management unit 3 associates the priority and identification information in the registration system call and registers them in the ready queue 111. This is because the message remaining in the
その後、レディーキュー管理部3は、タスクAの登録が終了したことを示す情報を、登録システムコールの応答情報として生成し、その応答情報を、スケジューリング部4およびシステムコール処理部2を介して、タスクAのスケジューラ管理部15に送信する。
Thereafter, the ready queue management unit 3 generates information indicating that the registration of the task A is completed as response information of the registration system call, and the response information is transmitted via the
スケジューラ管理部15は、その応答情報を受信すると、タスクAを終了する終了システムコールを生成し、その終了システムコールを、システムコール処理部2を介してスケジューリング部4に通知する。なお、終了システムコールは、タスクAの識別情報(タスクA1)を含む。
Upon receiving the response information, the
スケジューリング部4は、終了システムコールを受信すると、終了システムコール内の識別情報にて特定されるタスクを終了する終了処理を行う。これにより、タスクAが終了される。
When the
OS部1が、レディーキュー111内の最も高い優先度に対応する識別情報が特定するタスクを実行する。今、タスクBの優先度がタスクAの優先度より高いので、タスクBが実行される。これにより、情報処理装置100が状態βに遷移する。
The
状態βでは、タスクBのメッセージ転送部12が、タスクBのメッセージ受信キュー112内のメッセージを、タスクCのメッセージ受信キュー112に送信する。
In the state β, the
また、タスクBの復旧検出部14は、定期的に、タスクBのメッセージ受信キュー112の滞留量を測定する監視システムコールを生成し、その監視システムコールを、システムコール処理部2を介して、メッセージ受信キュー管理部6に送信する。
In addition, the task B
メッセージ受信キュー管理部6は、監視システムコールを受信すると、タスクBのメッセージ受信キュー112の滞留量を確認する。メッセージ受信キュー管理部6は、その確認した滞留量を示す情報を、監視システムコールの応答情報として生成し、その応答情報を、システムコール処理部2を介してタスクAの復旧検出部14に送信する。
When the message reception queue management unit 6 receives the monitoring system call, the message reception queue management unit 6 checks the staying amount of the
復旧検出部14は、応答情報を受信すると、その応答情報に基づいて、タスクBのメッセージ受信キュー112の滞留量が輻輳復旧閾値を下回ったか否かを判断する。例えば、復旧検出部14は、一つ前の応答情報が示す滞留量を保持し、その保持している滞留量が輻輳復旧閾値以上であり、新たに受信した応答情報が示す輻輳復旧閾値未満であると、タスクBのメッセージ受信キュー112の滞留量が輻輳復旧閾値を下回ったと判断する。
Upon receiving the response information, the
復旧検出部14は、メッセージ受信キュー112の滞留量が輻輳復旧閾値を下回っていないと判断すると、動作を終了する。一方、復旧検出部14は、メッセージ受信キュー112の滞留量が輻輳復旧閾値を下回ったと判断すると、タスクBのメッセージ受信キュー112の輻輳が復旧したと判断する。これにより、情報処理装置100が輻輳復旧状態であると判断する。
When the
輻輳復旧状態では、復旧検出部14は、滞留量が輻輳復旧閾値を下回った旨をスケジューラ管理部15に通知する。スケジューラ管理部15は、その旨を受信すると、メッセージ転送部12にメッセージの送信の停止を指示して、メッセージ転送部12によるメッセージの送信を停止する。
In the congestion recovery state, the
スケジューラ管理部15は、タスクBを登録する登録システムコールを生成し、その登録システムコールを、システムコール処理部2およびスケジューリング部4を介して、レディーキュー管理部3に通知する。なお、登録システムコールは、タスクB用の優先度と、タスクBの識別情報(タスクB2)とを含む。
The
レディーキュー管理部3は、登録システムコールを受信すると、登録システムコール内の優先度および識別情報を対応付けて、レディーキュー111に登録する。その後、レディーキュー管理部3は、タスクBの登録が終了したことを示す情報を、登録システムコールの応答情報として生成し、その応答情報を、スケジューリング部4およびシステムコール処理部2を介して、タスクBのスケジューラ管理部15に送信する。
When receiving the registration system call, the ready queue management unit 3 associates the priority and identification information in the registration system call and registers them in the ready queue 111. Thereafter, the ready queue management unit 3 generates information indicating that the registration of the task B is completed as response information of the registration system call, and the response information is transmitted via the
スケジューラ管理部15は、その応答情報を受信すると、タスクBを終了する終了システムコールを生成し、その終了システムコールを、システムコール処理部2を介してスケジューリング部4に通知する。なお、終了システムコールは、タスクBの識別情報(タスクB1)を含む。
When the
スケジューリング部4は、終了システムコールを受信すると、終了システムコール内の識別情報にて特定されるタスクを終了する終了処理を行う。これにより、タスクBが終了される。
When the
その後、OS部1が、レディーキュー111内の最も高い優先度に対応する識別情報が特定するタスクを実行する。今、タスクAの優先度が最も高いので、タスクAが実行される。これにより、情報処理装置100が状態γに遷移する。
Thereafter, the
状態γでは、タスクAのメッセージ転送部12が、タスクAのメッセージ受信キュー112内のメッセージを、タスクAのメッセージ受信キュー112に送信する。
In the state γ, the
次に効果を説明する。 Next, the effect will be described.
本実施形態では、メッセージ転送部12は、実行中のタスクに対応するメッセージ受信キュー112内のメッセージを、送信先のメッセージ受信キュー112に送信する。輻輳検出部13は、送信先のメッセージ受信キュー112の滞留量が輻輳発生閾値以上か否かを判断する。スケジューラ管理部15は、輻輳検出部13にて滞留量が輻輳発生閾値以上であると判断されると、メッセージ転送部12によるメッセージの送信を停止し、かつ、レディーキュー111内の、送信先のメッセージ受信キュー112に対応するタスクの優先度を、実行中のタスクの優先度より高い優先度に変更する。そして、スケジューラ管理部15は、その実行中のタスクを終了する。
In the present embodiment, the
この場合、送信先のメッセージ受信キュー112の滞留量が輻輳発生閾値以上になると、その送信先のメッセージ受信キュー112に対応するタスクの優先度が、実行中のタスクの優先度より高い優先度に変更される。また、その実行中のタスクが終了される。
In this case, when the retention amount of the
したがって、送信先のメッセージ受信キュー112がメッセージを蓄えられなくなる前に、その送信先のメッセージ受信キュー112に対応するタスクを実行することが可能になる。よって、メッセージ受信キュー112がメッセージを蓄えることができなくなることを抑制することが可能になるので、メッセージが破棄されることを抑制することが可能になる。
Therefore, it becomes possible to execute a task corresponding to the
また、本実施形態では、復旧検出部14は、実行中のタスクに対応するメッセージ受信キュー112内の滞留量が、輻輳発生閾値より小さい輻輳復旧閾値を下回ったか否かを判断する。スケジューラ管理部15は、復旧検出部14にて滞留量が輻輳復旧閾値を下回ったと判断された場合、優先度を変更しタスクの識別情報をレディーキューから削除して、実行中のタスクを終了する。
Further, in the present embodiment, the
この場合、メッセージ受信キュー112の輻輳が復旧された場合に、元の優先度に従ってタスクを実行することが可能になる。
In this case, when the congestion of the
以上説明した各実施形態において、図示した構成は単なる一例であって、本発明はその構成に限定されるものではない。 In each embodiment described above, the illustrated configuration is merely an example, and the present invention is not limited to the configuration.
例えば、タスクAないしCは、アプリケーションプログラムにて実現されていたが、ミドルウェア、ファームウェアおよびドライバなどにて実現されてもよい。 For example, the tasks A to C are realized by an application program, but may be realized by middleware, firmware, a driver, or the like.
1 OS部
2 システムコール処理部
3 レディーキュー管理部
4 スケジューリング部
5 ディスパッチ部
6 メッセージ受信キュー管理部
11 アプリケーション部
12 メッセージ転送部
13 送信先タスクメッセージ受信キュー輻輳検出部
14 自タスクメッセージ受信キュー輻輳復旧検出部
100 情報処理装置
101 記憶部
102 情報処理部
111 レディーキュー
112 メッセージ受信キュー
DESCRIPTION OF
Claims (4)
前記複数のタスクと、
各タスクの識別情報を、該タスクの優先度と対応付けて記憶する優先度記憶手段と、
各タスクに対応し、該タスク用のメッセージを蓄える複数のメッセージ記憶手段と、
前記優先度記憶手段内の識別情報のうち、最も高い優先度に対応する識別情報にて特定されるタスクを実行する制御手段と、を含み、
各タスクは、
自タスクが実行中の場合、自タスクである実行中のタスクに対応するメッセージ記憶手段内のメッセージを、該メッセージの送信先のメッセージ記憶手段に送信する転送手段と、
自タスクが実行中の場合、前記送信先のメッセージ記憶手段内のメッセージの量が予め定められた第一閾値以上であるか否かを判断する判断手段と、を含み、
前記タスクスケジューリング装置は、前記判断手段にて前記メッセージの量が前記第一閾値以上であると判断された場合、前記転送手段による前記メッセージの送信を停止し、かつ、前記優先度記憶手段内の、前記送信先のメッセージ記憶手段に対応するタスクの優先度を、前記実行中のタスクの優先度より高い優先度に変更して、前記実行中のタスクを終了する管理手段と、を含むタスクスケジューリング装置。 A task scheduling device that executes a plurality of tasks in order from a task with a higher priority,
The plurality of tasks;
Priority storage means for storing identification information of each task in association with the priority of the task;
A plurality of message storage means corresponding to each task and storing messages for the task;
Control means for executing a task specified by the identification information corresponding to the highest priority among the identification information in the priority storage means ,
Each task is
When the own task is being executed, a transfer means for sending a message in the message storage means corresponding to the executing task that is the own task to the message storage means that is the destination of the message;
A determination means for determining whether or not the amount of messages in the message storage means of the transmission destination is equal to or more than a predetermined first threshold when the own task is being executed ;
The task scheduling apparatus stops transmission of the message by the transfer unit when the determination unit determines that the amount of the message is equal to or greater than the first threshold, and stores the message in the priority storage unit Management means for changing the priority of the task corresponding to the message storage means of the transmission destination to a priority higher than the priority of the task being executed, and ending the task being executed apparatus.
各タスクは、自タスクが実行中の場合、自タスクである実行中のタスクに対応するメッセージ記憶手段内のメッセージの量が、前記第一閾値より小さい第二閾値を下回ったか否かを判断する判定手段を含み、
前記管理手段は、前記判定手段にて前記メッセージの量が前記第二閾値を下回ったと判断された場合、前記優先度を変更したタスクの識別情報を前記優先度記憶手段から削除して、前記実行中のタスクを終了する、タスクスケジューリング装置。 The task scheduling apparatus according to claim 1,
Each task determines whether or not the amount of messages in the message storage means corresponding to the task that is being executed is lower than a second threshold value that is smaller than the first threshold value , when the task is being executed. Including determination means,
When the determination unit determines that the amount of the message is lower than the second threshold, the management unit deletes the identification information of the task whose priority has been changed from the priority storage unit, and executes the execution A task scheduling device that terminates a task in progress.
前記優先度記憶手段内の識別情報のうち、最も高い優先度に対応する識別情報にて特定されるタスクを実行し、
各タスクが、実行中の場合、自タスクである実行中のタスクに対応するメッセージ記憶手段内のメッセージを、該メッセージの送信先のメッセージ記憶手段に送信し、
各タスクが、実行中の場合、前記送信先のメッセージ記憶手段内のメッセージの量が予め定められた第一閾値以上であるか否かを判断し、
前記メッセージの量が前記第一閾値以上であると判断された場合、前記メッセージの送信を停止し、かつ、前記優先度記憶手段内の、前記送信先のメッセージ記憶手段に対応するタスクの優先度を、前記実行中のタスクの優先度より高い優先度に変更し、
前記実行中のタスクを終了する、タスクスケジューリング方法。 The respective identification information of a plurality of tasks, the priority storage means for storing in association with the priority of the task corresponding to each task, and a plurality of message storage for storing the message for the task, wherein the plurality of A task scheduling method including a task , and a scheduling method comprising:
Of the identification information in the priority storage means, execute the task specified by the identification information corresponding to the highest priority,
When each task is being executed, the message in the message storage means corresponding to the task being executed that is the own task is transmitted to the message storage means that is the destination of the message,
When each task is being executed, it is determined whether or not the amount of messages in the destination message storage means is greater than or equal to a predetermined first threshold;
If it is determined that the amount of the message is equal to or greater than the first threshold, the priority of a task corresponding to the destination message storage unit in the priority storage unit is stopped. To a higher priority than the priority of the task being executed,
A task scheduling method for ending the task being executed.
各タスクが、実行中の場合、自タスクである実行中のタスクに対応するメッセージ記憶手段内のメッセージの量が、前記第一閾値より小さい第二閾値を下回ったか否かを判断し、
前記メッセージの量が前記第二閾値を下回ったと判断された場合、前記優先度を変更したタスクの識別情報を前記優先度記憶手段から削除し、
前記実行中のタスクを終了する、タスクスケジューリング方法。 The task scheduling method according to claim 3, wherein
If each task is running , determine whether the amount of messages in the message storage means corresponding to the running task that is its own task is below a second threshold value that is smaller than the first threshold value,
If it is determined that the amount of the message has fallen below the second threshold, the task identification information that has changed the priority is deleted from the priority storage means,
A task scheduling method for ending the task being executed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008210535A JP5262418B2 (en) | 2008-08-19 | 2008-08-19 | Task scheduling apparatus and task scheduling method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008210535A JP5262418B2 (en) | 2008-08-19 | 2008-08-19 | Task scheduling apparatus and task scheduling method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2010049314A JP2010049314A (en) | 2010-03-04 |
JP5262418B2 true JP5262418B2 (en) | 2013-08-14 |
Family
ID=42066368
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008210535A Expired - Fee Related JP5262418B2 (en) | 2008-08-19 | 2008-08-19 | Task scheduling apparatus and task scheduling method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5262418B2 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9189529B2 (en) * | 2013-02-14 | 2015-11-17 | Ab Initio Technology Llc | Queue monitoring and visualization |
JP6331555B2 (en) * | 2014-03-26 | 2018-05-30 | 日本電気株式会社 | Message exchange device, message exchange method, and computer program |
JP7259435B2 (en) * | 2019-03-18 | 2023-04-18 | 株式会社リコー | Terminal device, information processing system, and information processing method |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3082297B2 (en) * | 1991-04-30 | 2000-08-28 | 日本電気株式会社 | Task control method |
JPH0793168A (en) * | 1993-09-21 | 1995-04-07 | Fuji Electric Co Ltd | Task management system |
JP3245500B2 (en) * | 1994-04-28 | 2002-01-15 | エヌイーシーマイクロシステム株式会社 | Event management method in multi-programming |
JPH11237993A (en) * | 1998-02-20 | 1999-08-31 | Matsushita Electric Ind Co Ltd | Method and device for controlling task priority |
-
2008
- 2008-08-19 JP JP2008210535A patent/JP5262418B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2010049314A (en) | 2010-03-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10884786B2 (en) | Switch device, switching method, and computer program product | |
US7676610B2 (en) | Device and method for optimization of target host device process handling according to the status and the priority of the target host device process | |
CN100504791C (en) | Method and device for mutual repulsion access of multiple CPU to critical resources | |
US8949566B2 (en) | Locking access to data storage shared by a plurality of compute nodes | |
CN107451012B (en) | Data backup method and stream computing system | |
US8402190B2 (en) | Network adaptor optimization and interrupt reduction | |
US10592317B2 (en) | Timeout processing for messages | |
JP6287451B2 (en) | Data receiving apparatus, data receiving apparatus control method, and data transmitting / receiving system having data transmitting apparatus and data receiving apparatus | |
EP2811402A1 (en) | Transaction resuming program, information processing apparatus and transaction resuming method | |
US20170235685A1 (en) | I/o processing system including dynamic missing interrupt and input/output detection | |
JP5262418B2 (en) | Task scheduling apparatus and task scheduling method | |
US5737240A (en) | Programmable hardware mailbox message technique and system | |
US10305772B2 (en) | Using a single work item to send multiple messages | |
JP2014096162A (en) | Interface conversion device and interface conversion method | |
WO2017107083A1 (en) | Data sending method and receiving method, apparatus and system | |
JPH11237993A (en) | Method and device for controlling task priority | |
WO2010061482A1 (en) | Testing apparatus, serial transmission system, program, and recording medium | |
CN117593172B (en) | Process management method, device, medium and equipment | |
CN112152938B (en) | Method for determining round trip delay in cloud virtual environment | |
CN114979169B (en) | Network resource pushing method and device, storage medium and electronic equipment | |
CN116414585A (en) | Service data recovery method and device, electronic equipment and storage medium | |
JP2007323256A (en) | Interruption control method and information processor | |
JP6126259B1 (en) | Monitoring device, monitoring method, and program | |
CN116339205A (en) | Diagnostic information synchronization method, device, electronic equipment and storage medium | |
CN115776475A (en) | Message processing method and device, electronic equipment and computer storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20110714 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20121114 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20121127 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20130128 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20130402 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20130415 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 Ref document number: 5262418 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
LAPS | Cancellation because of no payment of annual fees |