JPH09160790A - Device and method for task schedule - Google Patents

Device and method for task schedule

Info

Publication number
JPH09160790A
JPH09160790A JP32269495A JP32269495A JPH09160790A JP H09160790 A JPH09160790 A JP H09160790A JP 32269495 A JP32269495 A JP 32269495A JP 32269495 A JP32269495 A JP 32269495A JP H09160790 A JPH09160790 A JP H09160790A
Authority
JP
Japan
Prior art keywords
task
priority
resource
execution
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.)
Pending
Application number
JP32269495A
Other languages
Japanese (ja)
Inventor
Kouji Zaiki
幸治 材木
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP32269495A priority Critical patent/JPH09160790A/en
Publication of JPH09160790A publication Critical patent/JPH09160790A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To prevent the priority from being inverted with a small overhead by executing an exclusion execution part while making the priority high so that none of other tasks executing the same exclusive execution part interrupts when the exclusive execution part is executed. SOLUTION: At a resource control part 102, a resource use task registration part 110 registers the identifier of a resource that a task uses, and the identifier of the task and its execution prioritly in a resource management table 103. A priority decision part 111 determines the top execution priority among tasks registered in the same resource identifier in the resource management table 103. A priority change part 109 stores the top priority determined by the priority decision part 111 or the original execution priority of the task in the task management table 104 in response to the instruction of a task interruption processing part 101. A dispatch part 105 registers a task having the top priority from an execution wait queue in an execution queue and starts the task.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、複数のタスクを並
行して実行させるシステムにおける、優先度の逆転を防
ぐタスクスケジューリング装置およびタスクスケジュー
リング方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a task scheduling device and a task scheduling method for preventing priority inversion in a system for executing a plurality of tasks in parallel.

【0002】[0002]

【従来の技術】図4は複数のタスクで排他的に処理する
部分を含む場合に、実行しなければならない排他制御用
の命令を示したプログラム例である。図4において、4
02は排他的に処理されなければならない部分を示して
おり、その前後に資源使用要求命令404と資源開放要
求命令405を実行する。401、403は排他的に実
行しないタスクの処理部分を示している。このような排
他的に実行する部分を含んだ複数のタスクが実行する動
作を図5、図6を用いて説明する。
2. Description of the Related Art FIG. 4 is an example of a program showing an exclusive control instruction that must be executed when a portion exclusively processed by a plurality of tasks is included. In FIG. 4, 4
Reference numeral 02 indicates a portion that must be exclusively processed, and the resource use request instruction 404 and the resource release request instruction 405 are executed before and after the portion. Reference numerals 401 and 403 denote processing portions of tasks that are not exclusively executed. Operations executed by a plurality of tasks including such an exclusively executed part will be described with reference to FIGS. 5 and 6.

【0003】図5は第1の従来例のタスクスケジューリ
ングの動作説明図である。3つのタスク、Task1、Task
2、Task3が並行して実行する場合を考える。実行優先順
位は高い方から、Task1、Task2、Task3の順番であると
し、Task1とTask3が同じ資源を使用する、すなわち、排
他的に実行されるものとする。Task3が排他的な部分を
実行中に、優先度の高いTask2が発生(501)。さら
に優先度の高いTask1が発生(502)。ここでTask1が
排他的に実行すべき部分を実行しようとするとTask3が
既に排他的な部分を実行中(排他的な資源を使用中)な
ので、Task1はロックされた状態で待機する。そこで Ta
sk2 へ制御が移る(503)。Task2の処理が完了してT
ask3が実行を再開し(504)、Task3が排他的実行部
分の処理を終えて資源開放を行なって Task1 の実行が
再開する(505)。Task1 の処理が完了し、Task3の
実行が再開する(506)。
FIG. 5 is an explanatory diagram of the task scheduling operation of the first conventional example. Three tasks, Task1, Task
2. Consider the case where Task3 executes in parallel. It is assumed that Task1, Task2, and Task3 have the highest execution priority, and that Task1 and Task3 use the same resource, that is, they are exclusively executed. Task2 with a high priority occurs while Task3 is executing the exclusive part (501). Task1 with higher priority occurs (502). If Task1 tries to execute the part that should be executed exclusively here, Task3 is already executing the exclusive part (using the exclusive resource), so Task1 waits in the locked state. So Ta
Control is transferred to sk2 (503). Task2 processing is completed and T
ask3 resumes execution (504), Task3 finishes the processing of the exclusive execution part, releases resources, and Task1 resumes execution (505). The processing of Task1 is completed, and the execution of Task3 is restarted (506).

