JPH09319596A - Device and method for scheduling task - Google Patents

Device and method for scheduling task

Info

Publication number
JPH09319596A
JPH09319596A JP8138675A JP13867596A JPH09319596A JP H09319596 A JPH09319596 A JP H09319596A JP 8138675 A JP8138675 A JP 8138675A JP 13867596 A JP13867596 A JP 13867596A JP H09319596 A JPH09319596 A JP H09319596A
Authority
JP
Japan
Prior art keywords
task
time
time limit
processing
management table
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.)
Withdrawn
Application number
JP8138675A
Other languages
Japanese (ja)
Inventor
Hiroyasu Watanabe
浩康 渡辺
Seiji Sasaki
誠司 佐々木
Masataka Bessho
正隆 別所
Atsushi Hirahara
厚志 平原
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP8138675A priority Critical patent/JPH09319596A/en
Publication of JPH09319596A publication Critical patent/JPH09319596A/en
Withdrawn legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide a device and a method for scheduling task with which a lot of processings can be performed and the use efficiency of a CPU is improved. SOLUTION: The time and state of limitation for each task are set to a limit time managing table 500. A time priority scheduling mechanism 300 is activated each time an event is generated or a task is finished and while referring to the limit time managing table 500, among tasks not in standstill state, the task having minimum limit time is dispatched as the next execution task. Thus, a lot of processings are performed without generating any CPU idle time.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は、マルチタスクプロ
グラムのスケジューリングにかかる装置および方法に関
するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an apparatus and method for scheduling a multitask program.

【0002】[0002]

【従来の技術】従来のタスクスケジューリング方式とし
ては、以下の2つの方式が挙げられる。
2. Description of the Related Art As conventional task scheduling methods, there are the following two methods.

【0003】第1の方式は、固定優先順位スケジューリ
ングといい、ユーザが指定した固定の優先順位に忠実に
従って、事象駆動(イベントドリブン)でスケジューラ
が複数のタスクの実行順序を決定する方式である。
The first method is called fixed priority scheduling, and is a method in which the scheduler determines the execution order of a plurality of tasks in an event driven manner in accordance with the fixed priority specified by the user.

【0004】第2の方式は、時限優先(デッドライン)
スケジューリングといい、各タスク毎に制限時間を時間
管理テーブルに設定しておき、ある一定間隔毎に制限時
間をその一定間隔分デクリメントしていく。その際に、
新しい事象が生じていれば、新たにその処理に対応した
タスクの制限時間を時間管理テーブルに追加設定した上
で、時間管理テーブルをチェックし、すべてのタスクの
制限時間の中で最も残り時間が少ないものを次の実行タ
スクとし、タイムスライス(一定時間間隔)でスケジュ
ーラが複数のタスクの実行順序を決定する方式である。
The second method is timed priority (deadline).
This is called scheduling, and a time limit is set in the time management table for each task, and the time limit is decremented by a certain fixed interval. At that time,
If a new event has occurred, newly set the time limit of the task corresponding to the process, check the time management table, and check the time management table to find out the remaining time of all tasks. This is a method in which the scheduler determines the execution order of a plurality of tasks at a time slice (constant time interval) with the smallest number as the next execution task.

【0005】[0005]

【発明が解決しようとする課題】しかしながら、前述の
従来のスケジューリング方式には、以下のような問題点
があった。
However, the above-described conventional scheduling method has the following problems.

【0006】(第1の方式) a.問題点1:優先順位が固定の為、外界からのシステ
ムへの処理要求の頻度,間隔,種類の変動等に対する適
応性に欠ける。
(First Method) a. Problem 1: Since the priority order is fixed, it lacks adaptability to changes in the frequency, interval, and type of processing requests from the outside world to the system.

【0007】b.問題点2:アプリオリに想定された外
界からの処理要求の場合であっても、CPU使用効率を
100%にあげることはできない。
B. Problem 2: Even in the case of an a priori processing request from the outside world, the CPU usage efficiency cannot be increased to 100%.

【0008】といった問題がある。[0008] There is a problem.

【0009】例えば、タスク(1)〔制限時間20m
s、処理時間10ms〕とタスク(2)〔制限時間30
ms、処理時間15ms〕の2つの周期タスクのスケジ
ューリングを考える(制限時間=タスク起動周期とす
る)。タスク(1)の方が制限時間が短いので、優先順
位を高くしてスケジューリングすると、タスク(1)
〔10ms〕→タスク(2)〔10ms〕→タスク
(1)〔10ms〕と実行した所で、タスク(2)の処
理が5ms残っているにも関わらず、タスク(2)の制
限時間30msを経過してしまうことがわかる。従って
スケジューリングは間に合わず、またシステムの使用効
率を100%にあげることはできない。この為、制限時
間を重視するハードリアルタイムシステムを実現する為
には、第2の方式でスケジューリングを行っていた。
For example, task (1) [time limit 20 m
s, processing time 10 ms] and task (2) [time limit 30
ms, processing time 15 ms], consider scheduling of two periodic tasks (time limit = task activation period). Task (1) has a shorter time limit, so if you schedule tasks with higher priority, task (1)
[10 ms] → task (2) [10 ms] → task (1) [10 ms] is executed, and although the processing of task (2) remains 5 ms, the time limit of task (2) is 30 ms. You can see that it has passed. Therefore, scheduling cannot be done in time and the system usage efficiency cannot be raised to 100%. Therefore, in order to realize a hard real-time system that attaches importance to time limits, the second method is used for scheduling.

【0010】(第2の方式)複数のタスクの制限時間残
を時間管理テーブルで管理し、最も制限時間残が少ない
タスクを次の実行タスクとする、動的な優先順位の変更
をスケジューラが実施することで、固定優先順位より効
率的にタスクをスケジューリングすることができる。し
かし、固定優先順位スケジューリングよりは効率的であ
るが、次の問題点3がある。
(Second Method) The scheduler executes a dynamic priority change in which the remaining time limit of a plurality of tasks is managed by a time management table, and the task with the smallest remaining time limit is set as the next execution task. By doing so, the task can be scheduled more efficiently than the fixed priority. However, it is more efficient than fixed priority scheduling, but has the following problem 3.

【0011】c.問題点3:スケジューリングのタイミ
ングがタイムスライスのため処理要求があるにも関わら
ず、最大でタイムスライス間隔までのCPU空き時間を
生じさせる可能性がある。
C. Problem 3: Even if there is a processing request because the scheduling timing is a time slice, there is a possibility that a CPU idle time up to the time slice interval will occur.

【0012】例えば、前述と同じ例、タスク(1)〔制
限時間20ms、処理時間10ms〕とタスク(2)
〔制限時間30ms、処理時間15ms〕の2つの周期
タスクのスケジューリングを考える(制限時間=タスク
起動周期とする)。スケジューラの起動されるタイムス
ライスの間隔を10msとすると、タスク(1)〔10
ms〕→タスク(2)〔10ms〕→タスク(2)〔5
ms〕→アイドル〔5ms〕→タスク(1)〔10m
s〕→タスク(1)〔10ms〕→タスク(2)〔10
ms〕と実行した所で、タスク(2)の処理が5ms残
っているにも関わらず、タスク(2)の2回目の周期に
おける制御時間30msを経過してしまうことがわか
る。タイムスライスの間隔が10msである為に、CP
Uを使用しない無駄なアイドル時間が5ms生じてお
り、スケジューリングは間に合わない。この方式でも、
システムの使用効率を100%にあげることはできな
い。
For example, the same example as described above, task (1) [time limit 20 ms, processing time 10 ms] and task (2)
Consider scheduling of two periodic tasks of [time limit 30 ms, processing time 15 ms] (time limit = task activation period). Assuming that the time slice interval at which the scheduler is activated is 10 ms, task (1) [10
ms] → task (2) [10 ms] → task (2) [5
ms] → idle [5 ms] → task (1) [10 m
s] → task (1) [10 ms] → task (2) [10
[ms]], it can be seen that the control time of 30 ms in the second cycle of task (2) elapses even though the processing of task (2) remains for 5 ms. Since the time slice interval is 10 ms, CP
The idle time not using U is 5 ms, and the scheduling cannot be done in time. Even with this method,
The usage efficiency of the system cannot be raised to 100%.