【0004】図6は第2の従来例のタスクスケジューリ
ングの動作説明図である。これは文献 (Sha, L.,Rajkum
ar, R. and Lehoczky, J.P., "Priority Inheritance P
rotocols:An Approach to Real-Time Synchronizatio
n," IEEE Transaction on Computers,vol.39,no.9,pp.1
175-1185,Sep.1990)にも示されているように、プライオ
リティ・インヘリタンス方式を使っている。図5と同様
に、3つのタスク、Task1、Task2、Task3が並行して実
行する場合を考え、実行優先順位は高い方から、Task
1、Task2、Task3の順番であるとし、Task1とTask3が同
じ資源を使用する、すなわち、排他的に実行されるもの
とする。Task3が排他的な部分を実行中に、優先度の高
いTask2が発生(601)。さらに優先度の高いTask1が
発生(602)。ここでTask3が排他的な部分を実行中
(排他的な資源を使用中)なので、Task1はロックされ
た状態で待機する。ここで、Task3の優先度をTask1と同
じ値に設定され、Task3が排他的な部分を実行し(60
3)、排他的実行部分の処理を終えて資源開放を行なっ
てTask1の実行が再開する(604)。Task1の処理が完
了し、Task2へ制御が移る(605)。Task2 の処理が
完了してTask3が実行を再開する(606)。
FIG. 6 is an explanatory diagram of the task scheduling operation of the second conventional example. This is in the literature (Sha, L., Rajkum
ar, R. and Lehoczky, JP, "Priority Inheritance P
rotocols: An Approach to Real-Time Synchronizatio
n, "IEEE Transaction on Computers, vol.39, no.9, pp.1
175-1185, Sep. 1990), it uses the priority inheritance method. As in the case of FIG. 5, considering the case where three tasks, Task1, Task2, and Task3 are executed in parallel, from the highest execution priority, Task
It is assumed that the order is 1, Task2, and Task3, and Task1 and Task3 use the same resource, that is, they are exclusively executed. Task2 with high priority occurs while Task3 is executing the exclusive part (601). Task1 with higher priority occurs (602). Since Task3 is executing the exclusive part (using the exclusive resource), Task1 waits in the locked state. Here, the priority of Task3 is set to the same value as Task1, and Task3 executes the exclusive part (60
3), the processing of the exclusive execution part is completed, the resources are released, and the execution of Task1 is restarted (604). The processing of Task1 is completed, and control is transferred to Task2 (605). The processing of Task2 is completed and Task3 resumes execution (606).

【0005】[0005]

【発明が解決しようとする課題】しかしながら上記の従
来技術によれば、優先順位の低いタスク(Task3)が先
に排他的に実行する部分を実行中に優先順位の高いタス
ク(Task1)が同じく排他的実行部分を実行しようとす
ると、このタスク(Task1)はロックされた状態にな
る。この時、優先順位の中間のタスク(Task2)が実行
を開始するとこれが終了するまで Task3 の実行は待た
され、従って優先順位の一番高いタスク(Task1)の実
行が待たされ、結局、優先順位の低いタスク(Task2)
が優先順位の高いタスク(Task1)よりも先に終了して
しまうという優先度の逆転が起きる問題点があった。さ
らに、これを回避するためのプライオリティ・インヘリ
タンス方式では、一旦、プライオリティの高いタスク
(Task1)が排他的実行部分を実行しようとしてロック
された時点で、優先順位の低いタスク(Task3)のプラ
イオリティを上げて、排他的実行部分を実行させるよう
にするため、タスクのスイッチング回数が増え、オーバ
ヘッドが大きくなるという問題点があった。
However, according to the above-mentioned conventional technique, a task with a high priority (Task1) is also excluded while a task with a low priority (Task3) is exclusively executed first. When you try to execute the target execution part, this task (Task1) becomes locked. At this time, when the task of the middle priority (Task2) starts executing, the execution of Task3 is made to wait until this end, and thus the task of the highest priority (Task1) is made to wait, and eventually Low task (Task2)
There was a problem that the inversion of the priority occurred that the task was terminated before the task with the higher priority (Task1). Furthermore, in order to avoid this, the priority inheritance method raises the priority of the low priority task (Task3) once the high priority task (Task1) is locked to execute the exclusive execution part. In order to execute the exclusive execution part, there is a problem that the number of task switching increases and the overhead increases.

【0006】本発明は上記問題点に鑑み、予め同じ排他
的実行部を実行するタスクに関してプライオリティをそ
の排他的資源ごとに管理して、排他的実行部を実行する
ときは必ず、同じ排他的実行部を実行する他のタスクに
割り込まれないようにプライオリティを高くして実行す
ることで、少ないオーバヘッドで優先度の逆転が発生し
ないタスクスケジュール装置、及びタスクスケジュール
方法を提供することを目的とする。
In view of the above problems, the present invention manages priorities of tasks that execute the same exclusive execution unit in advance for each exclusive resource, and always executes the same exclusive execution unit when executing the exclusive execution unit. It is an object of the present invention to provide a task scheduling device and a task scheduling method in which priority is not reversed with a small overhead by executing a task with a high priority so as not to be interrupted by other tasks that execute the part.

【0007】[0007]

【課題を解決するための手段】上記課題を解決するため
本発明のタスクスケジュール装置は、マルチタスク処理
を行なうためのタスクスケジュール装置において、割り
込みを受け付けるタスク中断処理部と、前記タスク中断
処理部の指示により起動される資源制御部と、前記資源
制御部によりタスクが使用する資源情報の書き込み及び
読み出しが行なわれる資源管理テーブルと、現在実行中
のタスクに関する情報を前記タスク中断処理部により書
き込まれるタスク管理テーブルと、前記タスク管理テー
ブルの情報から次に実行すべきタスクを決定してそのタ
スクを起動するディスパッチ部とを備えたものである。
In order to solve the above problems, a task schedule device of the present invention is a task schedule device for performing multi-task processing, and comprises a task interruption processing unit that accepts an interrupt and a task interruption processing unit. A resource control unit activated by an instruction, a resource management table in which resource information used by a task is written and read by the resource control unit, and a task in which information regarding a currently executing task is written by the task interruption processing unit It is provided with a management table and a dispatch unit which determines a task to be executed next from the information in the task management table and activates the task.

【0008】前記資源制御部は、資源管理テーブルにタ
スクが使用する資源の識別子とそのタスクの識別子及び
そのタスクの実行優先順位とを登録する資源使用ユーザ
登録部と、資源管理テーブル中の同一資源識別子に登録
されたタスクのうち一番高い実行優先順位を決定する優
先順位決定部と、タスク中断処理部の指示により前記優
先順位決定部で決定された一番高い優先順位またはタス
クの本来の実行優先順位をタスク管理テーブルの該当す
るタスクの優先順位格納部に格納する優先順位変更部と
を備えることが望ましい。
The resource control unit registers a resource identifier used by a task in the resource management table, a resource user registration unit that registers the task identifier and the execution priority of the task, and the same resource in the resource management table. Among the tasks registered in the identifier, a priority determining unit that determines the highest execution priority, and the highest priority determined by the priority determining unit according to an instruction from the task interruption processing unit or the original execution of the task It is preferable to provide a priority order changing unit that stores the priority order in the priority order storage unit of the corresponding task in the task management table.

【0009】前記タスク中断処理部は、割り込みの要因
を調べて資源使用要求であれば資源制御部に対して前記
優先順位決定部で決定された一番高い優先順位をタスク
管理テーブルの該当部分に書き込むように指示を行な
い、割り込みの要因が資源開放要求であれば本来の実行
優先順位をタスク管理テーブルの該当部分に書き込むよ
うに指示を行なうことが望ましい。
The task interruption processing unit examines the cause of the interruption and, if a resource use request is made, assigns the highest priority determined by the priority determination unit to the resource control unit as the corresponding portion of the task management table. It is desirable to instruct to write, and if the cause of the interrupt is a resource release request, it is desirable to instruct to write the original execution priority to the relevant part of the task management table.

【0010】前記タスク管理テーブルは、現在実行中の
タスクに関する情報を保持する実行キューと、実行待ち
のタスクに関する情報を保持する実行待ちキューとを持
ち、前記タスクに関する情報はタスクの実行優先順位を
含むことが望ましい。
The task management table has an execution queue for holding information on currently executing tasks and an execution queue for holding information on tasks waiting to be executed. The information on the tasks indicates the execution priority of the tasks. It is desirable to include.

【0011】前記ディスパッチ部は、前記実行待ちキュ
ーの中から実行優先順位の最も高いタスクを前記実行キ
ューに登録し、そのタスクを起動することが望ましい。
It is preferable that the dispatch unit registers the task having the highest execution priority from the execution waiting queue in the execution queue and activates the task.

【0012】本発明のタスクスケジュール方法は、マル
チタスク処理を行なうためのタスクスケジュール方法に
おいて、割り込みにより起動されるタスク中断処理手続
きと、前記タスク中断処理手続きの指示により起動され
る資源制御手続きと、次に実行すべきタスクを決定して
そのタスクを起動するディスパッチ処理手続きとを有す
るものである。
A task scheduling method of the present invention is a task scheduling method for performing multitask processing, wherein a task interruption processing procedure activated by an interrupt, a resource control procedure activated by an instruction of the task interruption processing procedure, And a dispatch processing procedure for deciding a task to be executed next and activating the task.

【0013】前記資源制御手続きは、タスク中断処理手
続きからの指示を判定する資源制御コマンドの判定手続
きと、タスク中断処理手続きからの指示がタスクの生成
である場合にそのタスクが使用する資源に関する情報を
資源管理テーブルに登録する資源使用ユーザ登録手続き
と、タスク中断処理手続きからの指示が資源使用要求で
ある場合に資源管理テーブル中の前記タスクが使用する
資源に関する情報から同一資源を使うように登録された
タスクのうち一番高い実行優先順位を決定する優先順位
決定手続きと、タスク中断処理手続きからの指示が資源
開放要求である場合にそのタスクの本来の実行優先順位
を決定する優先順位復帰手続きと、前記優先順位決定手
続きまたは前記優先順位復帰手続きで決定された実行優
先順位に基づいてタスクの実行優先順位を変更する優先
順位変更手続きとを有することが望ましい。
The resource control procedure is a resource control command determination procedure for determining an instruction from the task suspension processing procedure, and information about resources used by the task when the instruction from the task suspension processing procedure is task generation. Resource registration table for registering resources in the resource management table, and when the instruction from the task suspension processing procedure is a resource usage request, register to use the same resource from the information related to the resource used by the task in the resource management table. Priority determination procedure that determines the highest execution priority of the specified tasks, and priority restoration procedure that determines the original execution priority of the task when the instruction from the task suspension processing procedure is a resource release request And the execution priority determined in the priority determination procedure or the priority restoration procedure. It is desirable to have a priority changing procedure for changing the execution priority of the disk.