【0013】(第1および第2の方式に共通) d.問題点4:処理要求をその制限時間内に行うことが
できるか否かを処理要求の発生時点で予測することはで
きない。
(Common to the first and second methods) d. Problem 4: It is not possible to predict at the time when the processing request occurs whether or not the processing request can be performed within the time limit.

【0014】本発明は、このような状況のもとでなされ
たもので、多くの処理を行うことができ、またCPUの
使用効率を高めることのできるスケジューリング装置お
よび方法を提供することを目的とするものである。
The present invention has been made under such circumstances, and an object of the present invention is to provide a scheduling device and method capable of performing a large number of processes and improving the CPU usage efficiency. To do.

【0015】[0015]

【課題を解決するための手段】前記問題点1,2,3
は、従来技術の第2の方式における、時限優先スケジュ
ーリングにおいてスケジューリングのタイミングをタイ
ムスライスでなく、事象駆動にすることによって解決で
きる。
[Means for Solving the Problems] The Problems 1, 2, 3
Can be solved by setting the scheduling timing to be event-driven instead of time slice in the time-priority scheduling in the second method of the related art.

【0016】前記問題点4は、従来技術の第2の方式に
おける、時限優先スケジューリングにおいてスケジュー
リングのタイミングをタイムスライスでなく、事象駆動
にする機構、および各タスクの処理時間の履歴をもとに
システム負荷を監視する機構を提供することによって達
成される。
Problem 4 is the system based on the mechanism of making the timing of scheduling in the time-priority scheduling in the second method of the prior art not the time slice but the event, and the history of the processing time of each task. This is accomplished by providing a mechanism to monitor the load.

【0017】詳しくは、タスクスケジューリング装置を
次の(1)〜(4)のとおりに、またタスクスケジュー
リング方法を次の(5)のとおりに構成する。
More specifically, the task scheduling device is configured as in the following (1) to (4) and the task scheduling method is configured as in the following (5).

【0018】(1)タスク毎の制限時間および状態を設
定した時間管理テーブルと、事象発生およびタスク終了
毎に起動され、前記時間管理テーブルを参照し、休止状
態でないタスクのうちで前記制限時間の最も少ないタス
クを次の実行タスクとしてディスパッチする時限優先ス
ケジューリング機構とを備えたタスクスケジューリング
装置。
(1) A time management table in which a time limit and a status are set for each task, and the time management table that is activated each time an event occurs and the task ends is referred to, and the time limit table of the tasks that are not in the sleep state A task scheduling device provided with a timed priority scheduling mechanism for dispatching the least number of tasks as the next execution task.

【0019】(2)タスクの処理が制限時間内に実行で
きない危険性があると判定したとき、その旨の表示を行
うタスク負荷監視機構を備えた前記(1)記載のタスク
スケジューリング装置。
(2) The task scheduling device according to (1), further comprising a task load monitoring mechanism for displaying a message indicating that there is a risk that the task processing cannot be executed within the time limit.

【0020】(3)タスク負荷監視機構は、次の(a)
の条件式が成立したときに、危険性があると判定するも
のである前記(2)記載のタスクスケジューリング装
置。
(3) The task load monitoring mechanism uses the following (a)
The task scheduling device according to (2) above, which determines that there is a risk when the conditional expression of is satisfied.

【0021】 (a)Σ〔T(n)−t(n)〕/L(n)>1 ここでΣは、n=1,2,3……,タスク数、のうちタ
スクの状態が休止状態でないものの合計を表し、L
(n)はタスク(n)の制限時間、t(n)は現在実行
途中のタスク(n)の処理時間、T(n)はタスク
(n)の過去の処理時間の履歴で、過去のt(n)をも
とに平均や最大等を計算した値である。
(A) Σ [T (n) -t (n)] / L (n)> 1 Here, Σ is a task state of n = 1, 2, 3 ... Represents the total of non-states, L
(N) is the time limit of the task (n), t (n) is the processing time of the task (n) that is currently being executed, T (n) is the history of the past processing time of the task (n), and the past t It is a value obtained by calculating the average, maximum, etc. based on (n).

【0022】(4)タスク負荷監視機構は、次の(b)
の条件式が成立したときに、危険性があると判定するも
のである前記(2)記載のタスクスケジューリング装
置。
(4) The task load monitoring mechanism has the following (b)
The task scheduling device according to (2) above, which determines that there is a risk when the conditional expression of is satisfied.

【0023】(b)ΣT(n)/I(n)>1 ここでΣは、n=1,2,3……,タスク数、の合計を
表し、I(n)はタスク(n)の制限時間初期値、T
(n)はタスク(n)の過去の処理時間の履歴で、過去
のt(n)をもとに平均や最大等を計算した値である。
(B) ΣT (n) / I (n)> 1 Here, Σ represents the total of n = 1, 2, 3, ..., Number of tasks, and I (n) is the number of tasks (n). Initial time limit, T
(N) is a history of past processing times of task (n), and is a value obtained by calculating an average, maximum, etc. based on past t (n).

【0024】(5)時限優先スケジューリングのタイミ
ングを事象駆動としたタスクスケジューリング方法。
(5) A task scheduling method in which the timing of the timed priority scheduling is event driven.

【0025】[0025]

【発明の実施の形態】以下本発明をタスクスケジューリ
ング装置の実施例により詳しく説明する。
BEST MODE FOR CARRYING OUT THE INVENTION The present invention will be described in detail below with reference to an embodiment of a task scheduling device.

【0026】(実施例1)図1は、実施例1である“タ
スクスケジューリング装置”の構成を示す図である。以
下に説明する処理は不図示のCPUにより行われる。図
1において、本実施例を含むシステムは割込発生により
割込処理20が起動され、事象発生通知を受けタスク登
録機構100で事象に対応するタスク(n)の制限時間
初期値(I(n))600を制限時間管理テーブル50
0に制限時間(L(n))520として登録し時限優先
スケジューリング機構300を起動する。時限優先スケ
ジューリング機構300では、制限時間管理テーブル5
00に登録されているタスクの内、最も制限時間(L
(n))520が残り少ないタスクを検索し次の実行タ
スクとしてディスパッチする。異なる事象が連続して発
生すれば、制限時間管理テーブル500には、複数のタ
スクが登録され、その内制限時間(L(n))520の
最も少ないものが実行タスクとなる。これとは非同期
に、タイマ割込処理30により起動されるタイマ機構に
よって、制限時間管理テーブル500に登録されている
各タスクの制限時間(L(n))520はデクリメント
される。各タスクは、その処理が終了したらタスク削除
機構400に処理終了通知を発行する。タスク削除機構
400は、制限時間管理テーブル500で管理している
スケジューリング対象タスクから該当タスクを削除し
(SUSPEND)、時限優先スケジューリング機構3
00を起動する。このような形で、事象発生および処理
終了時に直ちにタスクスケジューリングを行う(すなわ
ち事象駆動を行う)。
(Embodiment 1) FIG. 1 is a diagram showing a configuration of a "task scheduling apparatus" which is Embodiment 1. The processing described below is performed by a CPU (not shown). In the system including the present embodiment, an interrupt process 20 is activated by an interrupt occurrence in FIG. 1, and upon receipt of an event occurrence notification, the task registration mechanism 100 receives an initial time limit value (I (n )) 600 is the time limit management table 50
0 is registered as a time limit (L (n)) 520, and the time priority scheduling mechanism 300 is activated. In the time limit priority scheduling mechanism 300, the time limit management table 5
Of the tasks registered in 00, the maximum time limit (L
(N)) 520 retrieves the remaining few tasks and dispatches them as the next execution tasks. If different events occur successively, a plurality of tasks are registered in the time limit management table 500, and the task with the smallest time limit (L (n)) 520 among them is the execution task. Asynchronously with this, the time limit (L (n)) 520 of each task registered in the time limit management table 500 is decremented by the timer mechanism activated by the timer interrupt processing 30. Each task issues a processing end notification to the task deletion mechanism 400 when the processing is completed. The task deletion mechanism 400 deletes the corresponding task from the scheduling target tasks managed by the time limit management table 500 (SUSPEND), and the time priority scheduling mechanism 3
00 is started. In this way, task scheduling is performed immediately after the occurrence of an event and the end of processing (that is, event-driven).