【0014】前記タスク中断処理手続きは、割り込みの
要因を調べて資源使用要求であれば資源制御手続きに対
して前記優先順位決定手続きで決定された一番高い優先
順位をタスク管理テーブルの該当部分に書き込むように
指示を行ない、割り込みの要因が資源開放要求であれば
本来の実行優先順位をタスク管理テーブルの該当部分に
書き込むように指示を行なうことが望ましい。
In the task suspension processing procedure, the cause of the interrupt is checked, and if a resource use request is made, the highest priority determined by the priority determination procedure is assigned to the relevant part of the task management table for the resource control procedure. It is desirable to instruct to write, and if the cause of the interrupt is a resource release request, it is desirable to instruct to write the original execution priority to the relevant part of the task management table.

【0015】前記ディスパッチ処理手続きは、実行可能
なタスクの中で実行優先順位の最も高いタスクを決定し
てそのタスクを起動することが望ましい。
It is desirable that the dispatch processing procedure decides a task having the highest execution priority among the executable tasks and activates the task.

【0016】本発明は上記した手段により、複数のタス
クで同一資源を使用する場合、その資源を使用する可能
性のあるタスクの実行優先順位の一番高い優先順位で資
源を使用する処理を実行し、資源使用要求を処理する際
に、既に別のタスクによりその同一資源を使用中である
ことはなくなる。
According to the present invention, when the same resource is used by a plurality of tasks, the present invention executes the process of using the resource with the highest execution priority of the tasks that may use the resource. However, when the resource use request is processed, the same resource is not already being used by another task.

【0017】[0017]

【発明の実施の形態】本発明のタスクスケジュール装置
及びそのタスクスケジュール方法の実施例について具体
例を挙げて説明する。
BEST MODE FOR CARRYING OUT THE INVENTION Embodiments of a task schedule device and a task schedule method thereof according to the present invention will be described with specific examples.

【0018】図1は本発明の実施例におけるタスクスケ
ジュール装置の構成図である。図において、タスク中断
処理部101は、割り込みの要因を調べてその割り込み
要因に応じて処理を決定する。資源制御部102は、資
源管理テーブル103にタスクが使用する資源の識別子
とそのタスクの識別子及びそのタスク実行優先順位とを
登録する資源使用タスク登録部110と、資源管理テー
ブル103中の同一資源識別子に登録されたタスクのう
ち一番高い実行優先順位を決定する優先順位決定部11
1と、タスク中断処理部101の指示により優先順位決
定部111で決定された一番高い優先順位またはタスク
本来の実行優先順位をタスク管理テーブル104に格納
する優先順位変更部109とからなる。タスク管理テー
ブル104は、現在実行中のタスクに関する情報106
を保持する実行キュー(Run-Queue)と次に実行可能な
タスクに関する情報107、108を保持する実行待ち
キュー(Ready-Queue)を持つ。ディスパッチ部105
は、実行待ちキュー(Ready-Queue)から実行優先順位
の一番高いものを実行キューに登録してそのタスクを起
動する。割り込みの要因としては、新たにタスクを登録
するもの、タスクによる資源使用要求、タスクによる資
源開放要求がある。
FIG. 1 is a block diagram of a task schedule device in an embodiment of the present invention. In the figure, the task interruption processing unit 101 examines an interrupt factor and determines a process according to the interrupt factor. The resource control unit 102 registers the resource identifier used by the task in the resource management table 103, the resource use task registration unit 110 that registers the task identifier and the task execution priority, and the same resource identifier in the resource management table 103. Priority determination unit 11 that determines the highest execution priority among the tasks registered in
1 and a priority changing unit 109 that stores the highest priority determined by the priority determining unit 111 according to an instruction from the task interruption processing unit 101 or the task's original execution priority in the task management table 104. The task management table 104 includes information 106 on the currently executing task.
Has a run queue (Run-Queue) that holds information about a task that can be executed next, and a queue (Ready-Queue) that holds information 108 about the next executable task. Dispatch unit 105
Registers the task with the highest execution priority from the execution-waiting queue (Ready-Queue) in the execution queue and starts the task. Causes of interruption include a new task registration, a resource use request by a task, and a resource release request by a task.

【0019】以上のように構成された本発明の実施例に
おけるタスクスケジュール装置について、図1、図2、
図3、図4を用いてその動作を説明する。
The task schedule device according to the embodiment of the present invention configured as described above will be described with reference to FIGS.
The operation will be described with reference to FIGS.

【0020】図2は本発明のタスクスケジュール方法を
示すフローチャート図である。割り込みによりタスク中
断処理手続き201が実行され、割り込み要因が資源ア
クセスに関するものであれば資源制御手続き202が実
行され、ディスパッチ処理手続き203により次に実行
すべきタスクを決定してそのタスクを起動する。
FIG. 2 is a flow chart showing the task scheduling method of the present invention. The interrupt causes the task interruption processing procedure 201 to be executed. If the interrupt factor is related to resource access, the resource control procedure 202 is executed. The dispatch processing procedure 203 determines the task to be executed next and activates the task.