【0027】図6に示すように、制限時間管理テーブル
500は、タスク識別子にあたるタスク(n)510
と、そのタスク(n)の現在の制限時間の残りを表すL
(n)520と、タスク(n)の状態を表すSTATU
S(n)530情報を含んで格納されている。STAT
US(n)530のとり得る値は、EXECUTE(実
行中),READY(実行可能),SUSPEND(休
止)の3つの状態のいずれかである。STATUS
(n)530の初期状態は、SUSPENDである。S
TATUS(n)530には、事象発生時、タスク登録
機構100によってその事象にかかるタスク(n)にR
EADYがセットされ、時限優先スケジューリング機構
300で実行タスクとなればEXECUTEがセットさ
れ、タスク処理終了時、タスク削除機構400でSUS
PENDがセットされる。L(n)520には、事象発
生時、タスク登録機構100によって制限時間初期値I
(n)620がセットされ(図7参照)、STATUS
(n)530がREADYまたはEXECUTEである
間タイマ機構200によってデクリメントされる。常に
制限時間L(n)520の小さいタスクが実行されるよ
う時限優先スケジューリング機構300は、事象発生時
はタスク登録機構100から、タスク処理終了時はタス
ク削除機構400から起動されスケジューリングを行
う。
As shown in FIG. 6, the time limit management table 500 has a task (n) 510 corresponding to a task identifier.
And L representing the remaining time limit of the task (n)
(N) 520 and STATUS indicating the status of task (n)
It is stored including S (n) 530 information. STAT
A possible value of US (n) 530 is one of three states: EXECUTE (in execution), READY (executable), and SUSPEND (pause). STATUS
The initial state of (n) 530 is SUSPEND. S
In the TATUS (n) 530, when an event occurs, the task registration mechanism 100 assigns R to the task (n) related to the event.
When EADY is set and EXECUTION is set by the timed priority scheduling mechanism 300, EXECUTE is set, and when the task processing ends, SUS is set by the task deletion mechanism 400.
PEND is set. The L (n) 520 has a time limit initial value I by the task registration mechanism 100 when an event occurs.
(N) 620 is set (see FIG. 7), STATUS
(N) Decremented by timer mechanism 200 while 530 is READY or EXECUTE. The time-limited priority scheduling mechanism 300 is activated by the task registration mechanism 100 when an event occurs and by the task deletion mechanism 400 when task processing is completed so that a task with a small time limit L (n) 520 is always executed.

【0028】図7に示すように、制限時間初期値600
は、タスク識別子にあたるタスク(n)610と、その
タスク(n)の制限時間初期値を表すI(n)620情
報を含んで格納されている。制限時間初期値I(n)6
20には、タスク(n)が周期起動タスクであればその
周期時間間隔をあらかじめセットしておく。また、タス
ク(n)が周期タスクでなければ、ユーザが任意にその
タスクの処理を実行する為に許容される制限時間初期値
をセットしておく。制限時間初期値I(n)620は、
事象発生時、タスク登録機構100により参照され、制
限時間管理テーブル500の制限時間L(n)520に
セットされる。
As shown in FIG. 7, a time limit initial value 600
Is stored including the task (n) 610 corresponding to the task identifier and I (n) 620 information indicating the initial value of the time limit of the task (n). Initial time limit value I (n) 6
If the task (n) is a periodical activation task, the periodical time interval is preset in 20. Further, if the task (n) is not a periodic task, the initial value of the time limit allowed for the user to arbitrarily execute the processing of the task is set. The time limit initial value I (n) 620 is
When an event occurs, it is referred to by the task registration mechanism 100 and set in the time limit L (n) 520 of the time limit management table 500.

【0029】図2に基づき、タスク登録機構100の詳
細を説明する。まず、内部テーブルから発生した事象に
対応するタスクを検索する(ステップ110)。該当タ
スク(n)をもとに制限時間初期値600から、そのタ
スクの初期値I(n)620を得る(ステップ12
0)。I(n)620を制限時間管理テーブル500の
L(n)520にセットし、同時に制限時間管理テーブ
ル500のSTATUS(n)にREADYをセットす
る(ステップ130)。最後に時限優先スケジューリン
グ機構300に起動をかけ(ステップ140)スケジュ
ーリングを実行する。
Details of the task registration mechanism 100 will be described with reference to FIG. First, the internal table is searched for a task corresponding to the generated event (step 110). The initial value I (n) 620 of the task is obtained from the initial value 600 of the time limit based on the task (n) (step 12).
0). I (n) 620 is set in L (n) 520 of the time limit management table 500, and at the same time READY is set in STATUS (n) of the time limit management table 500 (step 130). Finally, the time-limited priority scheduling mechanism 300 is activated (step 140) to execute scheduling.

【0030】図3に基づき、タイマ機構200の詳細を
説明する。まず、制限時間管理テーブル500検索の為
のインデックスをn=1に初期化する(ステップ21
0)。以降の処理をタスク(n)==ENDとなるまで
繰り返す(分岐220)。STATUS=SUSPEN
Dでないなら(分岐221)制限時間管理テーブル50
0の制限時間L(n)520をデクリメントする(ステ
ップ222)。インデックスnをインクリメントする
(ステップ230)。
Details of the timer mechanism 200 will be described with reference to FIG. First, the index for searching the time limit management table 500 is initialized to n = 1 (step 21).
0). The subsequent processing is repeated until the task (n) == END (branch 220). STATUS = SUSPEN
If it is not D (branch 221), the time limit management table 50
The time limit L (n) 520 of 0 is decremented (step 222). The index n is incremented (step 230).

【0031】図4に基づき、時限優先スケジューリング
機構300の詳細を説明する。まず、制限時間管理テー
ブル500検索の為のインデックスをn=0に初期化す
る(ステップ310)。制限時間の最小値を求める為の
一時変数Minを変数のとり得る最大値に初期化する
(ステップ320)。次の実行タスクの識別子を格納す
る一時変数NextTaskをIDLE(アイドルタス
ク識別子)に初期化する(ステップ330)。インデッ
クスnをインクリメントする(ステップ340)。以降
の処理ステップ342からステップ346をタスク
(n)==ENDとなるまで繰り返す(分岐341)。
STATUS≠SUSPENDなら(分岐342)制限
時間管理テーブル500のSTATUS(n)530を
READYにセットする(ステップ343)。さらに、
Min>L(n)ならば(分岐344)、Min=L
(n)(ステップ345)、NextTask=n(ス
テップ346)として制限時間L(n)がより小さいタ
スクを検索していく。タスク(n)==ENDとなった
ら(分岐341)ループを終了し、制限時間管理テーブ
ル500のSTATUS(n)530にEXECUTE
をセットし実行中のマークをつける(ステップ35
0)。最後にタスク(NextTask)を次の実行タ
スクとしてディスパッチする(ステップ360)。
Details of the timed priority scheduling mechanism 300 will be described with reference to FIG. First, the index for searching the time limit management table 500 is initialized to n = 0 (step 310). The temporary variable Min for obtaining the minimum value of the time limit is initialized to the maximum value that the variable can take (step 320). A temporary variable NextTask for storing the identifier of the next execution task is initialized to IDLE (idle task identifier) (step 330). The index n is incremented (step 340). The subsequent processing steps 342 to 346 are repeated until the task (n) == END (branch 341).
If STATUS ≠ SUSPEND (branch 342), STATUS (n) 530 of the time limit management table 500 is set to READY (step 343). further,
If Min> L (n) (branch 344), Min = L
(N) (step 345) and NextTask = n (step 346) are set to search for a task having a shorter time limit L (n). When task (n) == END (branch 341), the loop is ended, and EXECUTE is set in STATUS (n) 530 of the time limit management table 500.
And set the mark of running (step 35
0). Finally, the task (NextTask) is dispatched as the next execution task (step 360).