【0021】資源制御手続き202はまず、資源制御コ
マンドの判定手続き211で資源制御コマンドを判定
し、そのコマンドが資源使用登録要求であれば資源使用
タスク登録手続き212を実行する。もしそのコマンド
が資源使用要求であれば優先順位決定手続き213を実
行し優先順位変更手続き215を実行する。また、もし
そのコマンドが資源開放要求であれば優先順位復帰手続
き214を実行し優先順位変更手続き215を実行す
る。
The resource control procedure 202 first determines the resource control command in the resource control command determination procedure 211, and if the command is a resource use registration request, executes the resource use task registration procedure 212. If the command is a resource use request, the priority order determining procedure 213 is executed and the priority order changing procedure 215 is executed. If the command is a resource release request, the priority return procedure 214 is executed and the priority change procedure 215 is executed.

【0022】図3は本発明の実施例におけるタスクスケ
ジューリングの動作説明図であり、これは図4に示すよ
うな排他的に実行する部分をもつタスクが実行する場合
のスケジューリングを示している。3つのタスク、Task
1、Task2、Task3を考える。実行優先順位は高い方か
ら、Task1、Task2、Task3の順番であるとし(Priority1
>Priority2>Priority3)、Task1とTask3が同じ資源を
使用する、すなわち、排他的に実行するものとする。予
め3つのタスクの資源使用がわかっているものとする
と、すなわち、Task1とTask3が同一資源(Resource1)
を使用し、Task2が別の資源(Resource2)を使用するも
のとする。
FIG. 3 is an operation explanatory diagram of task scheduling in the embodiment of the present invention, which shows scheduling when a task having an exclusive execution portion as shown in FIG. 4 executes. Three tasks, Task
Consider 1, Task2, Task3. It is assumed that the order of execution priority is Task1, Task2, and Task3 from the highest priority (Priority1
>Priority2> Priority3), Task1 and Task3 use the same resource, that is, execute exclusively. Assuming that the resource usage of three tasks is known in advance, that is, Task1 and Task3 are the same resource (Resource1).
And Task2 uses another resource (Resource2).

【0023】まずタスクの実行前に資源使用登録要求を
タスクスケジューリング装置に発行することにより資源
使用タスク登録部110は、資源使用タスク登録手続き
212により資源管理テーブル103にタスクの資源使
用情報を登録する。この時、Task1とTask3は同一資源
(Resource1)を使用するものとして登録され、Task2は
別の資源(Resource2)を使用するものとして登録され
る。
First, by issuing a resource use registration request to the task scheduling device before executing the task, the resource use task registration unit 110 registers the resource use information of the task in the resource management table 103 by the resource use task registration procedure 212. . At this time, Task1 and Task3 are registered as using the same resource (Resource1), and Task2 is registered as using another resource (Resource2).

【0024】まず最初にTask3が排他的な部分を実行す
るためにタスクスケジューリング装置に対して資源使用
要求コマンドを発行する。これにより、優先順位決定部
111は、優先順位決定手続き213により資源管理テ
ーブル103に登録されているTask3の使用する資源(R
esource1)を使用するタスクのうち優先順位の最も高い
Priority1を獲得する。これを優先順位変更部109は
優先順位変更手続き215によりタスク管理テーブルの
Task3に関する情報保持部106に書き込む。
First, Task 3 issues a resource use request command to the task scheduling device in order to execute the exclusive part. As a result, the priority order determination unit 111 uses the resource (R) used by Task3 registered in the resource management table 103 by the priority order determination procedure 213.
the highest priority task that uses esource1)
Earn Priority 1. The priority changing unit 109 uses the priority changing procedure 215 to save the task management table.
Write to the information holding unit 106 regarding Task3.

【0025】次にディスパッチ部105によりTask3の
実行が継続される。このとき、Task3は実行優先順位Pri
ority1で実行することになる。Task3が排他的な部分を
実行中に、Task2が発生したとすると、Task2はPriority
2であり、Task3は本来、Priority3(Priority2>Priori
ty3)であるが排他的な実行部分に関してはPriority1
(Priority1>Priority2)で実行している。このためTa
sk3は排他的な部分の実行が終了するまで継続して実行
される。Task3が排他的実行部分を終了した時点で、タ
スクスケジューリング装置に対して資源開放要求コマン
ドを発行する。これにより、優先順位決定部111は、
優先順位復帰手続き214により資源管理テーブル10
3に登録されているTask3の本来の優先順位Priority3を
獲得する。これを優先順位変更部109は優先順位変更
手続き215によりタスク管理テーブルのTask3に関す
る情報保持部106に書き込む。
Next, the dispatch unit 105 continues the execution of Task3. At this time, Task3 is the execution priority Pri
It will be executed in ority1. If Task2 occurs while Task3 is executing the exclusive part, Task2
2 and Task3 is originally Priority3 (Priority2> Priori
ty3) but for the exclusive execution part Priority1
(Priority1> Priority2). Therefore Ta
sk3 is continuously executed until execution of the exclusive part is completed. When Task3 finishes the exclusive execution part, it issues a resource release request command to the task scheduling device. As a result, the priority order determination unit 111
The resource management table 10 is processed by the priority return procedure 214.
Acquire the original priority Priority3 of Task3 registered in 3. The priority changing unit 109 writes this in the information holding unit 106 regarding Task3 of the task management table by the priority changing procedure 215.

【0026】次にディスパッチ部105により、この時
点で実行可能なタスクのうち実行優先順位の高いTask2
の実行が開始(301)される。Task2の実行中にTask1
が発生したとすると、実行優先順位はTask1の方が高い
(Priority1>Priority2)のでTask1の実行が開始(3
02)される。Task1の実行が終了すると、この時点で
実行待ちの状態にある2つのタスクのうち実行優先順位
の高いTask2が実行を再開(303)し、Task2の実行が
終了すると、Task3が実行を再開(304)する。
Next, by the dispatch unit 105, among the tasks that can be executed at this time, Task2 having a higher execution priority is given.
Is started (301). Task1 while Task2 is running
If Task1 occurs, Task1 has a higher execution priority (Priority1> Priority2), so Task1 starts executing (3
02). When the execution of Task1 ends, Task2, which has a higher execution priority, of the two tasks waiting to be executed at this point resumes execution (303), and when the execution of Task2 ends, Task3 resumes execution (304 ) Do.

【0027】[0027]

【発明の効果】以上のように本発明のタスクスケジュー
リング装置及びそのタスクスケジュール方法によれば、
複数のタスクで同一資源を使用する場合、その資源を使
用する可能性のあるタスクの実行優先順位の一番高い優
先順位で資源を使用する処理を実行するため、資源使用
要求を処理する際に、既に別のタスクによりその同一資
源を使用中であることはなくなり、本来の実行優先順位
が逆転してしまうことがなくなる。また、予めタスクが
使用する資源情報を登録し、排他的実行部を実行開始す
る時点でそのタスクの実行優先順位を変更するので、タ
スクの切替えに要するオーバヘッドを削減できる。
As described above, according to the task scheduling apparatus and the task scheduling method of the present invention,
When the same resource is used by multiple tasks, the processing that uses the resource with the highest priority of the tasks that may use the resource is executed. , The same resource is not already being used by another task, and the original execution priority will not be reversed. Further, since the resource information used by the task is registered in advance and the execution priority of the task is changed at the time of starting the execution of the exclusive execution part, the overhead required for switching the task can be reduced.

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

【図1】本発明の実施例におけるタスクスケジュール装
置の構成図
FIG. 1 is a configuration diagram of a task schedule device according to an embodiment of the present invention.

【図2】本発明の実施例におけるタスクスケジューリン
グ方法を示す図
FIG. 2 is a diagram showing a task scheduling method according to an embodiment of the present invention.

【図3】本発明の実施例におけるタスクスケジューリン
グの動作説明図
FIG. 3 is an operation explanatory diagram of task scheduling in the embodiment of the present invention.

【図4】排他制御を必要とするプログラム例の一部を示
す図
FIG. 4 is a diagram showing a part of a program example requiring exclusive control.

【図5】第1の従来例のタスクスケジューリングの動作
説明図
FIG. 5 is an operation explanatory diagram of task scheduling in the first conventional example.

【図6】第2の従来例のタスクスケジューリングの動作
説明図
FIG. 6 is an operation explanatory diagram of task scheduling in the second conventional example.

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

101 タスク中断処理部 102 資源制御部 103 資源管理テーブル 104 タスク管理テーブル 105 ディスパッチャ 109 優先順位変更部 110 資源使用タスク登録部 111 優先順位決定部 201 タスク中断処理手続き 202 資源制御手続き 203 ディスパッチ処理手続き 101 Task Suspension Processing Unit 102 Resource Control Unit 103 Resource Management Table 104 Task Management Table 105 Dispatcher 109 Priority Change Unit 110 Resource Use Task Registration Unit 111 Priority Order Determination Unit 201 Task Suspension Processing Procedure 202 Resource Control Procedure 203 Dispatch Processing Procedure

Claims (9)