【0032】図5に基づき、タスク削除機構400の詳
細を説明する。まず、制限時間管理テーブル500検索
の為のインデックスをn=1に初期化する(ステップ4
10)。以降の処理をタスク(n)==ENDとなるま
で繰り返す(分岐420)。タスク(n)==終了タス
クでないなら(分岐421)、次を検索する為インデッ
クスnをインクリメントする(ステップ422)。タス
ク(n)==終了タスクなら(分岐421)、そのタス
ク(n)の状態をSTATUS(n)=SUSPEND
に変更して、以降スケジューリング対象タスクから外し
てループから抜ける(ステップ430)。最後に時限優
先スケジューリング機構300に起動をかけスケジュー
リングを実行する(ステップ440)。
Details of the task deletion mechanism 400 will be described with reference to FIG. First, the index for searching the time limit management table 500 is initialized to n = 1 (step 4).
10). The subsequent processing is repeated until task (n) == END (branch 420). If the task (n) is not the end task (branch 421), the index n is incremented to retrieve the next task (step 422). If the task (n) == end task (branch 421), the status of the task (n) is STATUS (n) = SUSPEND
Then, the task is removed from the scheduling target task and the loop is exited (step 430). Finally, the time priority scheduling mechanism 300 is activated to execute scheduling (step 440).

【0033】以上の各機構を設けることにより、実際に
タスクがどのようなパターンでスケジューリングされる
かを、前記「発明が解決しようとする課題」で説明した
と同じ例を用いて説明する。前記例に基づき、タスク
(1)〔制限異時間20ms、処理時間10ms〕とタ
スク(2)〔制限時間30ms、処理時間15ms〕の
2つの周期タスクのスケジューリングを考える(制限時
間=タスク起動周期とする)。この場合のタイミングチ
ャートを図8に示す。タスクの実行順序は、タスク
(1)〔10ms〕→タスク(2)〔10ms〕→タス
ク(2)〔5ms〕→タスク(1)〔5ms〕→タスク
(1)〔5ms〕→タスク(2)〔5ms〕→タスク
(1)〔10ms〕→タスク(2)〔10ms〕と60
ms周期で実行を繰り返し、CPUを使用しない無駄な
アイドル時間は生じない。
The pattern in which tasks are actually scheduled by providing each of the above mechanisms will be described using the same example as described in "Problems to be Solved by the Invention". Based on the above example, consider scheduling of two periodic tasks, task (1) [limit different time 20 ms, processing time 10 ms] and task (2) [limit time 30 ms, processing time 15 ms] (limit time = task start cycle) To). A timing chart in this case is shown in FIG. The task execution order is as follows: task (1) [10 ms] → task (2) [10 ms] → task (2) [5 ms] → task (1) [5 ms] → task (1) [5 ms] → task (2) [5 ms] → task (1) [10 ms] → task (2) [10 ms] and 60
Execution is repeated in the ms cycle, and there is no wasteful idle time when the CPU is not used.

【0034】以上説明したように、本実施例によれば、
CPUの無駄なアイドル時間を無くし、多くの処理を実
行することができ、CPUの使用効率を高めることがで
きる。
As described above, according to this embodiment,
It is possible to eliminate a wasteful idle time of the CPU, execute a large amount of processing, and improve the usage efficiency of the CPU.

【0035】(実施例2)実施例2では、前記問題点4
を解決する為の手段の実現方法についての一例を説明す
る。この際の構成図を図9に示している。図9は、図1
にタスク負荷監視機構700と処理時間管理テーブル8
00を付加した構成となっている。図9において、シス
テムは割込発生により割込処理20が起動され、事象発
生通知を受け、タスク負荷監視機構700が起動され
る。タスク負荷監視機構700では、現在制限時間管理
テーブル500に登録されている実行途中のタスクの処
理が制限時間内に実行できない条件として、以下の条件
式でシステムオーバフローの危険性を予測する。
(Embodiment 2) In Embodiment 2, the problem 4
An example of a method for realizing the means for solving the above will be described. A configuration diagram at this time is shown in FIG. FIG. 9 shows FIG.
Task load monitoring mechanism 700 and processing time management table 8
00 is added. In FIG. 9, the system starts the interrupt process 20 when an interrupt occurs, receives an event occurrence notification, and starts the task load monitoring mechanism 700. The task load monitoring mechanism 700 predicts the risk of system overflow by the following conditional expression as a condition that the processing of the task being executed which is currently registered in the time limit management table 500 cannot be executed within the time limit.

【0036】Σ(T(n)−t(n))/L(n)>1 (Σは、n=1,2,3……,タスク数、のうちタスク
の状態が休止でないものの合計を表す) 但し、タスクの状態が休止でないことは制限時間管理テ
ーブル500においてSTATUS(n)≠SUSPE
NDで判定し、t(n)は現在実行途中のタスク(n)
の処理時間、T(n)はタスク(n)の過去の処理時間
の履歴で過去のt(n)をもとに重みづけ平均を計算し
た値とし、処理時間管理テーブル800で管理される。
条件式計算後t(n)はクリアされる。
Σ (T (n) -t (n)) / L (n)> 1 (Σ is the number of tasks n = 1, 2, 3 ... However, the fact that the task is not in the sleep state means that STATUS (n) ≠ SUSPE in the time limit management table 500.
Judged by ND, t (n) is the currently executing task (n)
, T (n), is a value obtained by calculating a weighted average based on past t (n) in the past processing time history of task (n), and is managed by the processing time management table 800.
After the conditional expression is calculated, t (n) is cleared.

【0037】さらに、事象発生は、実施例1と同様にタ
スク登録機構100にも起動をかける。タスク登録機構
100で事象に対応するタスク(n)の制限時間初期値
(I(n))600を制限時間管理テーブル500に制
限時間(L(n))520として登録し時限優先スケジ
ューリング機構300を起動する。時限優先スケジュー
リング機構300では、制限時間管理テーブル500に
登録されているタスクの内、最も制限時間(L(n))
520が残り少ないタスクを検索し次の実行タスクとし
てディスパッチする。異なる事象が連続して発生すれ
ば、制限時間管理テーブル500には、複数のタスクが
登録され、その内制限時間(L(n))520が最も少
ないものが次の実行タスクとなる。これとは非同期に、
タイマ割込処理30により起動されるタイマ機構200
によって、制限時間管理テーブル500に登録されてい
る各タスクの制限時間(L(n))520はデクリメン
トされ、さらにSTATUS(n)=EXECUTE
(タスク実行中)のタスクのみ処理時間管理テーブル8
00のt(n)820がインクリメントされる。各タス
クは、その処理が終了したらタスク負荷監視機構700
とタスク削除機構400に処理終了通知を発行する。タ
スク負荷監視機構700では、処理時間管理テーブル8
00のt(n)820をもとに重みづけ平均T(n)8
30を計算する。さらに、タスク削除機構400は、制
限時間管理テーブル500で管理しているスケジューリ
ング対象タスクから該当タスクを削除し、時限優先スケ
ジューリング機構300を起動する。このような形で、
事象発生時にシステムの負荷を予想することが可能にな
る。
Further, the event occurrence also activates the task registration mechanism 100 as in the first embodiment. In the task registration mechanism 100, the initial time limit value (I (n)) 600 of the task (n) corresponding to the event is registered as the time limit (L (n)) 520 in the time limit management table 500, and the time priority scheduling mechanism 300 is set. to start. In the time-limited priority scheduling mechanism 300, of the tasks registered in the time limit management table 500, the most time limit (L (n))
520 retrieves the remaining few tasks and dispatches them as the next execution tasks. If different events occur successively, a plurality of tasks are registered in the time limit management table 500, and the task with the smallest time limit (L (n)) 520 among them is the next execution task. Asynchronously to this,
Timer mechanism 200 activated by timer interrupt processing 30
Causes the time limit (L (n)) 520 of each task registered in the time limit management table 500 to be decremented, and STATUS (n) = EXECUTE
Processing time management table 8 only for tasks (during task execution)
T (n) 820 of 00 is incremented. When the processing of each task is completed, the task load monitoring mechanism 700
And issue a processing end notification to the task deletion mechanism 400. In the task load monitoring mechanism 700, the processing time management table 8
Weighted average T (n) 8 based on t (n) 820 of 00
Calculate 30. Furthermore, the task deletion mechanism 400 deletes the corresponding task from the scheduling target tasks managed by the time limit management table 500, and activates the timed priority scheduling mechanism 300. In this way,
It is possible to predict the system load when an event occurs.

【0038】図10を参照すると、処理時間管理テーブ
ル800が、タスク識別子にあたるタスク(n)810
と、そのタスク(n)810が現在までに処理を実行し
た時間の累積を処理時間として表すt(n)820と、
タスク(n)810の過去の処理時間の履歴で過去のt
(n)820をもとに重みづけ平均を計算した値T
(n)830情報を含んで格納されている。T(n)8
30の初期状態は、0である。t(n)820は、事象
発生時、タスク負荷監視機構700によってクリアさ
れ、時限優先スケジューリング機構300で実行タスク
(STATUS(n)=EXECUTE)となっている
間のみタイマ機構200によってインクリメントされ
る。タスク処理終了時、タスク監視機構700によって
t(n)820をもとに重みづけ平均T(n)830が
計算される。
Referring to FIG. 10, the processing time management table 800 has a task (n) 810 corresponding to a task identifier.
And t (n) 820 that represents the cumulative time during which the task (n) 810 has executed processing up to the present as processing time,
In the past processing time history of task (n) 810, the past t
(N) Value T calculated by weighted average based on 820
(N) Stored including 830 information. T (n) 8
The initial state of 30 is 0. The t (n) 820 is cleared by the task load monitoring mechanism 700 when an event occurs and is incremented by the timer mechanism 200 only while the time priority scheduling mechanism 300 is in the execution task (STATUS (n) = EXECUTE). At the end of task processing, the task monitoring mechanism 700 calculates a weighted average T (n) 830 based on t (n) 820.

【0039】図11に基づき、タスク負荷監視機構70
0の詳細を説明する。タスク負荷監視機構700は、事
象発生時とタスク終了時に起動される。従ってまず、ど
ちらの要因で起動されたか判断する(分岐710)。事
象発生により起動されたのなら、現在制限時間管理テー
ブル500に登録されている実行途中のタスクの処理が
制限時間内に実行できない条件として、以下の条件式に
よりシステムオーバフローの危険性を予測し表示する
(ステップ720)。
Based on FIG. 11, the task load monitoring mechanism 70
0 will be described in detail. The task load monitoring mechanism 700 is activated when an event occurs and when the task ends. Therefore, first of all, it is determined which factor has caused the activation (branch 710). If activated due to the occurrence of an event, the risk of system overflow is predicted and displayed by the following conditional expression as a condition that the processing of the mid-execution task currently registered in the time limit management table 500 cannot be executed within the time limit. (Step 720).

【0040】Σ(T(n)−t(n))/L(n)>1 (Σは、n=1,2,3,……,タスク数、のうちタス
クの状態が休止でないものの合計を表す) この際、タスクの状態が休止でないことは制限時間管理
テーブル500において、STATUS(n)≠SUS
PENDで判定し、t(n)は現在実行途中のタスク
(n)の処理時間、T(n)はタスク(n)の過去の処
理時間の履歴で過去のt(n)をもとに重みづけ平均を
計算した値とする。条件式計算後、t(n)820はク
リアされる(ステップ730)。
Σ (T (n) -t (n)) / L (n)> 1 (Σ is the sum of n = 1, 2, 3, ... At this time, the fact that the task is not in the sleep state means that STATUS (n) ≠ SUS in the time limit management table 500.
Judged by PEND, t (n) is the processing time of the task (n) currently being executed, T (n) is a history of past processing times of the task (n), and weighted based on the past t (n). The calculated average is the calculated value. After the conditional expression is calculated, t (n) 820 is cleared (step 730).

【0041】分岐710において、タスク終了通知によ
り起動されたのなら、処理時間管理テーブル800のt
(n)820をもとに重みづけ平均T(n)830を以
下の計算式で計算する(ステップ740)。
At the branch 710, if the task end notification is activated, t of the processing time management table 800 is reached.
A weighted average T (n) 830 is calculated based on (n) 820 by the following formula (step 740).

【0042】Told=T(n)(ステップ741) α=0.6(ステップ742) T(n)=α* Told+(1−α)* t(n)(ステ
ップ743) 但し、αは重み、Toldは直前のT(n)を一時的に
保存する為の変数、t(n)はタスク(n)の現在の処
理時間。最後に、T(n)を処理時間管理テーブル80
0にセットする(ステップ750)。
Told = T (n) (step 741) α = 0.6 (step 742) T (n) = α * Told + (1-α) * t (n) (step 743) where α is a weight, Told is a variable for temporarily storing the immediately preceding T (n), and t (n) is the current processing time of task (n). Finally, T (n) is set to the processing time management table 80.
It is set to 0 (step 750).

【0043】図12に基づき、タイマ機構200の詳細
を説明する。本実施例における処理手順は、実施例1に
おける図3のタイマ機構200の処理手順に、処理時間
管理テーブル800の操作を付加したものである。ま
ず、制限時間管理テーブル500検索の為のインデック
スをn=1に初期化する(ステップ210)。以降の処
理をタスク(n)==ENDとなるまで繰り返す(分岐
220)。制限時間管理テーブル500のSTATUS
(n)==SUSPENDでないなら(分岐221)制
限時間管理テーブル500のL(n)520をデクリメ
ントする(ステップ222)。制限時間管理テーブル5
00のSTATUS(n)=EXECUTEなら(分岐
223)、処理時間管理テーブル800のt(n)82
0をインクリメントする(ステップ224)。インデッ
クスnをインクリメントする(ステップ230)。
The details of the timer mechanism 200 will be described with reference to FIG. The processing procedure according to the present embodiment is the processing procedure of the timer mechanism 200 of FIG. 3 according to the first embodiment with the operation of the processing time management table 800 added. First, the index for searching the time limit management table 500 is initialized to n = 1 (step 210). The subsequent processing is repeated until the task (n) == END (branch 220). STATUS of the time limit management table 500
If (n) == SUSPEND is not satisfied (branch 221), L (n) 520 of the time limit management table 500 is decremented (step 222). Time limit management table 5
If STATUS (n) of 00 = EXECUTE (branch 223), t (n) 82 of the processing time management table 800
0 is incremented (step 224). The index n is incremented (step 230).

【0044】以上説明したように、本実施例によれば、
実施例1の効果の他に、システムオーバフローの危険性
を予測し表示するので、適切な処置を施すこことができ
る。なお本実施例は、危険性を表示するものであるが、
さらに危険性発生の頻度を記録し、ハードウエアの改良
等の情報として利用することもできる。
As described above, according to this embodiment,
In addition to the effects of the first embodiment, the risk of system overflow is predicted and displayed, so that appropriate measures can be taken. In this example, the danger is displayed,
It is also possible to record the frequency of risk occurrence and use it as information such as hardware improvement.

【0045】(実施例3)実施例3では、前記問題点4
を解決する為の手段の実現方法についての一例を説明す
る。この際の構成図を図13に示している。図13は、
図1の構成にタスク負荷監視機構710と処理時間管理
テーブル800を付加した構成となっている。図13に
おいて、システムは割込発生により割込処理20が起動
され、事象発生通知を受け、タスク負荷監視機構710
が起動される。タスク負荷監視機構710では、今後事
象発生により起動される可能性のあるタスクを含めて制
限時間内に実行できない条件として、以下の条件式でシ
ステムオーバフローの危険性を予測する。
(Third Embodiment) In the third embodiment, the problem 4 is described.
An example of a method for realizing the means for solving the above will be described. A configuration diagram at this time is shown in FIG. FIG.
A task load monitoring mechanism 710 and a processing time management table 800 are added to the configuration of FIG. In FIG. 13, the system starts an interrupt process 20 when an interrupt occurs, receives an event occurrence notification, and receives a task load monitoring mechanism 710.
Is started. The task load monitoring mechanism 710 predicts the risk of system overflow by the following conditional expression as a condition that cannot be executed within the time limit including tasks that may be activated in the future due to event occurrence.

【0046】ΣT(n)/I(n)>1 (Σは、n=1,2,3,……,タスク数、の合計を表
す) 但し、I(n)は制限時間初期値、t(n)は現在実行
途中のタスク(n)の処理時間、T(n)はタスク
(n)の過去の処理時間の履歴で、過去のt(n)をも
とに重みづけ平均を計算した値とし、処理時間管理テー
ブル800で管理される。条件式計算後、t(n)はク
リアされる。
ΣT (n) / I (n)> 1 (Σ represents the total of n = 1, 2, 3, ..., Number of tasks) where I (n) is the initial value of the time limit and t (N) is the processing time of the task (n) currently being executed, T (n) is a history of past processing times of the task (n), and a weighted average is calculated based on the past t (n). The value is used as a value and managed by the processing time management table 800. After the conditional expression is calculated, t (n) is cleared.

【0047】さらに、事象発生は、実施例1と同様にタ
スク登録機構100にも起動をかける。タスク登録機構
100で事象に対応するタスク(n)の制限時間初期値
(I(n))600を制限時間管理テーブル500に制
限時間(L(n))520として登録し時限優先スケジ
ューリング機構300を起動する。時限優先スケジュー
リング機構300では、制限時間管理テーブル500に
登録されているタスクの内、最も制限時間(L(n))
520が残り少ないタスクを検索し次の実行タスクとし
てディスパッチする。異なる事象が連続して発生すれ
ば、制限時間管理テーブル500には、複数のタスクが
登録され、その内制限時間(L(n))520が最も少
ないものが実行タスクとなる。これとは非同期に、タイ
マ割込処理30により起動されるタイマ機構200によ
って、制限時間管理テーブル500に登録されている各
タスクの制限時間(L(n))520はデクリメントさ
れ、さらにSTATUS(n)=EXECUTE(タス
ク実行中)のタスクのみ処理時間管理テーブル800の
t(n)820がインクリメントされる。各タスクは、
その処理が終了したらタスク負荷監視機構710とタス
ク削除機構400に処理終了通知を発行する。タスク負
荷監視機構710では、処理時間管理テーブル800の
t(n)820をもとに重みづけ平均T(n)830を
計算する。さらに、タスク削除機構400は、制限時間
管理テーブル500で管理しているスケジューリング対
象タスクから該当タスクを削除し、時限優先スケジュー
リング機構300を起動する。このような形で、事象発
生時にシステムの負荷を予想することが可能になる。
Further, the event occurrence also activates the task registration mechanism 100 as in the first embodiment. In the task registration mechanism 100, the initial time limit value (I (n)) 600 of the task (n) corresponding to the event is registered as the time limit (L (n)) 520 in the time limit management table 500, and the time priority scheduling mechanism 300 is set. to start. In the time-limited priority scheduling mechanism 300, of the tasks registered in the time limit management table 500, the most time limit (L (n))
520 retrieves the remaining few tasks and dispatches them as the next execution tasks. If different events occur successively, a plurality of tasks are registered in the time limit management table 500, and the task with the smallest time limit (L (n)) 520 among them is the execution task. Asynchronously with this, the timer mechanism 200 activated by the timer interrupt processing 30 decrements the time limit (L (n)) 520 of each task registered in the time limit management table 500, and further, STATUS (n ) = EXECUTE (task is being executed), t (n) 820 of the processing time management table 800 is incremented. Each task is
When the processing is completed, a processing end notification is issued to the task load monitoring mechanism 710 and the task deletion mechanism 400. The task load monitoring mechanism 710 calculates a weighted average T (n) 830 based on t (n) 820 of the processing time management table 800. Furthermore, the task deletion mechanism 400 deletes the corresponding task from the scheduling target tasks managed by the time limit management table 500, and activates the timed priority scheduling mechanism 300. In this way, it becomes possible to predict the system load when an event occurs.

【0048】実施例3は、実施例2とタスク負荷監視機
構の内部動作を除いて同一なので、相違する部分に関し
てのみ説明する。
Since the third embodiment is the same as the second embodiment except for the internal operation of the task load monitoring mechanism, only different parts will be described.

【0049】図11を参照し、タスク負荷監視機構71
0の詳細を説明する。タスク負荷監視機構710は、事
象発生時とタスク終了時に起動される。従ってまず、ど
ちらの要因で起動されたか判断する(分岐710)。事
象発生により起動されたのなら、今後事象発生により起
動される可能性のあるタスクを含めて制限時間内に実行
できない条件として、以下の条件式によりシステムオー
バフローの危険性を予測し表示する(ステップ72
0)。
Referring to FIG. 11, task load monitoring mechanism 71
0 will be described in detail. The task load monitoring mechanism 710 is activated when an event occurs and when the task ends. Therefore, first of all, it is determined which factor has caused the activation (branch 710). If it is activated by an event occurrence, the risk of system overflow is predicted and displayed by the following conditional expression as a condition that cannot be executed within the time limit including tasks that may be activated by an event occurrence in the future (step 72
0).

【0050】ΣT(n)/I(n)>1 (Σは、n=1,2,3,……,タスク数、の合計を表
す) ここで、I(n)は制限時間初期値、t(n)は現在実
行途中のタスク(n)の処理時間、T(n)はタスク
(n)の過去の処理時間の履歴で、過去のt(n)をも
とに重みづけ平均を計算した値とする。条件式計算後、
t(n)820はクリアされる(ステップ730)。
ΣT (n) / I (n)> 1 (Σ represents the sum of n = 1, 2, 3, ..., Number of tasks) where I (n) is the initial value of the time limit, t (n) is the processing time of the currently executing task (n), T (n) is the history of the past processing time of the task (n), and the weighted average is calculated based on the past t (n). Value. After calculating the conditional expression,
The t (n) 820 is cleared (step 730).

【0051】分岐710において、タスク終了通知によ
り起動されたのなら、処理時間管理テーブル800のt
(n)820をもとに重みづけ平均T(n)830を以
下の計算式で計算する(ステップ740)。
At the branch 710, if the task is started by the task end notification, t in the processing time management table 800.
A weighted average T (n) 830 is calculated based on (n) 820 by the following formula (step 740).

【0052】Told=T(n)(ステップ741) α=0.6(ステップ742) T(n)=α* Told+(1−α)* t(n)(ステ
ップ743) 但し、αは重み、Toldは直前のT(n)を一時的に
保存する為の変数、t(n)はタスク(n)の現在の処
理時間。最後に、T(n)を処理時間管理テーブル80
0にセットする(ステップ750)。
Told = T (n) (step 741) α = 0.6 (step 742) T (n) = α * Told + (1-α) * t (n) (step 743) where α is a weight, Told is a variable for temporarily storing the immediately preceding T (n), and t (n) is the current processing time of task (n). Finally, T (n) is set to the processing time management table 80.
It is set to 0 (step 750).

【0053】以上説明したように、本実施例においても
実施例2と同様の効果が得られる。
As described above, the same effect as in the second embodiment can be obtained in this embodiment as well.

【0054】(実施例4)実施例4では、問題点4を解
決する為の手段の実現方法についての一例を説明する。
この際の構成図を図14に示している。図14は、図1
の構成にタスク負荷監視機構720と処理時間管理テー
ブル800を付加した構成となっている。実施例4は、
実施例2におけるタスク負荷監視機構700において、
図11のステップ740に対応するT(n)830の計
算方法を、重みづけ平均でなく以下のような最大値を求
める計算式に置き換えることで実現される。
(Fourth Embodiment) In the fourth embodiment, an example of a method for realizing means for solving the problem 4 will be described.
A configuration diagram at this time is shown in FIG. FIG.
The task load monitoring mechanism 720 and the processing time management table 800 are added to the above configuration. Example 4
In the task load monitoring mechanism 700 according to the second embodiment,
This is realized by replacing the calculation method of T (n) 830 corresponding to step 740 of FIG. 11 with a calculation formula for obtaining the following maximum value instead of the weighted average.

【0055】T(n)=max(T(n),t(n)) (max()は、第1引き数と第2引き数を比較し、値
の大きい方を返す関数とする) 本実施例によっても実施例2と同様の効果が得られる。
T (n) = max (T (n), t (n)) (max () is a function that compares the first and second arguments and returns the larger value) The same effect as that of the second embodiment can be obtained by the embodiment.

【0056】(実施例5)実施例5では、問題点4を解
決する為の手段の実現方法についての一例を説明する。
この際の構成図を図15に示している。図15は、図1
の構成にタスク負荷監視機構730と処理時間管理テー
ブル800を付加した構成となっている。実施例5は、
実施例3におけるタスク負荷監視機構710において、
図11のステップ740に対応するT(n)830の計
算方法を、重みづけ平均でなく以下のような最大値を求
める計算式に置き換えることで実現される。
(Fifth Embodiment) In a fifth embodiment, an example of a method for realizing means for solving the problem 4 will be described.
A configuration diagram at this time is shown in FIG. FIG.
The task load monitoring mechanism 730 and the processing time management table 800 are added to the above configuration. Example 5 is
In the task load monitoring mechanism 710 according to the third embodiment,
This is realized by replacing the calculation method of T (n) 830 corresponding to step 740 of FIG. 11 with a calculation formula for obtaining the following maximum value instead of the weighted average.

【0057】T(n)=max(T(n),t(n)) (max()は、第1引き数と第2引き数を比較し、値
の大きい方を返す関数とする)本実施例によっても実施
例3と同様の効果が得られる。
T (n) = max (T (n), t (n)) (max () is a function that compares the first and second arguments and returns the larger value) The same effect as that of the third embodiment can be obtained by the embodiment.

【0058】[0058]

【発明の効果】以上説明したように、本発明によれば、
時限優先スケジューリングにおいて事象発生および処理
終了時に直ちにスケジューリングを行うことができ、タ
イムスライスによるオーバヘッドがなくなり、容易な設
定で無駄なアイドル時間を経過することがなくシステム
の使用効率を100%に向上させることが可能になる。
また、優先順位をタスク毎の制限時間で与えることによ
り、プライオリティインバージョン等仕様に基づく動作
を保証できないケースが生じることはなくなる。これに
より、システムは正確に仕様に基づいてより多くの処理
を実行することができコスト削減効果が期待できる。
As described above, according to the present invention,
Scheduling can be performed immediately at the time of event occurrence and processing end in time-limited priority scheduling, the overhead due to time slice is eliminated, and easy setting can improve system usage efficiency to 100% without consuming idle time. Will be possible.
Also, by giving the priority order by the time limit for each task, there is no case where the operation based on the specification such as priority inversion cannot be guaranteed. As a result, the system can accurately execute more processing based on the specifications, and a cost reduction effect can be expected.

【0059】また、請求項2〜請求項4記載の発明では
さらに、時限優先スケジューリングにおいてタスクの処
理が制限時間内に実行できない危険性を予想することが
でき、これにより、システムがいつどんな状態で動作し
ているのかモニタリングすることが可能になり、システ
ムが処理を制限時間内に実行できないことが予想される
場合、その前に適切な処置を施すことが可能になった。
また、恒常的にシステムが高負荷である予想される場合
は、適切なレベルのハードウェアの改良等を施すことが
でき、過剰装備,高コストをかけずにシステムの信頼性
を高めることが可能である。
Further, in the inventions according to claims 2 to 4, it is possible to predict the risk that the task processing cannot be executed within the time limit in the timed priority scheduling. It has become possible to monitor if it is working, and if the system is not expected to perform a process within the time limit, then appropriate action can be taken.
In addition, if the system is expected to be constantly under high load, it is possible to improve the hardware to an appropriate level and improve the system reliability without excessive equipment and cost. Is.

【0060】さらに、本発明を実装する為に、専用のハ
ードウェアを新規に開発する必要はなく、固定優先順位
のリアルタイムOSに簡単に組込むことが可能であるの
で、既存システムであっても低コストで信頼性および性
能を向上させることができる。
Further, in order to implement the present invention, it is not necessary to newly develop dedicated hardware, and it is possible to easily incorporate it into a fixed priority real-time OS. Reliability and performance can be improved at cost.

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

【図1】 実施例1の構成を示す図FIG. 1 is a diagram showing a configuration of a first embodiment.

【図2】 タスク登録機構の処理を示すタイミングチャ
ート
FIG. 2 is a timing chart showing the processing of the task registration mechanism.

【図3】 タイマ機構の処理を示すタイミングチャートFIG. 3 is a timing chart showing the processing of the timer mechanism.

【図4】 時限優先スケジューリング機構の処理を示す
フローチャート
FIG. 4 is a flowchart showing the processing of the timed priority scheduling mechanism.

【図5】 タスク削除機構の処理を示すフローチャートFIG. 5 is a flowchart showing the processing of the task deletion mechanism.

【図6】 制限時間管理テーブルの格納情報例を示す図FIG. 6 is a diagram showing an example of stored information in a time limit management table.

【図7】 制限時間初期値の格納情報例を示す図FIG. 7 is a diagram showing an example of stored information of initial value of time limit.

【図8】 タスク(1)とタスク(2)のタイミングチ
ャート
FIG. 8 is a timing chart of task (1) and task (2)

【図9】 実施例2の構成を示す図FIG. 9 is a diagram showing a configuration of a second embodiment.

【図10】 処理情報管理テーブルの格納情報例を示す
FIG. 10 is a diagram showing an example of stored information in a processing information management table.

【図11】 タスク負荷監視機構の処理を示すフローチ
ャート
FIG. 11 is a flowchart showing the processing of the task load monitoring mechanism.

【図12】 タイマ機構の処理を示すフローチャートFIG. 12 is a flowchart showing the processing of the timer mechanism.

【図13】 実施例3の構成を示す図FIG. 13 is a diagram showing a configuration of a third embodiment.

【図14】 実施例4の構成を示す図FIG. 14 is a diagram showing a configuration of a fourth embodiment.

【図15】 実施例5の構成を示す図FIG. 15 is a diagram showing the configuration of Example 5;

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

300 時限優先スケジューリング機構 500 制限時間管理テーブル 300 time priority scheduling mechanism 500 time limit management table

───────────────────────────────────────────────────── フロントページの続き (72)発明者 平原 厚志 東京都大田区下丸子3丁目30番2号 キヤ ノン株式会社内 ─────────────────────────────────────────────────── ─── Continuation of the front page (72) Inventor Atsushi Hirahara 3-30-2 Shimomaruko, Ota-ku, Tokyo Canon Inc.

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 タスク毎の制限時間および状態を設定し
た時間管理テーブルと、事象発生およびタスク終了毎に
起動され、前記時間管理テーブルを参照し、休止状態で
ないタスクのうちで前記制限時間の最も少ないタスクを
次の実行タスクとしてディスパッチする時限優先スケジ
ューリング機構とを備えたことを特徴とするタスクスケ
ジューリング装置。
1. A time management table in which a time limit and a status are set for each task, and the time management table that is activated each time an event occurs and the task ends and refers to the time management table is referred to. A task scheduling device comprising: a timed priority scheduling mechanism for dispatching a small number of tasks as a next execution task.
【請求項2】 タスクの処理が制限時間内に実行できな
い危険性があると判定したとき、その旨の表示を行うタ
スク負荷監視機構を備えたことを特徴とする請求項1記
載のタスクスケジューリング装置。
2. The task scheduling apparatus according to claim 1, further comprising a task load monitoring mechanism for displaying a message indicating that there is a risk that task processing cannot be executed within a time limit. .
【請求項3】 タスク負荷監視機構は、次の(a)の条
件式が成立したときに、危険性があると判定するもので
あることを特徴とする請求項2記載のタスクスケジュー
リング装置。 (a)Σ〔T(n)−t(n)〕/L(n)>1 ここでΣは、n=1,2,3……,タスク数、のうちタ
スクの状態が休止状態でないものの合計を表し、L
(n)はタスク(n)の制限時間、t(n)は現在実行
途中のタスク(n)の処理時間、T(n)はタスク
(n)の過去の処理時間の履歴で、過去のt(n)をも
とに平均や最大等を計算した値である。
3. The task scheduling device according to claim 2, wherein the task load monitoring mechanism determines that there is a risk when the following conditional expression (a) is satisfied. (A) Σ [T (n) -t (n)] / L (n)> 1 Here, Σ is n = 1, 2, 3, ... Represents the sum, L
(N) is the time limit of the task (n), t (n) is the processing time of the task (n) that is currently being executed, T (n) is the history of the past processing time of the task (n), and the past t It is a value obtained by calculating the average, maximum, etc. based on (n).
【請求項4】 タスク負荷監視機構は、次の(b)の条
件式が成立したときに、危険性があると判定するもので
あることを特徴とする請求項2記載のタスクスケジュー
リング装置。 (b)ΣT(n)/I(n)>1 ここでΣは、n=1,2,3……,タスク数、の合計を
表し、I(n)はタスク(n)の制限時間初期値、T
(n)はタスク(n)の過去の処理時間の履歴で、過去
のt(n)をもとに平均や最大等を計算した値である。
4. The task scheduling apparatus according to claim 2, wherein the task load monitoring mechanism determines that there is a risk when the following conditional expression (b) is satisfied. (B) ΣT (n) / I (n)> 1 Here, Σ represents the total of n = 1, 2, 3, ..., The number of tasks, and I (n) is the initial time limit of the task (n). Value, T
(N) is a history of past processing times of task (n), and is a value obtained by calculating an average, maximum, etc. based on past t (n).
【請求項5】 時限優先スケジューリングのタイミング
を事象駆動としたことを特徴とするタスクスケジューリ
ング方法。
5. A task scheduling method, wherein the timing of the timed priority scheduling is event driven.
JP8138675A 1996-05-31 1996-05-31 Device and method for scheduling task Withdrawn JPH09319596A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP8138675A JPH09319596A (en) 1996-05-31 1996-05-31 Device and method for scheduling task

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP8138675A JPH09319596A (en) 1996-05-31 1996-05-31 Device and method for scheduling task

Publications (1)

Publication Number Publication Date
JPH09319596A true JPH09319596A (en) 1997-12-12

Family

ID=15227488

Family Applications (1)

Application Number Title Priority Date Filing Date
JP8138675A Withdrawn JPH09319596A (en) 1996-05-31 1996-05-31 Device and method for scheduling task

Country Status (1)

Country Link
JP (1) JPH09319596A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7322033B2 (en) 2002-03-29 2008-01-22 Denso Corporation Distributed control method and apparatus
WO2009155810A1 (en) * 2008-06-27 2009-12-30 腾讯科技(深圳)有限公司 Task scheduling method for instant messager and instant messager
JP2014225137A (en) * 2013-05-16 2014-12-04 株式会社デンソー Task scheduler, microprocessor, and task scheduling method
JP2019046339A (en) * 2017-09-06 2019-03-22 富士ゼロックス株式会社 Information processing device and information processing program

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7322033B2 (en) 2002-03-29 2008-01-22 Denso Corporation Distributed control method and apparatus
WO2009155810A1 (en) * 2008-06-27 2009-12-30 腾讯科技(深圳)有限公司 Task scheduling method for instant messager and instant messager
US8296766B2 (en) 2008-06-27 2012-10-23 Tencent Technology (Shenzhen) Company Start-up task dispatching for instant messenger applications
JP2014225137A (en) * 2013-05-16 2014-12-04 株式会社デンソー Task scheduler, microprocessor, and task scheduling method
US9274833B2 (en) 2013-05-16 2016-03-01 Denso Corporation Task scheduler, microprocessor, and task scheduling method
JP2019046339A (en) * 2017-09-06 2019-03-22 富士ゼロックス株式会社 Information processing device and information processing program

Similar Documents

Publication Publication Date Title
US6986068B2 (en) Arithmetic processing system and arithmetic processing control method, task management system and task management method
US7137117B2 (en) Dynamically variable idle time thread scheduling
US6754690B2 (en) Method for time partitioned application scheduling in a computer operating system
EP2905702B1 (en) Real-time multi-task scheduling method and device
US7849463B2 (en) Dynamically variable idle time thread scheduling
JPH07182209A (en) Method and system for monitoring of performance of operating system-based program
CN103268247B (en) Method and device for executing task and adjusting number of remaining threads in thread pool
Huang et al. Implementation and evaluation of mixed-criticality scheduling approaches for periodic tasks
Abeni et al. Constant bandwidth server revisited
CN106484502B (en) Task scheduling method, device and system
JPH09319596A (en) Device and method for scheduling task
CN109947015B (en) Task execution method and main controller
Huang et al. Schedulability and priority assignment for multi-segment self-suspending real-time tasks under fixed-priority scheduling
JP2001236236A (en) Task controller and its task scheduling method
CN114721791A (en) Task scheduling method, electronic device and computer readable storage medium
CN115309507A (en) Method, device, equipment and medium for calculating CPU resource occupancy rate
Friebe et al. Continuous-emission markov models for real-time applications: Bounding deadline miss probabilities
Bimbard et al. FP/FIFO feasibility conditions with kernel overheads for periodic tasks on an event driven OSEK system
EP1011045B1 (en) Object-oriented job scheduler
US20120124582A1 (en) Calculating Processor Load
Lim et al. Techniques for handling error in user-estimated execution times during resource management on systems processing MapReduce jobs
Souto et al. Overhead-aware schedulability evaluation of semi-partitioned real-time schedulers
JPH09265459A (en) Method for controlling data processor
JP3123714B2 (en) Task scheduling method and recording medium
CN116932227B (en) Task scheduling method and device based on single thread

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20030805