【特許請求の範囲】[Claims] 【請求項1】マルチタスク処理を行なうためのタスクス
ケジュール装置において、割り込みを受け付けるタスク
中断処理部と、前記タスク中断処理部の指示により起動
される資源制御部と、前記資源制御部によりタスクが使
用する資源情報の書き込み及び読み出しが行なわれる資
源管理テーブルと、現在実行中のタスクに関する情報を
前記タスク中断処理部により書き込まれるタスク管理テ
ーブルと、前記タスク管理テーブルの情報から次に実行
すべきタスクを決定してそのタスクを起動するディスパ
ッチ部とを備えたことを特徴とするタスクスケジュール
装置。
1. A task schedule device for performing multi-task processing, a task interruption processing unit for accepting an interrupt, a resource control unit activated by an instruction from the task interruption processing unit, and a task used by the resource control unit. The resource management table in which the resource information to be written and read is performed, the task management table in which the information about the currently executing task is written by the task interruption processing unit, and the task to be executed next from the information in the task management table. A task scheduling device, comprising: a dispatch unit that determines and activates the task.
【請求項2】資源制御部は、 資源管理テーブルにタスクが使用する資源の識別子とそ
のタスクの識別子及びそのタスクの実行優先順位とを登
録する資源使用タスク登録部と、 資源管理テーブル中の同一資源識別子に登録されたタス
クのうち一番高い実行優先順位を決定する優先順位決定
部と、 タスク中断処理部の指示により前記優先順位決定部で決
定された一番高い優先順位またはタスクの本来の実行優
先順位をタスク管理テーブルの該当するタスクの優先順
位格納部に格納する優先順位変更部とを備えたことを特
徴とする請求項1記載のタスクスケジュール装置。
2. The resource control unit registers the identifier of the resource used by the task, the identifier of the task and the execution priority of the task in the resource management table, and the same resource management table in the resource management table. Among the tasks registered in the resource identifier, the priority determination unit that determines the highest execution priority, and the highest priority determined by the priority determination unit or the original task The task schedule device according to claim 1, further comprising: a priority change unit that stores the execution priority in a priority storage unit of a corresponding task in the task management table.
【請求項3】タスク中断処理部は、割り込みの要因を調
べて資源使用要求であれば、資源制御部に対して請求項
2記載の優先順位決定部で決定された一番高い優先順位
をタスク管理テーブルの該当部分に書き込むように指示
を行ない、割り込みの要因が資源開放要求であれば、本
来の実行優先順位をタスク管理テーブルの該当部分に書
き込むように指示を行なう請求項2記載のタスクスケジ
ュール装置。
3. The task interruption processing section examines the cause of the interruption and, if a resource use request is made, assigns the highest priority order determined by the priority order determination section according to claim 2 to the resource control section. 3. The task schedule according to claim 2, wherein the task schedule is instructed to write to a corresponding part of the management table, and if the cause of the interrupt is a resource release request, the original execution priority is instructed to be written to the corresponding part of the task management table. apparatus.
【請求項4】タスク管理テーブルは、 現在実行中のタスクに関する情報を保持する実行キュー
と、実行待ちのタスクに関する情報を保持する実行待ち
キューとを持ち、 前記タスクに関する情報はタスクの実行優先順位を含む
ことを特徴とする請求項1記載のタスクスケジュール装
置。
4. The task management table has an execution queue that holds information about currently executing tasks and an execution queue that holds information about tasks waiting to be executed, and the information about the tasks is the execution priority of the tasks. The task scheduling device according to claim 1, further comprising:
【請求項5】ディスパッチ部は、請求項4記載の実行待
ちキューの中から実行優先順位の最も高いタスクを請求
項4記載の実行キューに登録し、そのタスクを起動する
ことを特徴とする請求項1記載のタスクスケジュール装
置。
5. The dispatch unit registers the task with the highest execution priority from the execution queue according to claim 4 in the execution queue according to claim 4, and activates the task. Item 1. The task schedule device according to item 1.
【請求項6】マルチタスク処理を行なうためのタスクス
ケジュール方法において、割り込みにより起動されるタ
スク中断処理手続きと、前記タスク中断処理手続きの指
示により起動される資源制御手続きと、次に実行すべき
タスクを決定してそのタスクを起動するディスパッチ処
理手続きとを備えたことを特徴とするタスクスケジュー
ル方法。
6. A task scheduling method for performing multi-task processing, a task interruption processing procedure activated by an interrupt, a resource control procedure activated by an instruction of the task interruption processing procedure, and a task to be executed next. And a dispatch processing procedure for activating the task.
【請求項7】資源制御手続きは、 タスク中断処理手続きからの指示を判定する資源制御コ
マンドの判定手続きと、 タスク中断処理手続きからの指示がタスクの生成である
場合にそのタスクが使用する資源に関する情報を資源管
理テーブルに登録する資源使用タスク登録手続きと、 タスク中断処理手続きからの指示が資源使用要求である
場合に資源管理テーブル中の前記タスクが使用する資源
に関する情報から同一資源を使うように登録されたタス
クのうち一番高い実行優先順位を決定する優先順位決定
手続きと、 タスク中断処理手続きからの指示が資源開放要求である
場合にそのタスクの本来の実行優先順位を決定する優先
順位復帰手続きと、 前記優先順位決定手続きまたは前記優先順位復帰手続き
で決定された実行優先順位に基づいてタスクの実行優先
順位を変更する優先順位変更手続きとを備えたことを特
徴とする請求項6記載のタスクスケジュール方法。
7. The resource control procedure relates to a resource control command determination procedure for determining an instruction from a task suspension processing procedure and a resource used by the task when the instruction from the task suspension processing procedure is task creation. Use the same resource from the resource use task registration procedure for registering information in the resource management table and the resource related information used by the task in the resource management table when the instruction from the task suspension processing procedure is a resource use request. The priority determination procedure that determines the highest execution priority among the registered tasks, and the priority restoration that determines the original execution priority of the task when the instruction from the task suspension processing procedure is a resource release request. And the execution priority determined by the priority determination procedure or the priority restoration procedure. Task scheduling method according to claim 6, characterized in that a priority changing procedure for changing the execution priority of the disk.
【請求項8】タスク中断処理手続きは、割り込みの要因
を調べて資源使用要求であれば資源制御手続きに対して
請求項7記載の優先順位決定手続きで決定された一番高
い優先順位をタスク管理テーブルの該当部分に書き込む
ように指示を行ない、割り込みの要因が資源開放要求で
あれば本来の実行優先順位をタスク管理テーブルの該当
部分に書き込むように指示を行なう請求項7記載のタス
クスケジュール方法。
8. The task interruption processing procedure examines the cause of interruption and, if a resource use request is made, gives the highest priority determined by the priority determination procedure according to claim 7 to the resource control procedure. 8. The task scheduling method according to claim 7, wherein the task scheduling method is instructed to write in a corresponding portion of the table, and when the interrupt factor is a resource release request, the original execution priority is instructed to be written in a corresponding portion of the task management table.
【請求項9】ディスパッチ処理手続きは、実行可能なタ
スクの中で実行優先順位の最も高いタスクを決定してそ
のタスクを起動することを特徴とする請求項6記載のタ
スクスケジュール方法。
9. The task scheduling method according to claim 6, wherein the dispatch processing procedure determines the task having the highest execution priority among the executable tasks and activates the task.
JP32269495A 1995-12-12 1995-12-12 Device and method for task schedule Pending JPH09160790A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP32269495A JPH09160790A (en) 1995-12-12 1995-12-12 Device and method for task schedule

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP32269495A JPH09160790A (en) 1995-12-12 1995-12-12 Device and method for task schedule

Publications (1)

Publication Number Publication Date
JPH09160790A true JPH09160790A (en) 1997-06-20

Family

ID=18146577

Family Applications (1)

Application Number Title Priority Date Filing Date
JP32269495A Pending JPH09160790A (en) 1995-12-12 1995-12-12 Device and method for task schedule

Country Status (1)

Country Link
JP (1) JPH09160790A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100384339B1 (en) * 2000-04-21 2003-05-16 주식회사 아이네스테크 method for scheduling a task
JP2006260377A (en) * 2005-03-18 2006-09-28 Seiko Epson Corp Parallel processor and information processing method
KR100627984B1 (en) * 1997-10-07 2007-03-02 로베르트 보쉬 게엠베하 Control device for a system and operating method thereof
JP2015097106A (en) * 2005-04-13 2015-05-21 クゥアルコム・インコーポレイテッドQualcomm Incorporated Techniques for setting events in multi-threaded system
WO2015156000A1 (en) * 2014-04-11 2015-10-15 国立大学法人 東京大学 Computer system, method for inspecting data, and computer

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100627984B1 (en) * 1997-10-07 2007-03-02 로베르트 보쉬 게엠베하 Control device for a system and operating method thereof
KR100384339B1 (en) * 2000-04-21 2003-05-16 주식회사 아이네스테크 method for scheduling a task
JP2006260377A (en) * 2005-03-18 2006-09-28 Seiko Epson Corp Parallel processor and information processing method
JP2015097106A (en) * 2005-04-13 2015-05-21 クゥアルコム・インコーポレイテッドQualcomm Incorporated Techniques for setting events in multi-threaded system
WO2015156000A1 (en) * 2014-04-11 2015-10-15 国立大学法人 東京大学 Computer system, method for inspecting data, and computer
JP2015203927A (en) * 2014-04-11 2015-11-16 国立大学法人 東京大学 Computer system, data inspection method, and computer
US10452644B2 (en) 2014-04-11 2019-10-22 The University Of Tokyo Computer system, method for verifying data, and computer

Similar Documents

Publication Publication Date Title
US5390329A (en) Responding to service requests using minimal system-side context in a multiprocessor environment
US6006247A (en) Method and system for scheduling threads and handling exceptions within a multiprocessor data processing system
US6272517B1 (en) Method and apparatus for sharing a time quantum
US5247675A (en) Preemptive and non-preemptive scheduling and execution of program threads in a multitasking operating system
US5630128A (en) Controlled scheduling of program threads in a multitasking operating system
US5274823A (en) Interrupt handling serialization for process level programming
US5666523A (en) Method and system for distributing asynchronous input from a system input queue to reduce context switches
US20070204268A1 (en) Methods and systems for scheduling processes in a multi-core processor environment
JP2561801B2 (en) Method and system for managing process scheduling
US7996843B2 (en) Symmetric multi-processor system
Lipari et al. Schedulability analysis of periodic and aperiodic tasks with resource constraints
US7103631B1 (en) Symmetric multi-processor system
CA1304513C (en) Multiple i/o bus virtual broadcast of programmed i/o instructions
WO2005048009A2 (en) Method and system for multithreaded processing using errands
JP2004078322A (en) Task management system, program, recording medium, and control method
EP0913770A2 (en) Method and apparatus for sharing a time quantum
JPH09160790A (en) Device and method for task schedule
JP2693916B2 (en) Task scheduling method
KR102003721B1 (en) GPU Kernel transactionization method and computing device
JPH11203149A (en) Device and method for scheduling task
US8694999B2 (en) Cooperative scheduling of multiple partitions in a single time window
JP2553526B2 (en) Multitasking processor
JP2597283B2 (en) Scheduling method for interrupt
JP3043748B1 (en) Task scheduling method and device
Labrosse Operating systems