Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP2544896B2 - Scheduling method and scheduling device - Google Patents
[go: Go Back, main page]

JP2544896B2 - Scheduling method and scheduling device - Google Patents

Scheduling method and scheduling device

Info

Publication number
JP2544896B2
JP2544896B2 JP5279376A JP27937693A JP2544896B2 JP 2544896 B2 JP2544896 B2 JP 2544896B2 JP 5279376 A JP5279376 A JP 5279376A JP 27937693 A JP27937693 A JP 27937693A JP 2544896 B2 JP2544896 B2 JP 2544896B2
Authority
JP
Japan
Prior art keywords
task
identifier
state
execution
stack
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP5279376A
Other languages
Japanese (ja)
Other versions
JPH07134655A (en
Inventor
卓也 關口
修介 春名
裕彦 田中
剛一 安武
謙次 伊藤
秀二 安倍
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 JP5279376A priority Critical patent/JP2544896B2/en
Publication of JPH07134655A publication Critical patent/JPH07134655A/en
Application granted granted Critical
Publication of JP2544896B2 publication Critical patent/JP2544896B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、タスク管理をスタック
領域において行なう際のスケジューリング方法およびス
ケジューリング装置に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a scheduling method and a scheduling device for performing task management in a stack area.

【0002】[0002]

【従来の技術】従来、タスク管理をスタック領域におい
て行なうに際しては、各タスクが使用するスタック領域
をタスク毎に割り当て、各タスクの実行状態を、中央処
理装置で実行中である走行状態と、中央処理装置の割り
当てを待っている走行可能状態と、他のタスクからの信
号などの事象を待っている走行待ち状態との3つの状態
に分けてスケジューリングを行なっていた。
2. Description of the Related Art Conventionally, when performing task management in a stack area, a stack area used by each task is assigned to each task, and the execution state of each task is divided into a running state under execution by a central processing unit and a central state. Scheduling is performed in three states: a runnable state waiting for the allocation of the processing device and a runnable waiting state waiting for an event such as a signal from another task.

【0003】[0003]

【発明が解決しようとする課題】しかし上記従来のスケ
ジューリング方法では、走行状態となる可能性を全ての
タスクが有しているため、各タスクが使用するスタック
領域をタスク毎に割り当てる必要があり、このため、ス
タック領域の容量が少ない場合にはタスクが走行状態と
なるだけの領域を確保できず、その結果、スケジューリ
ングできないという問題点があった。
However, in the above-described conventional scheduling method, since all tasks have a possibility of entering a running state, it is necessary to allocate a stack area used by each task for each task. Therefore, when the stack area has a small capacity, it is not possible to secure an area for the task to be in a running state, and as a result, there is a problem that scheduling cannot be performed.

【0004】本発明はかかる事情に鑑みて成されたもの
であり、複数のタスクが、同一のスタックを使用するこ
とによりスタック領域の容量の低減を図った場合におい
てもスケジューリングを可能とするスケジューリング方
法およびスケジューリング装置を提供することを目的と
する。
The present invention has been made in view of the above circumstances, and a scheduling method that enables scheduling even when a plurality of tasks use the same stack to reduce the stack area capacity. Another object of the present invention is to provide a scheduling device.

【0005】[0005]

【課題を解決するための手段】請求項1の発明は、走行
可能状態と走行待ち状態と走行状態と走行不可能状態と
の少なくとも4つの実行状態とシステム内で一意の識別
子とを持つタスクが、タスク切り替えにより複数個実行
されるシステムにおけるスケジューリング方法であっ
て、各タスクの識別子と実行状態とを格納するタスク情
報格納部と、各タスクの識別子と各タスクが使用する最
大のスタック容量とを格納すると共に、タスクの実行状
態が走行不可能状態でありかつスタックが割り当てられ
ていない場合に実行状態が走行状態か走行待ち状態か走
行可能状態かのいずれかの状態となり、かつタスクの実
行状態が走行状態か走行待ち状態か走行可能状態かのい
ずれかの状態である場合に走行不可能状態となる実行保
護タスクの識別子と、実行保護タスクが走行不可能状態
となる場合に使用する最大のスタック容量とを格納する
実行保護タスク格納部とを用い、タスクの切り替え要求
を発生するタスク切り替え要求ステップと、タスク切り
替え要求ステップにおいてタスク切り替え要求が発生さ
れることにより、タスク情報格納部と実行保護タスク格
納部とを検索して、いずれのタスクに対しても実行保護
タスクではなくかつ実行状態が走行不可能状態であるタ
スクの識別子を抽出する実行可能タスク抽出ステップ
と、タスクの実行状態が走行状態であるタスクの実行状
態を走行可能状態に変更し、タスク情報格納部を検索し
てタスクの実行状態が走行待ち状態または走行可能状態
であるタスクの識別子を抽出する実行中タスク抽出ステ
ップと、実行中タスク抽出ステップにおいて抽出された
識別子を第1の識別子とし、実行可能タスク抽出ステッ
プにおいて抽出された識別子を第2の識別子としたとき
に、実行保護タスク格納部を検索して、第1の識別子に
対応するタスクが第2の識別子に対応するタスクの実行
保護タスクである第1の識別子と第2の識別子との組合
せを抽出するスタック使用可能タスク抽出ステップと、
実行保護タスク格納部を検索して、スタック使用可能タ
スク抽出ステップにおいて抽出された第1の識別子と第
2の識別子との組合せにおける第1の識別子に対応する
タスクが実行不可能状態となる場合に使用する最大のス
タック容量を得、そのスタック容量よりも第1の識別子
に対応するタスクが現在使用しているスタック容量が小
さい第1の識別子と第2の識別子との組合せを抽出する
スタック使用可能タスク選択ステップと、スタック使用
可能タスク選択ステップにおいて抽出された第1の識別
子と第2の識別子との組合せにおける第1の識別子に対
応するタスクの実行状態を走行不可能状態にし、第2の
識別子に対応するタスクの実行状態を走行状態にするタ
スク切り替えステップと、を実行することを特徴として
いる。
According to a first aspect of the present invention, there is provided a task having at least four execution states of a runnable state, a run wait state, a runnable state and a runnable state and a unique identifier in the system. , A scheduling method in a system in which a plurality of tasks are executed by task switching, including a task information storage unit that stores an identifier and an execution state of each task, an identifier of each task, and a maximum stack capacity used by each task. In addition to storing, if the task is in the run-disabled state and no stack is allocated, the run-state is either the run-state, the run-wait state or the run-ready state, and the task-run state And the identifier of the execution protection task that is in the run-disabled state when is in the running state, the run-waiting state, or the runnable state The execution protection task storage unit that stores the maximum stack capacity used when the execution protection task is in the run-disabled state is used, and the task switching request step for generating a task switching request and the task switching request step When a switching request is generated, the task information storage unit and the execution protection task storage unit are searched, and the identifier of the task that is neither the execution protection task nor the execution state is the run-disabled state for any task. Executable task extraction step to extract the task execution state and the task execution state is the running state Change the task execution state to the runnable state and search the task information storage section to see whether the task execution state is the run waiting state or the runnable state In the running task extraction step that extracts the status task identifier and the running task extraction step When the identifier extracted as a first identifier and the identifier extracted in the executable task extraction step as a second identifier are searched, the execution protection task storage unit is searched and the task corresponding to the first identifier is searched. A stack usable task extracting step for extracting a combination of the first identifier and the second identifier, which is an execution protection task of the task corresponding to the second identifier,
When the execution protection task storage unit is searched and the task corresponding to the first identifier in the combination of the first identifier and the second identifier extracted in the stack usable task extraction step is in the unexecutable state Stack available to obtain the maximum stack capacity to be used and extract the combination of the first identifier and the second identifier whose stack capacity currently used by the task corresponding to the first identifier is smaller than that stack capacity The task selection step and the execution state of the task corresponding to the first identifier in the combination of the first identifier and the second identifier extracted in the stack usable task selection step are set to the run-disabled state, and the second identifier And a task switching step for changing the execution state of the task corresponding to to the running state.

【0006】請求項2の発明は、走行可能状態と走行待
ち状態と走行状態と走行不可能状態との少なくとも4つ
の実行状態とシステム内で一意の識別子とを持つタスク
が、タスク切り替えにより複数個実行される計算機シス
テムにおけるスケジューリング装置であって、各タスク
の識別子と実行状態とを格納するタスク情報格納部と、
各タスクの識別子と各タスクが使用する最大のスタック
容量とを格納すると共に、タスクの実行状態が走行不可
能状態でありかつスタックが割り当てられていない場合
に実行状態が走行状態か走行待ち状態か走行可能状態か
のいずれかの状態となり、かつタスクの実行状態が走行
状態か走行待ち状態か走行可能状態かのいずれかの状態
である場合に走行不可能状態となる実行保護タスクの識
別子と、実行保護タスクが走行不可能状態となる場合に
使用する最大のスタック容量とを格納する実行保護タス
ク格納部と、タスクの切り替え要求を発生するタスク切
り替え要求部と、タスク切り替え要求部がタスク切り替
え要求を発生したときに、タスク情報格納部と実行保護
タスク格納部とを検索して、いずれのタスクに対しても
実行保護タスクではなくかつ実行状態が走行不可能状態
であるタスクの識別子を抽出する実行可能タスク抽出部
と、タスクの実行状態が走行状態であるタスクの実行状
態を走行可能状態に変更し、タスク情報格納部を検索し
てタスクの実行状態が走行待ち状態または走行可能状態
であるタスクの識別子を抽出する実行中タスク抽出部
と、実行中タスク抽出部により抽出された識別子を第1
の識別子とし、実行可能タスク抽出部により抽出された
識別子を第2の識別子としたときに、実行保護タスク格
納部を検索して、第1の識別子に対応するタスクが第2
の識別子に対応するタスクの実行保護タスクである第1
の識別子と第2の識別子との組合せを抽出するスタック
使用可能タスク抽出部と、実行保護タスク格納部を検索
して、スタック使用可能タスク抽出部により抽出された
第1の識別子と第2の識別子との組合せにおける第1の
識別子に対応するタスクが実行不可能状態となる場合に
使用する最大のスタック容量を得、そのスタック容量よ
りも第1の識別子に対応するタスクが現在使用している
スタック容量が小さい第1の識別子と第2の識別子との
組合せを抽出するスタック使用可能タスク選択部と、ス
タック使用可能タスク選択部により抽出された第1の識
別子と第2の識別子との組合せにおける第1の識別子に
対応するタスクの実行状態を走行不可能状態にし、第2
の識別子に対応するタスクの実行状態を走行状態にする
タスク切り替え部と、を備えたことを特徴としている。
According to a second aspect of the invention, a plurality of tasks having at least four execution states of a runnable state, a run-waiting state, a runnable state and a runnable state and a unique identifier in the system are provided by task switching. A scheduling device in a computer system to be executed, which includes a task information storage unit that stores an identifier of each task and an execution state,
It stores the identifier of each task and the maximum stack capacity used by each task, and whether the task is in the run state or the run wait state when the task is in the run-disabled state and no stack is allocated. An identifier of an execution protection task that is in a run-disabled state when the task is in either the runnable state and the task execution state is either the runnable state, the run-waiting state, or the runnable state, and The execution protection task storage unit that stores the maximum stack capacity used when the execution protection task becomes unrunnable, the task switching request unit that issues a task switching request, and the task switching request unit When the error occurs, the task information storage section and the execution protection task storage section are searched, and the execution protection task for any task is searched. The executable task extractor that extracts the identifier of a task that is not running and is in the run-disabled state, and the task running state that the task is running is changed to the runnable state, and the task information storage unit The executing task extracting unit that extracts the identifier of a task whose execution state of the task is the running waiting state or the runnable state by searching, and the identifier extracted by the executing task extracting unit
When the identifier extracted by the executable task extraction unit is used as the second identifier, the execution protection task storage unit is searched to find the task corresponding to the first identifier as the second identifier.
Which is the execution protection task of the task corresponding to the identifier of
Of the stack usable task extracting unit that extracts the combination of the identifier of the second identifier and the second identifier, and the first identifier and the second identifier that are extracted by the stack usable task extracting unit The maximum stack capacity to be used when the task corresponding to the first identifier in the combination with and is in the non-executable state is obtained, and the stack currently used by the task corresponding to the first identifier is larger than the stack capacity. A stack usable task selection unit that extracts a combination of a first identifier and a second identifier with a small capacity, and a combination of the first identifier and the second identifier extracted by the stack usable task selection unit. The execution state of the task corresponding to the identifier of 1 is set to the run-disabled state, and the second
And a task switching unit for changing the execution state of the task corresponding to the identifier of 1 to the running state.

【0007】請求項3の発明は、走行可能状態と走行待
ち状態と走行状態と走行不可能状態との少なくとも4つ
の実行状態とシステム内で一意の識別子とを持つタスク
が、タスク切り替えにより複数個実行される計算機シス
テムにおけるスケジューリング方法であって、各タスク
の識別子と実行状態とを格納するタスク情報格納部と、
各タスクの識別子と各タスクが使用する最大のスタック
容量とを格納すると共に、タスクの実行状態が走行不可
能状態でありかつスタックが割り当てられていない場合
に実行状態が走行状態か走行待ち状態か走行可能状態か
のいずれかの状態となり、かつタスクの実行状態が走行
状態か走行待ち状態か走行可能状態かのいずれかの状態
である場合に走行不可能状態となる実行保護タスクの識
別子と、実行保護タスクが走行不可能状態となる場合に
使用する最大のスタック容量とを格納する実行保護タス
ク格納部と、タスクの実行状態とスタックポインタとを
格納するスタックポインタ格納部とを用いて、タスクの
切り替え要求を発生するタスク切り替え要求ステップ
と、タスク切り替え要求ステップにおいてタスク切り替
え要求が発生されることにより、タスク情報格納部と実
行保護タスク格納部とを検索して、いずれのタスクに対
しても実行保護タスクではなくかつ実行状態が走行不可
能状態であるタスクの識別子を抽出する実行可能タスク
抽出ステップと、タスクの実行状態が走行状態であるタ
スクの実行状態を走行可能状態に変更し、タスク情報格
納部を検索してタスクの実行状態が走行待ち状態または
走行可能状態であるタスクの識別子を抽出する実行中タ
スク抽出ステップと、実行中タスク抽出ステップにおい
て抽出された識別子を第1の識別子とし、実行可能タス
ク抽出ステップにおいて抽出された識別子を第2の識別
子としたときに、実行保護タスク格納部を検索して、第
1の識別子に対応するタスクが第2の識別子に対応する
タスクの実行保護タスクである第1の識別子と第2の識
別子との組合せを抽出するスタック使用可能タスク抽出
ステップと、スタック使用可能タスク抽出ステップにお
いて抽出された第1の識別子と第2の識別子との組合せ
において実行保護タスクとなり得る識別子に対応するタ
スクの実行状態をスタックポインタ格納部に格納し、実
行保護タスクとなり得るタスクの実行状態を走行待ち状
態に変更し、実行保護タスクとなり得るタスクが使用し
ているスタック内のデータを圧縮し、実行保護タスクと
なり得るタスクのスタックポインタをスタックポインタ
格納部に格納するスタックデータ圧縮ステップと、実行
保護タスク格納部を検索して、スタック使用可能タスク
抽出ステップにおいて抽出された第1の識別子と第2の
識別子との組合せにおける第1の識別子に対応するタス
クが実行不可能状態となる場合に使用する最大のスタッ
ク容量を得、そのスタック容量よりも第1の識別子に対
応するタスクが現在使用しているスタック容量が小さい
第1の識別子と第2の識別子との組合せを抽出するスタ
ック使用可能タスク選択ステップと、スタック使用可能
タスク選択ステップにおいて抽出された第1の識別子と
第2の識別子との組合せにおける第1の識別子に対応す
るタスクの実行状態を走行不可能状態にし、第2の識別
子に対応するタスクの実行状態を走行状態にするタスク
切り替えステップと、タスク情報格納部を検索して実行
状態が走行待ち状態であるタスクの識別子を全て抽出
し、スタックポインタ格納部を検索してタスク情報格納
部から抽出した識別子に対応するタスクのスタックポイ
ンタと実行状態とを抽出し、スタックポインタ格納部か
らスタックポインタと実行状態とを抽出したタスクが使
用しているスタック内のデータを展開し、スタックポイ
ンタ格納部からスタックポインタと実行状態とを抽出し
たタスクの実行状態をスタックポインタ格納部から抽出
した実行状態に変更し、スタックポインタ格納部からス
タックポインタと実行状態とを抽出したタスクのスタッ
クポインタと実行状態とをスタックポインタ格納部から
削除するスタックデータ展開ステップと、を実行するこ
とを特徴としている。
According to a third aspect of the present invention, a plurality of tasks having at least four execution states of a runnable state, a run-waiting state, a runnable state, and a runnable state and a unique identifier in the system are provided by task switching. A scheduling method in a computer system to be executed, comprising a task information storage unit that stores an identifier and an execution state of each task,
It stores the identifier of each task and the maximum stack capacity used by each task, and whether the task is in the run state or the run wait state when the task is in the run-disabled state and no stack is allocated. An identifier of an execution protection task that is in a run-disabled state when the task is in either the runnable state and the task execution state is either the runnable state, the run-waiting state, or the runnable state, and The execution protection task storage unit that stores the maximum stack capacity used when the execution protection task is in the run-disabled state and the stack pointer storage unit that stores the execution state and stack pointer of the task are used. Task switching request step that generates a task switching request, and a task switching request is generated in the task switching request step The executable task that searches the task information storage unit and the execution protection task storage unit by using, and extracts the identifier of a task that is not an execution protection task for any task and whose execution state is in the run-disabled state The extraction step and the task execution state is the running state. The task execution state is changed to the runnable state, the task information storage is searched, and the task execution state is the task waiting state or the runnable state. When the executing task extracting step for extracting the active task and the identifier extracted in the executing task extracting step are used as the first identifier and the identifier extracted in the executable task extracting step is used as the second identifier, the execution protection task The storage is searched, and the task corresponding to the first identifier is the execution protection task of the task corresponding to the second identifier. A stack usable task extracting step for extracting a combination of the identifier and the second identifier, and an identifier that can be an execution protection task in the combination of the first identifier and the second identifier extracted in the stack usable task extracting step The execution state of the task corresponding to the above is stored in the stack pointer storage unit, the execution state of the task that can be the execution protection task is changed to the running wait state, and the data in the stack used by the task that can be the execution protection task is compressed. Then, the stack data compression step of storing the stack pointer of the task that can be the execution protection task in the stack pointer storage unit, and the first identifier extracted in the stack usable task extraction step by searching the execution protection task storage unit. Task corresponding to the first identifier in combination with the second identifier The first and second identifiers are obtained in which the maximum stack capacity to be used when the task becomes the inexecutable state is obtained, and the stack capacity currently used by the task corresponding to the first identifier is smaller than the stack capacity. And a running state of a task corresponding to the first identifier in the combination of the first identifier and the second identifier extracted in the stack-usable task selection step. A task switching step that sets the task to the disabled state and sets the execution state of the task corresponding to the second identifier to the running state, and searches the task information storage unit to extract all the identifiers of the tasks whose execution state is the running waiting state, The stack pointer storage unit is searched and the stack pointer and execution state of the task corresponding to the identifier extracted from the task information storage unit are extracted. Then, the data in the stack used by the task that extracted the stack pointer and execution state from the stack pointer storage is expanded, and the execution state of the task that extracted the stack pointer and execution state from the stack pointer storage is stacked. Execute a stack data expansion step that changes to the execution state extracted from the pointer storage unit and deletes the stack pointer and execution state of the task that extracted the stack pointer and execution state from the stack pointer storage unit from the stack pointer storage unit. It is characterized by doing.

【0008】請求項4の発明は、走行可能状態と走行待
ち状態と走行状態と走行不可能状態との少なくとも4つ
の実行状態とシステム内で一意の識別子とを持つタスク
が、タスク切り替えにより複数個実行される計算機シス
テムにおけるスケジューリング装置であって、各タスク
の識別子と実行状態とを格納するタスク情報格納部と、
各タスクの識別子と各タスクが使用する最大のスタック
容量とを格納すると共に、タスクの実行状態が走行不可
能状態でありかつスタックが割り当てられていない場合
に実行状態が走行状態か走行待ち状態か走行可能状態か
のいずれかの状態となり、かつタスクの実行状態が走行
状態か走行待ち状態か走行可能状態かのいずれかの状態
である場合に走行不可能状態となる実行保護タスクの識
別子と、実行保護タスクが走行不可能状態となる場合に
使用する最大のスタック容量とを格納する実行保護タス
ク格納部と、タスクの実行状態とスタックポインタとを
格納するスタックポインタ格納部と、タスクの切り替え
要求を発生するタスク切り替え要求部と、タスク切り替
え要求部がタスク切り替え要求を発生したときに、タス
ク情報格納部と実行保護タスク格納部とを検索して、い
ずれのタスクに対しても実行保護タスクではなくかつ実
行状態が走行不可能状態であるタスクの識別子を抽出す
る実行可能タスク抽出部と、タスクの実行状態が走行状
態であるタスクの実行状態を走行可能状態に変更し、タ
スク情報格納部を検索してタスクの実行状態が走行待ち
状態または走行可能状態であるタスクの識別子を抽出す
る実行中タスク抽出部と、実行中タスク抽出部により抽
出された識別子を第1の識別子とし、実行可能タスク抽
出部により抽出された識別子を第2の識別子としたとき
に、実行保護タスク格納部を検索して、第1の識別子に
対応するタスクが第2の識別子に対応するタスクの実行
保護タスクである第1の識別子と第2の識別子との組合
せを抽出するスタック使用可能タスク抽出部と、スタッ
ク使用可能タスク抽出部により抽出された第1の識別子
と第2の識別子との組合せにおいて実行保護タスクとな
り得る識別子に対応するタスクの実行状態をスタックポ
インタ格納部に格納し、実行保護タスクとなり得るタス
クの実行状態を走行待ち状態に変更し、実行保護タスク
となり得るタスクが使用しているスタック内のデータを
圧縮し、実行保護タスクとなり得るタスクのスタックポ
インタをスタックポインタ格納部に格納するスタックデ
ータ圧縮部と、実行保護タスク格納部を検索して、スタ
ック使用可能タスク抽出部により抽出された第1の識別
子と第2の識別子との組合せにおける第1の識別子に対
応するタスクが実行不可能状態となる場合に使用する最
大のスタック容量を得、そのスタック容量よりも第1の
識別子に対応するタスクが現在使用しているスタック容
量が小さい第1の識別子と第2の識別子との組合せを抽
出するスタック使用可能タスク選択部と、スタック使用
可能タスク選択部により抽出された第1の識別子と第2
の識別子との組合せにおける第1の識別子に対応するタ
スクの実行状態を走行不可能状態にし、第2の識別子に
対応するタスクの実行状態を走行状態にするタスク切り
替え部と、タスク情報格納部を検索して実行状態が走行
待ち状態であるタスクの識別子を全て抽出し、スタック
ポインタ格納部を検索してタスク情報格納部から抽出し
た識別子に対応するタスクのスタックポインタと実行状
態とを抽出し、スタックポインタ格納部からスタックポ
インタと実行状態とを抽出したタスクが使用しているス
タック内のデータを展開し、スタックポインタ格納部か
らスタックポインタと実行状態とを抽出したタスクの実
行状態をスタックポインタ格納部から抽出した実行状態
に変更し、スタックポインタ格納部からスタックポイン
タと実行状態とを抽出したタスクのスタックポインタと
実行状態とをスタックポインタ格納部から削除するスタ
ックデータ展開部と、を備えたことを特徴としている。
According to a fourth aspect of the invention, a plurality of tasks having at least four execution states of a runnable state, a run wait state, a runnable state and a runnable state and a unique identifier in the system are provided by task switching. A scheduling device in a computer system to be executed, which includes a task information storage unit that stores an identifier of each task and an execution state,
It stores the identifier of each task and the maximum stack capacity used by each task, and whether the task is in the run state or the run wait state when the task is in the run-disabled state and no stack is allocated. An identifier of an execution protection task that is in a run-disabled state when the task is in either the runnable state and the task execution state is either the runnable state, the run-waiting state, or the runnable state, and An execution protection task storage unit that stores the maximum stack capacity used when the execution protection task is in the run-disabled state, a stack pointer storage unit that stores the execution state and stack pointer of the task, and a task switching request Task switching request part that generates a task switching request part, and when the task switching request part generates a task switching request, Executable task extraction section that searches the protected task storage section and extracts the identifier of the task whose execution status is not run-protected for any task A running task extraction unit that changes the running state of a task that is running to a runnable state, searches the task information storage unit, and extracts the identifier of a task whose task running state is the run-waiting state or runnable state. , When the identifier extracted by the running task extraction unit is the first identifier and the identifier extracted by the executable task extraction unit is the second identifier, the execution protection task storage unit is searched for the first identifier. Available task for extracting the combination of the first identifier and the second identifier, which is the execution protection task of the task corresponding to the second identifier The execution state of the task corresponding to the identifier that can be the execution protection task in the combination of the extraction unit and the first identifier and the second identifier extracted by the stack usable task extraction unit is stored in the stack pointer storage unit and executed. Change the execution state of a task that can be a protection task to the running wait state, compress the data in the stack used by the task that can be an execution protection task, and store the stack pointer of the task that can be an execution protection task in the stack pointer storage section. A task corresponding to the first identifier in the combination of the first identifier and the second identifier extracted by the stack usable task extraction unit is searched by searching the stack data compression unit to be stored and the execution protection task storage unit. Obtain the maximum stack capacity to be used when it becomes unexecutable, and A stack usable task selection unit that extracts a combination of a first identifier and a second identifier that is currently used by a task corresponding to the identifier and has a small stack capacity, and a first unit extracted by the stack usable task selection unit Identifier and second
A task switching unit that sets the execution state of the task corresponding to the first identifier in the combination with the identifier of No. to the run-disabled state and the execution state of the task corresponding to the second identifier to the running state, and the task information storage unit. By extracting all the identifiers of the tasks whose execution state is waiting to run by searching, the stack pointer storage unit is searched, and the stack pointer and execution state of the task corresponding to the identifier extracted from the task information storage unit are extracted. Extracts the stack pointer and execution state from the stack pointer storage unit, expands the data in the stack used by the task, and stores the stack pointer and execution state from the stack pointer storage unit, and stores the execution state of the task Change to the execution state extracted from the copy section, and change the stack pointer and execution state from the stack pointer storage section. Are stack data developing unit for removing stack pointer out tasks and the execution state from the stack pointer storage portion, comprising the.

【0009】[0009]

【作用】請求項1の発明においては、タスク切り替え要
求ステップで、タスクの切り替え要求を発生し、実行可
能タスク抽出ステップで、タスク切り替え要求ステップ
においてタスク切り替え要求が発生されることにより、
タスク情報格納部と実行保護タスク格納部とを検索し
て、いずれのタスクに対しても実行保護タスクではなく
かつ実行状態が走行不可能状態であるタスクの識別子を
抽出し、実行中タスク抽出ステップで、タスクの実行状
態が走行状態であるタスクの実行状態を走行可能状態に
変更し、タスク情報格納部を検索してタスクの実行状態
が走行待ち状態または走行可能状態であるタスクの識別
子を抽出し、スタック使用可能タスク抽出ステップで、
実行中タスク抽出ステップにおいて抽出された識別子を
第1の識別子とし、実行可能タスク抽出ステップにおい
て抽出された識別子を第2の識別子としたときに、実行
保護タスク格納部を検索して、第1の識別子に対応する
タスクが第2の識別子に対応するタスクの実行保護タス
クである第1の識別子と第2の識別子との組合せを抽出
し、スタック使用可能タスク選択ステップで、実行保護
タスク格納部を検索して、スタック使用可能タスク抽出
ステップにおいて抽出された第1の識別子と第2の識別
子との組合せにおける第1の識別子に対応するタスクが
実行不可能状態となる場合に使用する最大のスタック容
量を得、そのスタック容量よりも第1の識別子に対応す
るタスクが現在使用しているスタック容量が小さい第1
の識別子と第2の識別子との組合せを抽出し、タスク切
り替えステップで、スタック使用可能タスク選択ステッ
プにおいて抽出された第1の識別子と第2の識別子との
組合せにおける第1の識別子に対応するタスクの実行状
態を走行不可能状態にし、第2の識別子に対応するタス
クの実行状態を走行状態にする。
According to the invention of claim 1, the task switching request is generated in the task switching request step, and the task switching request is generated in the task switching request step in the executable task extraction step.
The task information storage unit and the execution protection task storage unit are searched to extract an identifier of a task that is not an execution protection task and whose execution state is in a non-runnable state for any task, and an executing task extraction step Change the task execution state to the runnable state when the task is in the running state, search the task information storage section, and extract the identifier of the task that is in the run-waiting state or runnable state. Then, in the stack available task extraction step,
When the identifier extracted in the executing task extraction step is used as the first identifier and the identifier extracted in the executable task extraction step is used as the second identifier, the execution protection task storage unit is searched for the first identifier. The combination of the first identifier and the second identifier, which is the execution protection task of the task whose identifier corresponds to the second identifier, is extracted, and the execution protection task storage unit is stored in the stack usable task selection step. Maximum stack capacity used when the task corresponding to the first identifier in the combination of the first identifier and the second identifier extracted in the stack usable task extraction step is in the inexecutable state And the stack capacity currently used by the task corresponding to the first identifier is smaller than the stack capacity
Of the combination of the first identifier and the second identifier, and the task corresponding to the first identifier in the combination of the first identifier and the second identifier extracted in the stack usable task selection step in the task switching step. Of the task corresponding to the second identifier is set to the running state.

【0010】請求項2の発明において、タスク情報格納
部は、各タスクの識別子と実行状態とを格納する。実行
保護タスク格納部は、各タスクの識別子と各タスクが使
用する最大のスタック容量とを格納すると共に、タスク
の実行状態が走行不可能状態でありかつスタックが割り
当てられていない場合に実行状態が走行状態か走行待ち
状態か走行可能状態かのいずれかの状態となり、かつタ
スクの実行状態が走行状態か走行待ち状態か走行可能状
態かのいずれかの状態である場合に走行不可能状態とな
る実行保護タスクの識別子と、実行保護タスクが走行不
可能状態となる場合に使用する最大のスタック容量とを
格納する。タスク切り替え要求部は、タスクの切り替え
要求を発生する。実行可能タスク抽出部は、タスク切り
替え要求部がタスク切り替え要求を発生したときに、タ
スク情報格納部と実行保護タスク格納部とを検索して、
いずれのタスクに対しても実行保護タスクではなくかつ
実行状態が走行不可能状態であるタスクの識別子を抽出
する。実行中タスク抽出部は、タスクの実行状態が走行
状態であるタスクの実行状態を走行可能状態に変更し、
タスク情報格納部を検索してタスクの実行状態が走行待
ち状態または走行可能状態であるタスクの識別子を抽出
する。スタック使用可能タスク抽出部は、実行中タスク
抽出部により抽出された識別子を第1の識別子とし、実
行可能タスク抽出部により抽出された識別子を第2の識
別子としたときに、実行保護タスク格納部を検索して、
第1の識別子に対応するタスクが第2の識別子に対応す
るタスクの実行保護タスクである第1の識別子と第2の
識別子との組合せを抽出する。スタック使用可能タスク
選択部は、実行保護タスク格納部を検索して、スタック
使用可能タスク抽出部により抽出された第1の識別子と
第2の識別子との組合せにおける第1の識別子に対応す
るタスクが実行不可能状態となる場合に使用する最大の
スタック容量を得、そのスタック容量よりも第1の識別
子に対応するタスクが現在使用しているスタック容量が
小さい第1の識別子と第2の識別子との組合せを抽出す
る。タスク切り替え部は、スタック使用可能タスク選択
部により抽出された第1の識別子と第2の識別子との組
合せにおける第1の識別子に対応するタスクの実行状態
を走行不可能状態にし、第2の識別子に対応するタスク
の実行状態を走行状態にする。
In the invention of claim 2, the task information storage section stores the identifier and the execution state of each task. The execution protection task storage unit stores the identifier of each task and the maximum stack capacity used by each task, and when the execution state of the task is the run-disabled state and the stack is not allocated, the execution state is When the task is in the running state, the waiting state, or the runnable state, and the task execution state is either the running state, the runnable state, or the runnable state, the runnable state is set. The identifier of the execution protection task and the maximum stack capacity used when the execution protection task is in the run-disabled state are stored. The task switching request unit generates a task switching request. The executable task extraction unit searches the task information storage unit and the execution protection task storage unit when the task switching request unit issues a task switching request,
An identifier of a task that is not an execution protection task and whose execution state is the run-disabled state is extracted for any task. The running task extraction unit changes the running state of the task whose running state is the running state to the runnable state,
The task information storage unit is searched to extract the identifier of the task whose task execution state is the running waiting state or the runnable state. The stack usable task extraction unit, when the identifier extracted by the executing task extraction unit is the first identifier and the identifier extracted by the executable task extraction unit is the second identifier, the execution protected task storage unit Search for
A combination of the first identifier and the second identifier, which is the execution protection task of the task corresponding to the second identifier, corresponding to the first identifier is extracted. The stack usable task selection unit searches the execution protection task storage unit and finds the task corresponding to the first identifier in the combination of the first identifier and the second identifier extracted by the stack usable task extraction unit. A first identifier and a second identifier that have the maximum stack capacity to be used in the case of the non-executable state and have a smaller stack capacity currently used by the task corresponding to the first identifier than the stack capacity Extract the combination of. The task switching unit sets the execution state of the task corresponding to the first identifier in the combination of the first identifier and the second identifier extracted by the stack usable task selection unit to the run-disabled state, and the second identifier. The execution state of the task corresponding to is set to the running state.

【0011】請求項3の発明においては、タスク切り替
え要求ステップで、タスクの切り替え要求を発生し、実
行可能タスク抽出ステップで、タスク切り替え要求ステ
ップにおいてタスク切り替え要求が発生されることによ
り、タスク情報格納部と実行保護タスク格納部とを検索
して、いずれのタスクに対しても実行保護タスクではな
くかつ実行状態が走行不可能状態であるタスクの識別子
を抽出し、実行中タスク抽出ステップで、タスクの実行
状態が走行状態であるタスクの実行状態を走行可能状態
に変更し、タスク情報格納部を検索してタスクの実行状
態が走行待ち状態または走行可能状態であるタスクの識
別子を抽出し、スタック使用可能タスク抽出ステップ
で、実行中タスク抽出ステップにおいて抽出された識別
子を第1の識別子とし、実行可能タスク抽出ステップに
おいて抽出された識別子を第2の識別子としたときに、
実行保護タスク格納部を検索して、第1の識別子に対応
するタスクが第2の識別子に対応するタスクの実行保護
タスクである第1の識別子と第2の識別子との組合せを
抽出し、スタックデータ圧縮ステップで、スタック使用
可能タスク抽出ステップにおいて抽出された第1の識別
子と第2の識別子との組合せにおいて実行保護タスクと
なり得る識別子に対応するタスクの実行状態をスタック
ポインタ格納部に格納し、実行保護タスクとなり得るタ
スクの実行状態を走行待ち状態に変更し、実行保護タス
クとなり得るタスクが使用しているスタック内のデータ
を圧縮し、実行保護タスクとなり得るタスクのスタック
ポインタをスタックポインタ格納部に格納し、スタック
使用可能タスク選択ステップで、実行保護タスク格納部
を検索して、スタック使用可能タスク抽出ステップにお
いて抽出された第1の識別子と第2の識別子との組合せ
における第1の識別子に対応するタスクが実行不可能状
態となる場合に使用する最大のスタック容量を得、その
スタック容量よりも第1の識別子に対応するタスクが現
在使用しているスタック容量が小さい第1の識別子と第
2の識別子との組合せを抽出し、タスク切り替えステッ
プで、スタック使用可能タスク選択ステップにおいて抽
出された第1の識別子と第2の識別子との組合せにおけ
る第1の識別子に対応するタスクの実行状態を走行不可
能状態にし、第2の識別子に対応するタスクの実行状態
を走行状態にし、スタックデータ展開ステップで、タス
ク情報格納部を検索して実行状態が走行待ち状態である
タスクの識別子を全て抽出し、スタックポインタ格納部
を検索してタスク情報格納部から抽出した識別子に対応
するタスクのスタックポインタと実行状態とを抽出し、
スタックポインタ格納部からスタックポインタと実行状
態とを抽出したタスクが使用しているスタック内のデー
タを展開し、スタックポインタ格納部からスタックポイ
ンタと実行状態とを抽出したタスクの実行状態をスタッ
クポインタ格納部から抽出した実行状態に変更し、スタ
ックポインタ格納部からスタックポインタと実行状態と
を抽出したタスクのスタックポインタと実行状態とをス
タックポインタ格納部から削除する。
According to the third aspect of the present invention, the task switching request is generated in the task switching request step, and the task switching request is generated in the task switching request step in the executable task extraction step. Section and the execution protection task storage section to retrieve the identifiers of tasks that are not execution protection tasks and whose execution status is not runnable for any of the tasks. The execution state of the task is changed to the running state, the task execution state is changed to the runnable state, the task information storage unit is searched, and the identifier of the task whose execution state is the waiting state or the runnable state is extracted, In the available task extracting step, the identifier extracted in the executing task extracting step is set as the first identifier. , When the identifier extracted in executable tasks extraction step is a second identifier,
The execution protection task storage unit is searched to extract the combination of the first identifier and the second identifier, which is the execution protection task of the task corresponding to the second identifier, corresponding to the first identifier, and stacks the stack. In the data compression step, the execution state of the task corresponding to the identifier that can be the execution protection task in the combination of the first identifier and the second identifier extracted in the stack usable task extraction step is stored in the stack pointer storage unit, Change the execution state of a task that can be an execution protection task to the waiting state, compress the data in the stack used by the task that can be an execution protection task, and store the stack pointer of the task that can be an execution protection task in the stack pointer storage In the stack usable task selection step, the execution protection task storage section is searched and The maximum stack capacity to be used when the task corresponding to the first identifier in the combination of the first identifier and the second identifier extracted in the usable task extracting step is in the inexecutable state, and A combination of the first identifier and the second identifier whose stack capacity currently used by the task corresponding to the first identifier is smaller than the stack capacity is extracted, and in the task switching step, in the stack usable task selecting step. In the extracted combination of the first identifier and the second identifier, the execution state of the task corresponding to the first identifier is set to the non-running state, and the execution state of the task corresponding to the second identifier is set to the running state, In the stack data expansion step, the task information storage section is searched to extract all the identifiers of the tasks whose execution status is waiting for running, Extracts the execution state and the stack pointer of the corresponding task identifier extracted from the search to the task information storage unit Kupointa storage unit,
Extracts the stack pointer and execution state from the stack pointer storage unit, expands the data in the stack used by the task, and stores the stack pointer and execution state from the stack pointer storage unit, and stores the execution state of the task The execution state extracted from the stack pointer is changed to the execution state, and the stack pointer and the execution state of the task whose stack pointer and execution state are extracted from the stack pointer storage unit are deleted from the stack pointer storage unit.

【0012】請求項4の発明において、タスク情報格納
部は、各タスクの識別子と実行状態とを格納する。実行
保護タスク格納部は、各タスクの識別子と各タスクが使
用する最大のスタック容量とを格納すると共に、タスク
の実行状態が走行不可能状態でありかつスタックが割り
当てられていない場合に実行状態が走行状態か走行待ち
状態か走行可能状態かのいずれかの状態となり、かつタ
スクの実行状態が走行状態か走行待ち状態か走行可能状
態かのいずれかの状態である場合に走行不可能状態とな
る実行保護タスクの識別子と、実行保護タスクが走行不
可能状態となる場合に使用する最大のスタック容量とを
格納する。スタックポインタ格納部は、タスクの実行状
態とスタックポインタとを格納する。タスク切り替え要
求部は、タスクの切り替え要求を発生する。実行可能タ
スク抽出部は、タスク切り替え要求部がタスク切り替え
要求を発生したときに、タスク情報格納部と実行保護タ
スク格納部とを検索して、いずれのタスクに対しても実
行保護タスクではなくかつ実行状態が走行不可能状態で
あるタスクの識別子を抽出する。実行中タスク抽出部
は、タスクの実行状態が走行状態であるタスクの実行状
態を走行可能状態に変更し、タスク情報格納部を検索し
てタスクの実行状態が走行待ち状態または走行可能状態
であるタスクの識別子を抽出する。スタック使用可能タ
スク抽出部は、実行中タスク抽出部により抽出された識
別子を第1の識別子とし、実行可能タスク抽出部により
抽出された識別子を第2の識別子としたときに、実行保
護タスク格納部を検索して、第1の識別子に対応するタ
スクが第2の識別子に対応するタスクの実行保護タスク
である第1の識別子と第2の識別子との組合せを抽出す
る。スタックデータ圧縮部は、スタック使用可能タスク
抽出部により抽出された第1の識別子と第2の識別子と
の組合せにおいて実行保護タスクとなり得る識別子に対
応するタスクの実行状態をスタックポインタ格納部に格
納し、実行保護タスクとなり得るタスクの実行状態を走
行待ち状態に変更し、実行保護タスクとなり得るタスク
が使用しているスタック内のデータを圧縮し、実行保護
タスクとなり得るタスクのスタックポインタをスタック
ポインタ格納部に格納する。スタック使用可能タスク選
択部は、実行保護タスク格納部を検索して、スタック使
用可能タスク抽出部により抽出された第1の識別子と第
2の識別子との組合せにおける第1の識別子に対応する
タスクが実行不可能状態となる場合に使用する最大のス
タック容量を得、そのスタック容量よりも第1の識別子
に対応するタスクが現在使用しているスタック容量が小
さい第1の識別子と第2の識別子との組合せを抽出す
る。タスク切り替え部は、スタック使用可能タスク選択
部により抽出された第1の識別子と第2の識別子との組
合せにおける第1の識別子に対応するタスクの実行状態
を走行不可能状態にし、第2の識別子に対応するタスク
の実行状態を走行状態にする。スタックデータ展開部
は、タスク情報格納部を検索して実行状態が走行待ち状
態であるタスクの識別子を全て抽出し、スタックポイン
タ格納部を検索してタスク情報格納部から抽出した識別
子に対応するタスクのスタックポインタと実行状態とを
抽出し、スタックポインタ格納部からスタックポインタ
と実行状態とを抽出したタスクが使用しているスタック
内のデータを展開し、スタックポインタ格納部からスタ
ックポインタと実行状態とを抽出したタスクの実行状態
をスタックポインタ格納部から抽出した実行状態に変更
し、スタックポインタ格納部からスタックポインタと実
行状態とを抽出したタスクのスタックポインタと実行状
態とをスタックポインタ格納部から削除する。
In the invention of claim 4, the task information storage section stores the identifier and the execution state of each task. The execution protection task storage unit stores the identifier of each task and the maximum stack capacity used by each task, and when the execution state of the task is the run-disabled state and the stack is not allocated, the execution state is When the task is in the running state, the waiting state, or the runnable state, and the task execution state is either the running state, the runnable state, or the runnable state, the runnable state is set. The identifier of the execution protection task and the maximum stack capacity used when the execution protection task is in the run-disabled state are stored. The stack pointer storage unit stores the task execution state and the stack pointer. The task switching request unit generates a task switching request. The executable task extraction unit searches the task information storage unit and the execution protection task storage unit when the task switching request unit issues a task switching request, and determines that neither task is an execution protection task. The identifier of the task whose execution state is the run-disabled state is extracted. The running task extraction unit changes the running state of the task whose running state is the running state to the runnable state, searches the task information storage unit, and the task running state is the run waiting state or the runnable state. Extract the task identifier. The stack usable task extraction unit, when the identifier extracted by the executing task extraction unit is the first identifier and the identifier extracted by the executable task extraction unit is the second identifier, the execution protected task storage unit By searching for a combination of the first identifier and the second identifier, which is the execution protection task of the task corresponding to the second identifier. The stack data compression unit stores, in the stack pointer storage unit, the execution state of the task corresponding to the identifier that can be the execution protection task in the combination of the first identifier and the second identifier extracted by the stack usable task extraction unit. , The execution state of a task that can be an execution protection task is changed to the running wait state, the data in the stack used by the task that can be an execution protection task is compressed, and the stack pointer of the task that can be an execution protection task is stored in the stack pointer. Store in the department. The stack usable task selection unit searches the execution protection task storage unit and finds the task corresponding to the first identifier in the combination of the first identifier and the second identifier extracted by the stack usable task extraction unit. A first identifier and a second identifier that have the maximum stack capacity to be used in the case of the non-executable state and have a smaller stack capacity currently used by the task corresponding to the first identifier than the stack capacity Extract the combination of. The task switching unit sets the execution state of the task corresponding to the first identifier in the combination of the first identifier and the second identifier extracted by the stack usable task selection unit to the run-disabled state, and the second identifier. The execution state of the task corresponding to is set to the running state. The stack data decompression unit searches the task information storage unit to extract all the identifiers of the tasks whose execution state is in the running waiting state, and searches the stack pointer storage unit to extract the task corresponding to the identifier extracted from the task information storage unit. Extract the stack pointer and the execution state of the stack pointer, extract the stack pointer and the execution state from the stack pointer storage unit, expand the data in the stack used by the task, and extract the stack pointer and the execution state from the stack pointer storage unit. Change the execution state of the extracted task to the execution state extracted from the stack pointer storage unit, and delete the stack pointer and execution state of the task that extracted the stack pointer and execution state from the stack pointer storage unit from the stack pointer storage unit. To do.

【0013】[0013]

【実施例】以下、本発明の実施例を図面を用いて詳細に
説明する。 (実施例1)図1は本発明の実施例1におけるスケジュ
ーリング装置の構成図で、このスケジューリング装置
は、タスク情報格納部1と、実行保護タスク格納部2
と、タスク切り替え要求部3と、実行可能タスク抽出部
4と、実行中タスク抽出部5と、スタック使用可能タス
ク抽出部6と、スタック使用可能タスク選択部7と、タ
スク切り替え部8とを備えている。タスク情報格納部1
は、各タスクの識別子と実行状態とを格納する。実行保
護タスク格納部2は、各タスクの識別子と各タスクが使
用する最大のスタック容量とを格納すると共に、タスク
の実行状態が走行不可能状態でありかつスタックが割り
当てられていない場合に実行状態が走行状態か走行待ち
状態か走行可能状態かのいずれかの状態となり、かつタ
スクの実行状態が走行状態か走行待ち状態か走行可能状
態かのいずれかの状態である場合に走行不可能状態とな
る実行保護タスクの識別子と、実行保護タスクが走行不
可能状態となる場合に使用する最大のスタック容量とを
格納する。タスク切り替え要求部3は、タスクの切り替
え要求を発生する。実行可能タスク抽出部4は、タスク
切り替え要求部3がタスク切り替え要求を発生したとき
に、タスク情報格納部1と実行保護タスク格納部2とを
検索して、いずれのタスクに対しても実行保護タスクで
はなくかつ実行状態が走行不可能状態であるタスクの識
別子を抽出する。実行中タスク抽出部5は、タスクの実
行状態が走行状態であるタスクの実行状態を走行可能状
態に変更し、タスク情報格納部1を検索してタスクの実
行状態が走行待ち状態または走行可能状態であるタスク
の識別子を抽出する。スタック使用可能タスク抽出部6
は、実行中タスク抽出部5により抽出された識別子を第
1の識別子とし、実行可能タスク抽出部4により抽出さ
れた識別子を第2の識別子としたときに、実行保護タス
ク格納部2を検索して、第1の識別子に対応するタスク
が第2の識別子に対応するタスクの実行保護タスクであ
る第1の識別子と第2の識別子との組合せを抽出する。
スタック使用可能タスク選択部7は、実行保護タスク格
納部2を検索して、スタック使用可能タスク抽出部6に
より抽出された第1の識別子と第2の識別子との組合せ
における第1の識別子に対応するタスクが走行不可能状
態となる場合に使用する最大のスタック容量を得、その
スタック容量よりも第1の識別子に対応するタスクが現
在使用しているスタック容量が小さい第1の識別子と第
2の識別子との組合せを抽出する。タスク切り替え部8
は、スタック使用可能タスク選択部7により抽出された
第1の識別子と第2の識別子との組合せにおける第1の
識別子に対応するタスクの実行状態を走行不可能状態に
し、第2の識別子に対応するタスクの実行状態を走行状
態にする。
Embodiments of the present invention will now be described in detail with reference to the drawings. (Embodiment 1) FIG. 1 is a block diagram of a scheduling apparatus according to Embodiment 1 of the present invention. This scheduling apparatus includes a task information storage unit 1 and an execution protection task storage unit 2.
A task switching request unit 3, an executable task extraction unit 4, a running task extraction unit 5, a stack available task extraction unit 6, a stack available task selection unit 7, and a task switching unit 8. ing. Task information storage unit 1
Stores the identifier and execution status of each task. The execution protection task storage unit 2 stores the identifier of each task and the maximum stack capacity used by each task, and also stores the execution state when the task is in the run-disabled state and no stack is allocated. Is in the running state, the waiting state, or the runnable state, and the task is in the running state, the runnable state, or the runnable state, the runnable state is set. The execution protection task identifier and the maximum stack capacity used when the execution protection task is in the run-disabled state are stored. The task switching request unit 3 issues a task switching request. When the task switching request unit 3 issues a task switching request, the executable task extraction unit 4 searches the task information storage unit 1 and the execution protection task storage unit 2 to execute protection for any task. An identifier of a task which is not a task and whose execution state is the run-disabled state is extracted. The running task extraction unit 5 changes the running state of the task whose running state is the running state to the runnable state, searches the task information storage unit 1, and determines whether the task running state is the run-ready state or the runnable state. To extract the task identifier. Stack usable task extraction unit 6
Searches the execution protection task storage unit 2 when the identifier extracted by the executing task extraction unit 5 is the first identifier and the identifier extracted by the executable task extraction unit 4 is the second identifier. Then, the combination of the first identifier and the second identifier, which is the execution protection task of the task corresponding to the second identifier, corresponding to the first identifier, is extracted.
The stack usable task selection unit 7 searches the execution protection task storage unit 2 and corresponds to the first identifier in the combination of the first identifier and the second identifier extracted by the stack usable task extraction unit 6. The maximum stack capacity to be used when the task to be executed is in the run-disabled state is obtained, and the stack capacity currently used by the task corresponding to the first identifier is smaller than the stack capacity. The combination with the identifier of is extracted. Task switching unit 8
Indicates that the execution state of the task corresponding to the first identifier in the combination of the first identifier and the second identifier extracted by the stack usable task selection unit 7 is set to the run-disabled state and corresponds to the second identifier. Set the running state of the task to run.

【0014】上記スケジューリング装置の動作につい
て、図2のフローチャートを参照しながら説明する。先
ずタスク切り替え要求部3が、タイマー割り込みなどに
よる従来周知の方法により、タスク切り替え要求を発生
する(ステップS1)。次に実行可能タスク抽出部4
が、タスク切り替え要求部3からのタスク切り替え要求
を受けて、タスク情報格納部1および実行保護タスク格
納部2から、いずれのタスクに対しても実行保護タスク
ではなく、かつ実行状態が走行不可能状態であるタスク
の識別子を検索し(ステップS2)、候補となる識別子
が見つからなかった場合、処理を終了する。なお、候補
となる識別子が見つからなかった場合に処理を終了する
とは、通常のスケジューリング装置に処理を戻す又はタ
スク切り替えを行わないということであり、このことは
以下も同様である。候補となる識別子が1つ以上存在す
れば、それらを抽出する(ステップS3)。次に実行中
タスク抽出部5が、実行状態が走行状態であるタスクを
走行可能状態に変更し、タスク情報格納部1から、実行
状態が走行可能状態または走行待ち状態であるタスクの
識別子を検索し(ステップS4)、候補となる識別子が
見つからなかった場合、処理を終了する。候補となる識
別子が1つ以上存在すれば、それらを抽出する(ステッ
プS5)。次にスタック使用可能タスク抽出部6が、実
行保護タスク格納部2から、第1の識別子に対応するタ
スクが第2の識別子に対応するタスクの実行保護タスク
である第1の識別子と第2の識別子との組合せを検索し
(ステップS6)、候補となる識別子が見つからなかっ
た場合、処理を終了する。候補となる識別子が1つ以上
存在すれば、それらを抽出する(ステップS7)。次に
スタック使用可能タスク選択部7が、スタック使用可能
タスク抽出部6により抽出された第1の識別子と第2の
識別子との組合せにおける第1の識別子に対応するタス
クの実行状態が走行不可能状態となる場合に使用する最
大のスタック容量を実行保護タスク格納部2から取得
し、そのスタック容量よりも第1の識別子に対応するタ
スクが現在使用しているスタック容量が小さい組合せを
検索し(ステップS8)、候補となる識別子が見つから
なかった場合、処理を終了する。候補となる識別子が1
つ以上存在すれば、それらを抽出する(ステップS
9)。次にタスク切り替え部8が、スタック使用可能タ
スク選択部7により抽出された第1の識別子に対応する
実行保護タスクの実行状態を走行不可能状態とし、第2
の識別子に対応するタスクの実行状態を走行状態として
(ステップS10)、処理を終了する。
The operation of the scheduling device will be described with reference to the flowchart of FIG. First, the task switching request unit 3 generates a task switching request by a conventionally known method such as timer interruption (step S1). Next executable task extractor 4
However, in response to the task switching request from the task switching requesting unit 3, neither the task information storage unit 1 nor the execution protection task storage unit 2 is an execution protection task for any task, and the execution state cannot run. The identifier of the task in the state is searched (step S2), and if the candidate identifier is not found, the process ends. Note that terminating the process when no candidate identifier is found means not returning the process to the normal scheduling device or switching the task, and this also applies to the following. If one or more candidate identifiers exist, they are extracted (step S3). Next, the running task extraction unit 5 changes the task whose running state is the running state to the runnable state, and searches the task information storage unit 1 for the identifier of the task whose running state is the runnable state or the run waiting state. If no candidate identifier is found (step S4), the process ends. If one or more candidate identifiers exist, they are extracted (step S5). Next, the stack usable task extraction unit 6 extracts from the execution protection task storage unit 2 a first identifier and a second identifier which are execution protection tasks of the task corresponding to the second identifier. The combination with the identifier is searched for (step S6), and if no candidate identifier is found, the process ends. If there are one or more candidate identifiers, they are extracted (step S7). Next, the stack usable task selection unit 7 causes the execution state of the task corresponding to the first identifier in the combination of the first identifier and the second identifier extracted by the stack usable task extraction unit 6 to not run. The maximum stack capacity used when the status is reached is acquired from the execution protection task storage unit 2, and a combination in which the stack capacity currently used by the task corresponding to the first identifier is smaller than the stack capacity is searched for ( If no candidate identifier is found in step S8), the process ends. Candidate identifier is 1
If more than one exist, they are extracted (step S
9). Next, the task switching unit 8 sets the execution state of the execution protection task corresponding to the first identifier extracted by the stack usable task selection unit 7 to the run-disabled state, and the second state
The execution state of the task corresponding to the identifier is set to the running state (step S10), and the process ends.

【0015】次に、上記スケジューリング装置のさらに
具体的な動作の一例について説明する。図3はタスク情
報格納部1に格納されている内容の概念図で、識別子1
のタスクの実行状態は走行状態、識別子2のタスクの実
行状態は走行不可能状態、識別子3のタスクの実行状態
は走行可能状態である。なお、タスク情報格納部1に格
納されている実行状態は、タスクの実行状態の変化に伴
って適宜変更される。
Next, an example of a more specific operation of the scheduling device will be described. FIG. 3 is a conceptual diagram of the contents stored in the task information storage unit 1. The identifier 1
The execution state of the task is the running state, the execution state of the task with the identifier 2 is the run-disabled state, and the execution state of the task with the identifier 3 is the runnable state. The execution status stored in the task information storage unit 1 is appropriately changed as the execution status of the task changes.

【0016】図4は実行保護タスク格納部2に格納され
ている内容の概念図で、識別子1のタスクが使用する最
大のスタック容量は50であり、対応する実行保護タス
クはない。識別子2のタスクが使用する最大のスタック
容量は50であり、対応する実行保護タスクの識別子は
1である。本実施例の場合、識別子2のタスクに対応す
る実行保護タスクの識別子が1であるということは、識
別子2のタスクが走行可能状態、走行待ち状態、走行状
態のいずれかの状態になるためには、識別子1のタスク
が使用するスタック容量が30以下でなければならない
ということである。識別子3のタスクが使用する最大の
スタック容量は70であり、対応する実行保護タスクは
ない。
FIG. 4 is a conceptual diagram of the contents stored in the execution protection task storage unit 2. The maximum stack capacity used by the task with the identifier 1 is 50, and there is no corresponding execution protection task. The maximum stack capacity used by the task with the identifier 2 is 50, and the identifier of the corresponding execution protection task is 1. In the case of the present embodiment, the fact that the identifier of the execution protection task corresponding to the task of identifier 2 is 1 means that the task of identifier 2 is in one of the runnable state, the run wait state, and the run state. Means that the stack capacity used by the task with identifier 1 must be 30 or less. The maximum stack capacity used by the task with identifier 3 is 70, and there is no corresponding execution protection task.

【0017】いま、走行状態である識別子1が使用して
いるスタック容量は25であるとする。先ずタスク切り
替え要求部3が、タスク切り替え要求を発生し、実行可
能タスク抽出部4に渡す。これにより実行可能タスク抽
出部4が、タスク情報格納部1と実行保護タスク格納部
2とから、タスク情報格納部1に格納されている識別子
に対応するいずれのタスクに対しても実行保護タスクで
はなく、かつ実行状態が走行不可能状態であるタスクの
識別子を抽出する。抽出した結果、識別子2が候補とな
る。次に実行中タスク抽出部5が、実行状態が走行状態
であるタスクを走行可能状態に変更し、タスク情報格納
部1に格納されているタスクの実行状態が走行待ち状態
または走行可能状態であるタスクの識別子を抽出する。
抽出した結果、識別子1と識別子3とが候補となる。次
にスタック使用可能タスク抽出部6が、実行中タスク抽
出部5によって抽出された識別子1または識別子3に対
応する実行保護タスクの識別子を、実行保護タスク格納
部2から抽出し、実行可能タスク抽出部4によって抽出
された識別子2と照合する。抽出した結果、識別子1と
識別子2との組み合わせが候補として抽出される。次に
スタック使用可能タスク選択部7が、スタック使用可能
タスク抽出部6によって抽出された組合せより、実行保
護タスクとなり得る識別子1に対応するタスクが走行不
可能状態となる場合に使用する最大のスタック容量を実
行保護タスク格納部2から抽出し、30を得る。さらに
スタック使用可能タスク選択部7が、識別子1に対応す
るタスクが使用しているスタック容量を従来周知の方法
により抽出し、25を得る。この結果、25は30以下
であるので、識別子1と識別子2との組合せが候補とし
て抽出される。次にタスク切り替え部8が、スタック使
用可能タスク選択部7によって抽出された識別子1のタ
スクを走行不可能状態とし、識別子2のタスクを走行状
態とし、識別子1のタスクが使用していたスタックを使
用して識別子2のタスクを実行する。かくして、タスク
情報格納部1の内容は図5のようになる。このように、
実行可能なタスクとスタックを使用することができる別
のタスクとの組合せを選択できるので、スタックの有効
利用を図ることができ、スタックの容量が少ない場合に
はスケジューリングできないという従来の問題を良好に
低減できる。
Now, it is assumed that the stack capacity used by the running identifier 1 is 25. First, the task switching request unit 3 generates a task switching request and passes it to the executable task extraction unit 4. As a result, the executable task extraction unit 4 does not execute the execution protection task for any task corresponding to the identifier stored in the task information storage unit 1 from the task information storage unit 1 and the execution protection task storage unit 2. An identifier of a task that is not present and whose execution state is in the run-disabled state is extracted. As a result of the extraction, the identifier 2 becomes a candidate. Next, the running task extraction unit 5 changes the task whose running state is the running state to the runnable state, and the task running state stored in the task information storage unit 1 is the run waiting state or runnable state. Extract the task identifier.
As a result of the extraction, the identifiers 1 and 3 are candidates. Next, the stack usable task extraction unit 6 extracts the identifier of the execution protection task corresponding to the identifier 1 or the identifier 3 extracted by the executing task extraction unit 5 from the execution protection task storage unit 2 and extracts the executable task. The identifier 2 extracted by the unit 4 is collated. As a result of the extraction, the combination of the identifier 1 and the identifier 2 is extracted as a candidate. Next, the stack usable task selection unit 7 uses the maximum stack that is used when the task corresponding to the identifier 1 that can be an execution protection task is in the run-disabled state based on the combination extracted by the stack usable task extraction unit 6. The capacity is extracted from the execution protection task storage unit 2 to obtain 30. Further, the stack usable task selection unit 7 extracts the stack capacity used by the task corresponding to the identifier 1 by a conventionally known method, and obtains 25. As a result, since 25 is 30 or less, the combination of identifier 1 and identifier 2 is extracted as a candidate. Next, the task switching unit 8 sets the task with the identifier 1 extracted by the stack usable task selection unit 7 in the run-disabled state, sets the task with the identifier 2 in the running state, and sets the stack used by the task with the identifier 1 Use to perform the task with identifier 2. Thus, the contents of the task information storage unit 1 are as shown in FIG. in this way,
You can select a combination of an executable task and another task that can use the stack, which makes it possible to effectively use the stack and solve the conventional problem that scheduling cannot be performed when the stack capacity is small. It can be reduced.

【0018】なお上記具体例においては、スタック使用
可能タスク選択部7により候補として抽出される識別子
の組み合わせが1組である例について説明したが、複数
の組み合わせが抽出される場合も考えられる。この場
合、抽出された識別子の組み合わせの中から、任意の1
つの組み合わせを選択する。 (実施例2)図6は本発明の実施例2におけるスケジュ
ーリング装置の構成図で、このスケジューリング装置
は、タスク情報格納部11と、実行保護タスク格納部1
2と、タスク切り替え要求部13と、実行可能タスク抽
出部14と、実行中タスク抽出部15と、スタック使用
可能タスク抽出部16と、スタック使用可能タスク選択
部17と、スタックポインタ格納部18と、スタックデ
ータ圧縮部19と、スタックデータ展開部20と、タス
ク切り替え部21とを備えている。タスク情報格納部1
1は、各タスクの識別子と実行状態とを格納する。実行
保護タスク格納部12は、各タスクの識別子と各タスク
が使用する最大のスタック容量とを格納すると共に、タ
スクの実行状態が走行不可能状態でありかつスタックが
割り当てられていない場合に実行状態が走行状態か走行
待ち状態か走行可能状態かのいずれかの状態となり、か
つタスクの実行状態が走行状態か走行待ち状態か走行可
能状態かのいずれかの状態である場合に走行不可能状態
となる実行保護タスクの識別子と、実行保護タスクが走
行不可能状態となる場合に使用する最大のスタック容量
とを格納する。タスク切り替え要求部13は、タスクの
切り替え要求を発生する。実行可能タスク抽出部14
は、タスク切り替え要求部13がタスク切り替え要求を
発生したときに、タスク情報格納部11と実行保護タス
ク格納部12とを検索して、いずれのタスクに対しても
実行保護タスクではなくかつ実行状態が走行不可能状態
であるタスクの識別子を抽出する。実行中タスク抽出部
15は、タスクの実行状態が走行状態であるタスクの実
行状態を走行可能状態に変更し、タスク情報格納部11
を検索してタスクの実行状態が走行待ち状態または走行
可能状態であるタスクの識別子を抽出する。スタック使
用可能タスク抽出部16は、実行中タスク抽出部15に
より抽出された識別子を第1の識別子とし、実行可能タ
スク抽出部14により抽出された識別子を第2の識別子
としたときに、実行保護タスク格納部12を検索して、
第1の識別子に対応するタスクが第2の識別子に対応す
るタスクの実行保護タスクである第1の識別子と第2の
識別子との組合せを抽出する。スタック使用可能タスク
選択部17は、実行保護タスク格納部12を検索して、
スタック使用可能タスク抽出部16により抽出された第
1の識別子と第2の識別子との組合せにおける第1の識
別子に対応するタスクが走行不可能状態となる場合に使
用する最大のスタック容量を得、そのスタック容量より
も第1の識別子に対応するタスクが現在使用しているス
タック容量が小さい第1の識別子と第2の識別子との組
合せを抽出する。スタックポインタ格納部18は、タス
クの識別子と実行状態とスタックポインタとを格納す
る。スタックデータ圧縮部19は、スタック使用可能タ
スク抽出部16により抽出された第1の識別子と第2の
識別子との組合せにおいて実行保護タスクとなり得る識
別子に対応するタスクの実行状態をスタックポインタ格
納部18に格納し、実行保護タスクとなり得るタスクの
実行状態を走行待ち状態に変更し、実行保護タスクとな
り得るタスクが使用しているスタック内のデータを圧縮
し、実行保護タスクとなり得るタスクのスタックポイン
タをスタックポインタ格納部18に格納する。スタック
データ展開部20は、タスク情報格納部11を検索して
実行状態が走行待ち状態であるタスクの識別子を全て抽
出し、スタックポインタ格納部18を検索してタスク情
報格納部11から抽出した識別子に対応するタスクのス
タックポインタと実行状態とを抽出し、スタックポイン
タ格納部18からスタックポインタと実行状態とを抽出
したタスクが使用しているスタック内のデータを展開
し、スタックポインタ格納部18からスタックポインタ
と実行状態とを抽出したタスクの実行状態をスタックポ
インタ格納部18から抽出した実行状態に変更し、スタ
ックポインタ格納部18からスタックポインタと実行状
態とを抽出したタスクのスタックポインタと実行状態と
をスタックポインタ格納部18から削除する。タスク切
り替え部21は、スタック使用可能タスク選択部17に
より抽出された第1の識別子と第2の識別子との組合せ
における第1の識別子に対応するタスクの実行状態を走
行不可能状態にし、第2の識別子に対応するタスクの実
行状態を走行状態にする。
In the above specific example, the example in which the combination of the identifiers extracted as candidates by the stack usable task selection unit 7 is one set has been described, but a plurality of combinations may be extracted. In this case, any one of the extracted combinations of identifiers
Choose one combination. (Embodiment 2) FIG. 6 is a block diagram of a scheduling apparatus according to Embodiment 2 of the present invention. This scheduling apparatus includes a task information storage unit 11 and an execution protection task storage unit 1.
2, a task switching request unit 13, an executable task extraction unit 14, a running task extraction unit 15, a stack available task extraction unit 16, a stack available task selection unit 17, and a stack pointer storage unit 18. , A stack data compression unit 19, a stack data expansion unit 20, and a task switching unit 21. Task information storage unit 1
1 stores the identifier and execution state of each task. The execution protection task storage unit 12 stores the identifier of each task and the maximum stack capacity used by each task, and also stores the execution state when the task is in the run-disabled state and no stack is allocated. Is in the running state, the waiting state, or the runnable state, and the task is in the running state, the runnable state, or the runnable state, the runnable state is set. The execution protection task identifier and the maximum stack capacity used when the execution protection task is in the run-disabled state are stored. The task switching request unit 13 issues a task switching request. Executable task extraction unit 14
When the task switching requesting unit 13 issues a task switching request, the task switching requesting unit 13 searches the task information storage unit 11 and the execution protection task storage unit 12, and is not an execution protection task for any task and is in the execution state. Extracts the identifier of the task that is in the inoperable state. The running task extraction unit 15 changes the running state of the task whose running state is the running state to the runnable state, and the task information storage unit 11
Is extracted to extract the identifier of the task whose task execution state is the running waiting state or the runnable state. When the identifier extracted by the executing task extraction unit 15 is the first identifier and the identifier extracted by the executable task extraction unit 14 is the second identifier, the stack usable task extraction unit 16 performs execution protection. Search the task storage section 12,
A combination of the first identifier and the second identifier, which is the execution protection task of the task corresponding to the second identifier, corresponding to the first identifier is extracted. The stack usable task selection unit 17 searches the execution protection task storage unit 12,
The maximum stack capacity used when the task corresponding to the first identifier in the combination of the first identifier and the second identifier extracted by the stack usable task extraction unit 16 is in the run-disabled state, A combination of the first identifier and the second identifier whose stack capacity currently used by the task corresponding to the first identifier is smaller than the stack capacity is extracted. The stack pointer storage unit 18 stores a task identifier, an execution state, and a stack pointer. The stack data compression unit 19 stores the execution state of the task corresponding to the identifier that can be the execution protection task in the combination of the first identifier and the second identifier extracted by the stack usable task extraction unit 16, into the stack pointer storage unit 18. Stored in the., Change the execution state of the task that can be the execution protection task to the running wait state, compress the data in the stack used by the task that can be the execution protection task, and It is stored in the stack pointer storage unit 18. The stack data expansion unit 20 searches the task information storage unit 11 to extract all the identifiers of the tasks whose execution states are in the running waiting state, and searches the stack pointer storage unit 18 to extract the identifiers extracted from the task information storage unit 11. The stack pointer and execution state of the task corresponding to are extracted, the stack pointer storage unit 18 extracts the stack pointer and the execution state from the data in the stack used by the task, and the stack pointer storage unit 18 extracts the data. The execution state of the task whose stack pointer and execution state are extracted is changed to the execution state extracted from the stack pointer storage unit 18, and the stack pointer and execution state of the task whose stack pointer and execution state are extracted from the stack pointer storage unit 18 And are deleted from the stack pointer storage unit 18. The task switching unit 21 sets the execution state of the task corresponding to the first identifier in the combination of the first identifier and the second identifier extracted by the stack usable task selection unit 17 to the run-disabled state, and the second state. The execution state of the task corresponding to the identifier is set to the running state.

【0019】次に上記スケジューリング装置の動作につ
いて、図7のフローチャートを参照しながら説明する。
先ずタスク切り替え要求部13が、タイマー割り込みな
どによる従来周知の方法により、タスク切り替え要求を
発生する(ステップS11)。次に実行可能タスク抽出
部14が、タスク切り替え要求部13からのタスク切り
替え要求を受けて、タスク情報格納部11および実行保
護タスク格納部12から、いずれのタスクに対しても実
行保護タスクではなく、かつ実行状態が走行不可能状態
であるタスクの識別子を検索し(ステップS12)、候
補となる識別子が見つからなかった場合、処理を終了す
る。候補となる識別子が1つ以上存在すれば、それらを
抽出する(ステップS13)。次に実行中タスク抽出部
15が、実行状態が走行状態であるタスクを走行可能状
態に変更し、タスク情報格納部11から、実行状態が走
行可能状態または走行待ち状態であるタスクの識別子を
検索し(ステップS14)、候補となる識別子が見つか
らなかった場合、処理を終了する。候補となる識別子が
1つ以上存在すれば、それらを抽出する(ステップS1
5)。次にスタック使用可能タスク抽出部16が、実行
保護タスク格納部12から、実行中タスク抽出部15に
より抽出された第1の識別子の候補と実行可能タスク抽
出部14により抽出された第2の識別子の候補とのう
ち、第1の識別子に対応するタスクが第2の識別子に対
応するタスクの実行保護タスクである第1の識別子と第
2の識別子との組合せを検索し(ステップS16)、候
補となる識別子が見つからなかった場合、処理を終了す
る。候補となる識別子が1つ以上存在すれば、それらを
抽出する(ステップS17)。次にスタックデータ圧縮
部19が、スタック使用可能タスク抽出部16により抽
出された識別子の組合せのうち実行保護タスクとなり得
る識別子に対応するタスクの実行状態をスタックポイン
タ格納部18に格納し、実行保護タスクとなり得る識別
子に対応するタスクの実行状態を走行待ち状態に変更
し、実行保護タスクとなり得る識別子に対応するタスク
が使用しているスタック内のデータを圧縮し、実行保護
タスクとなり得る識別子に対応するタスクのスタックポ
インタをスタックポインタ格納部18に格納する(ステ
ップS18)。次にスタック使用可能タスク選択部17
が、スタック使用可能タスク抽出部16により抽出され
てスタックデータ圧縮部19により圧縮された第1の識
別子と第2の識別子との組合せのうち、第1の識別子に
対応するタスクの実行状態が走行不可能状態となる場合
に使用する最大のスタック容量を実行保護タスク格納部
12から取得し、そのスタック容量よりも第1の識別子
に対応するタスクが現在使用しているスタック容量が小
さい組合せを検索し(ステップS19)、候補となる識
別子が見つからなかった場合、処理を終了する。候補と
なる識別子が1つ以上存在すれば、それらを抽出する
(ステップS20)。次にタスク切り替え部21が、ス
タック使用可能タスク選択部17により候補として抽出
された第1の識別子に対応する実行保護タスクの実行状
態を走行不可能状態とし、第2の識別子に対応するタス
クの実行状態を走行状態とし、処理を実行する(ステッ
プS21)。タスク切り替え部21により切り替えられ
たタスクの処理が終了した場合、スタックデータ展開部
20が、タスク情報格納部11から、実行状態が走行待
ち状態であるタスクの識別子を全て抽出し、抽出された
それぞれの識別子に対して、スタックポインタ格納部1
8から識別子に対応するスタックポインタと実行状態と
を抽出し、その識別子に対応するタスクが使用している
スタック内のデータを展開し、そのタスクの実行状態を
スタックポインタ格納部18から抽出した実行状態に変
更し、そのタスクのスタックポインタと実行状態とをス
タックポインタ格納部18から削除する(ステップS2
2)。
Next, the operation of the scheduling device will be described with reference to the flowchart of FIG.
First, the task switching request unit 13 issues a task switching request by a conventionally known method such as timer interruption (step S11). Next, the executable task extracting unit 14 receives the task switching request from the task switching requesting unit 13, and receives a task switching request from the task information storage unit 11 and the execution protection task storage unit 12 and determines that no task is an execution protection task. Also, the identifier of the task whose execution state is the run-disabled state is searched for (step S12), and when the candidate identifier is not found, the process ends. If there are one or more candidate identifiers, they are extracted (step S13). Next, the running task extraction unit 15 changes the task whose running state is the running state to the runnable state, and searches the task information storage unit 11 for the identifier of the task whose running state is the runnable state or the run waiting state. If no candidate identifier is found (step S14), the process ends. If there are one or more candidate identifiers, they are extracted (step S1).
5). Next, the stack usable task extraction unit 16 causes the execution protected task storage unit 12 to extract the first identifier candidate extracted by the executing task extraction unit 15 and the second identifier extracted by the executable task extraction unit 14. Of the candidates, the task corresponding to the first identifier is searched for a combination of the first identifier and the second identifier which is an execution protection task of the task corresponding to the second identifier (step S16), If no identifier is found, the process ends. If there are one or more candidate identifiers, they are extracted (step S17). Next, the stack data compression unit 19 stores, in the stack pointer storage unit 18, the execution state of the task corresponding to the identifier that can be the execution protection task among the combinations of the identifiers extracted by the stack usable task extraction unit 16, and the execution protection is performed. Corresponds to an identifier that can be an execution protection task by changing the execution state of a task that corresponds to an identifier that can be a task to a running wait state and compressing the data in the stack used by the task that corresponds to an identifier that can be an execution protection task The stack pointer of the task to be executed is stored in the stack pointer storage unit 18 (step S18). Next, the stack usable task selection unit 17
Of the combination of the first identifier and the second identifier extracted by the stack usable task extracting unit 16 and compressed by the stack data compressing unit 19, the execution state of the task corresponding to the first identifier runs. The maximum stack capacity to be used when the state becomes impossible is acquired from the execution protection task storage unit 12, and a combination in which the stack capacity currently used by the task corresponding to the first identifier is smaller than the stack capacity is searched for. Then (step S19), if no candidate identifier is found, the process ends. If there are one or more candidate identifiers, they are extracted (step S20). Next, the task switching unit 21 sets the execution state of the execution protection task corresponding to the first identifier extracted as a candidate by the stack usable task selection unit 17 to the run-disabled state, and sets the task corresponding to the second identifier. The execution state is set to the traveling state, and the process is executed (step S21). When the processing of the tasks switched by the task switching unit 21 is completed, the stack data expansion unit 20 extracts from the task information storage unit 11 all the identifiers of the tasks whose execution state is the running waiting state, Stack pointer storage unit 1 for the identifier of
The stack pointer corresponding to the identifier and the execution state are extracted from 8, the data in the stack used by the task corresponding to the identifier is expanded, and the execution state of the task is extracted from the stack pointer storage unit 18 State, and the stack pointer and execution state of the task are deleted from the stack pointer storage unit 18 (step S2).
2).

【0020】次に、上記スケジューリング装置のさらに
具体的な動作の一例について説明する。図8はタスク情
報格納部11に格納されている内容の概念図で、識別子
1のタスクの実行状態は走行状態、識別子2のタスクの
実行状態は走行不可能状態、識別子3のタスクの実行状
態は走行待ち状態である。なお、タスク情報格納部11
に格納されている実行状態は、タスクの実行状態の変化
に伴って適宜変更される。
Next, an example of a more specific operation of the scheduling device will be described. FIG. 8 is a conceptual diagram of the contents stored in the task information storage unit 11. The execution state of the task with the identifier 1 is the running state, the execution state of the task with the identifier 2 is the run-disabled state, and the execution state of the task with the identifier 3 is Is waiting to run. The task information storage unit 11
The execution state stored in is changed as the task execution state changes.

【0021】図9は実行保護タスク格納部12に格納さ
れている内容の概念図で、識別子1のタスクが使用する
最大のスタック容量は50であり、対応する実行保護タ
スクはない。識別子2のタスクが使用する最大のスタッ
ク容量は50であり、対応する実行保護タスクの識別子
は1である。本実施例の場合識別子2のタスクに対応す
る実行保護タスクの識別子が1であるということは、識
別子2のタスクが走行可能状態、走行待ち状態、走行状
態のいずれかの状態になるためには、識別子1のタスク
が使用するスタック容量が35以下でなければならない
ということである。識別子3のタスクが使用する最大の
スタック容量は70であり、対応する実行保護タスクは
ない。
FIG. 9 is a conceptual diagram of the contents stored in the execution protection task storage unit 12. The maximum stack capacity used by the task with the identifier 1 is 50, and there is no corresponding execution protection task. The maximum stack capacity used by the task with the identifier 2 is 50, and the identifier of the corresponding execution protection task is 1. In the case of the present embodiment, the identifier of the execution protection task corresponding to the task of the identifier 2 is 1, which means that the task of the identifier 2 is in any of the runnable state, the run wait state, and the run state. That is, the stack capacity used by the task with identifier 1 must be 35 or less. The maximum stack capacity used by the task with identifier 3 is 70, and there is no corresponding execution protection task.

【0022】ここで、データ圧縮の一例を示す。例えば
8ビットのマイクロコンピュータで、プログラムが4キ
ロバイト以内である場合、2バイトをスタックとして使
用する。スタック内で実際に使用するのは12ビットで
あるため、4ビットは不要である。そこで、4ビット分
を削除する。上述の圧縮方法により、スタックが5回積
まれたと考えると、(12×5+4)/16×5=0.
8という計算より、圧縮しない場合の8割の容量に圧縮
される。
Here, an example of data compression will be shown. For example, in an 8-bit microcomputer, if the program is within 4 kilobytes, 2 bytes are used as a stack. Since 4 bits are actually used in the stack, 4 bits are unnecessary. Therefore, 4 bits are deleted. Considering that the stack has been stacked five times by the compression method described above, (12 × 5 + 4) / 16 × 5 = 0.
From the calculation of 8, the capacity is compressed to 80% of the capacity without compression.

【0023】いま、走行状態である識別子1が使用して
いるスタック容量は40であるとする。先ずタスク切り
替え要求部13が、タスク切り替え要求を発生し、実行
可能タスク抽出部14に渡す。これにより実行可能タス
ク抽出部14が、タスク情報格納部11と実行保護タス
ク格納部12とから、タスク情報格納部11に格納され
ている識別子に対応するいずれのタスクに対しても実行
保護タスクではなく、かつ実行状態が走行不可能状態で
あるタスクの識別子を抽出する。抽出した結果、識別子
2が候補となる。次に実行中タスク抽出部15が、実行
状態が走行状態であるタスクを走行可能状態に変更し、
タスク情報格納部11に格納されているタスクの実行状
態が走行待ち状態または走行可能状態であるタスクの識
別子を抽出する。抽出した結果、識別子1と識別子3と
が候補となる。次にスタック使用可能タスク抽出部16
が、実行中タスク抽出部15によって抽出された識別子
1または識別子3に対応する実行保護タスクの識別子
を、実行保護タスク格納部12から抽出し、実行可能タ
スク抽出部14によって抽出された識別子2と照合す
る。抽出した結果、識別子1と識別子2との組み合わせ
が候補として抽出される。次にスタックデータ圧縮部1
9が、スタック使用可能タスク抽出部16によって抽出
された識別子1と識別子2との組合せにおいて、実行保
護タスクとなり得る識別子1に対応するタスクの実行状
態をスタックポインタ格納部18に格納し、識別子1に
対応するタスクの実行状態を走行待ち状態に変更し、識
別子1に対応するタスクが使用しているスタック内のデ
ータを圧縮し、識別子1に対応するタスクのスタックポ
インタをスタックポインタ格納部18に格納する。かく
して、タスク情報格納部11の内容は図10のようにな
り、スタックポインタ格納部18の内容は図11のよう
になる。すなわち本実施例の場合、スタックポインタは
100である。またスタック内のデータを圧縮した結
果、識別子1に対応するタスクが使用しているスタック
容量は80%に圧縮され、32となる。次にスタック使
用可能タスク選択部17が、スタック使用可能タスク抽
出部16によって抽出された組合せより、実行保護タス
クとなり得る識別子1に対応するタスクが走行不可能状
態となる場合に使用する最大のスタック容量を実行保護
タスク格納部12から抽出し、35を得る。さらに、ス
タック使用可能タスク選択部が、識別子1に対応するタ
スクが使用しているスタック容量を従来周知の方法によ
り抽出し、32を得る。この結果、32は35以下であ
るので、識別子1と識別子2との組合せが候補として抽
出される。次にタスク切り替え部21が、スタック使用
可能タスク選択部17によって抽出された識別子1のタ
スクを走行不可能状態とし、識別子2のタスクを走行状
態とし、識別子1のタスクが使用していたスタックを使
用して識別子2のタスクを実行する。かくしてタスク情
報格納部11の内容は図12のようになる。タスク切り
替え部21により切り替えられたタスクの処理が終了し
た場合、スタックデータ展開部20が、タスク情報格納
部11から実行状態が走行待ち状態であるタスクの識別
子を全て抽出する。切り替えられたタスクの処理が終了
した直後のタスク情報格納部11の内容は図13のよう
になっている。抽出した結果、識別子1と識別子3とが
候補となる。抽出されたそれぞれの識別子に対して、ス
タックポインタ格納部18より、抽出された識別子と同
一の識別子に対応するスタックポインタと実行状態とを
抽出する。抽出した結果、識別子1のスタックポインタ
は100、実行状態は走行可能状態であり、識別子3
は、該当するスタックポインタおよび実行状態はない。
この抽出結果より、識別子1に対応するタスクが使用し
ているスタック内のデータを展開し、識別子1に対応す
るタスクの実行状態を走行可能状態に変更し、識別子1
に対応するタスクのスタックポインタと以前の実行状態
とをスタックポインタ格納部18から削除する。かくし
てタスク情報格納部11の内容は図14のようになり、
スタックポインタ格納部18の内容は図15のようにな
る。
Now, it is assumed that the stack capacity used by the running identifier 1 is 40. First, the task switching request unit 13 generates a task switching request and passes it to the executable task extraction unit 14. As a result, the executable task extraction unit 14 determines that the execution protection task does not execute any task corresponding to the identifier stored in the task information storage unit 11 from the task information storage unit 11 and the execution protection task storage unit 12. An identifier of a task that is not present and whose execution state is in the run-disabled state is extracted. As a result of the extraction, the identifier 2 becomes a candidate. Next, the executing task extraction unit 15 changes the task whose execution state is the running state to the runnable state,
An identifier of a task whose task execution state stored in the task information storage unit 11 is a running waiting state or a runnable state is extracted. As a result of the extraction, the identifiers 1 and 3 are candidates. Next, the stack usable task extraction unit 16
Extracts the identifier of the execution protection task corresponding to the identifier 1 or the identifier 3 extracted by the running task extraction unit 15 from the execution protection task storage unit 12, and the identifier 2 extracted by the executable task extraction unit 14 Collate. As a result of the extraction, the combination of the identifier 1 and the identifier 2 is extracted as a candidate. Next, the stack data compression unit 1
9 stores, in the stack pointer storage unit 18, the execution state of the task corresponding to the identifier 1 that can be the execution protection task in the combination of the identifier 1 and the identifier 2 extracted by the stack usable task extraction unit 16. The execution state of the task corresponding to the identifier is changed to the running wait state, the data in the stack used by the task corresponding to the identifier 1 is compressed, and the stack pointer of the task corresponding to the identifier 1 is stored in the stack pointer storage unit 18. Store. Thus, the contents of the task information storage unit 11 are as shown in FIG. 10, and the contents of the stack pointer storage unit 18 are as shown in FIG. That is, in the case of this embodiment, the stack pointer is 100. As a result of compressing the data in the stack, the stack capacity used by the task corresponding to the identifier 1 is compressed to 80% and becomes 32. Next, the stack usable task selection unit 17 uses the maximum stack that is used when the task corresponding to the identifier 1 that can be an execution protection task is in the run-disabled state based on the combination extracted by the stack usable task extraction unit 16. The capacity is extracted from the execution protection task storage unit 12, and 35 is obtained. Furthermore, the stack usable task selection unit extracts the stack capacity used by the task corresponding to the identifier 1 by a conventionally known method, and obtains 32. As a result, since 32 is 35 or less, the combination of identifier 1 and identifier 2 is extracted as a candidate. Next, the task switching unit 21 puts the task with the identifier 1 extracted by the stack available task selection unit 17 into the non-running state, sets the task with the identifier 2 into the running state, and sets the stack used by the task with the identifier 1 to the stack. Use to perform the task with identifier 2. Thus, the contents of the task information storage unit 11 are as shown in FIG. When the processing of the task switched by the task switching unit 21 is completed, the stack data expansion unit 20 extracts from the task information storage unit 11 all the identifiers of the tasks whose execution state is the running waiting state. The contents of the task information storage unit 11 immediately after the processing of the switched task is completed are as shown in FIG. As a result of the extraction, the identifiers 1 and 3 are candidates. For each of the extracted identifiers, the stack pointer storage unit 18 extracts the stack pointer and the execution state corresponding to the same identifier as the extracted identifier. As a result of the extraction, the stack pointer of the identifier 1 is 100, the execution state is the runnable state, and the identifier 3
Has no corresponding stack pointer and execution state.
Based on the extraction result, the data in the stack used by the task corresponding to the identifier 1 is expanded, the execution state of the task corresponding to the identifier 1 is changed to the runnable state, and the identifier 1
The stack pointer of the task corresponding to and the previous execution state are deleted from the stack pointer storage unit 18. Thus, the contents of the task information storage unit 11 are as shown in FIG.
The contents of the stack pointer storage unit 18 are as shown in FIG.

【0024】このように、実行可能なタスクとスタック
を使用することができる別のタスクとの組合せを選択で
きるので、スタックの有効利用を図ることができ、スタ
ックの容量が少ない場合にはスケジューリングできない
という従来の問題を良好に低減できる。また、実行可能
なタスクとスタックを使用することができる別のタスク
との組合せの範囲を広げることができるので、スタック
をより一層有効利用できる。
As described above, since a combination of an executable task and another task that can use the stack can be selected, the stack can be effectively used and scheduling cannot be performed when the stack capacity is small. The above-mentioned conventional problem can be favorably reduced. Also, the range of combinations of executable tasks and other tasks that can use the stack can be expanded, so that the stack can be used more effectively.

【0025】なお上記具体例においては、スタック使用
可能タスク選択部17により候補として抽出される識別
子の組み合わせが1組である例について説明したが、複
数の組み合わせが抽出される場合も考えられる。この場
合、抽出された識別子の組み合わせの中から、任意の1
つの組み合わせを選択する。またスタックのデータの圧
縮方法は、上記具体例で説明した方法に限られるもので
はなく、例えば適応型レンペル・ジブ・コーディング法
など、他の方法を用いてもよい。
In the above specific example, an example in which the combination of the identifiers extracted as candidates by the stack usable task selection unit 17 is one set has been described, but it is also possible that a plurality of combinations are extracted. In this case, any one of the extracted combinations of identifiers
Choose one combination. The method of compressing the data in the stack is not limited to the method described in the above specific example, and other methods such as the adaptive Lempel-Jib coding method may be used.

【0026】[0026]

【発明の効果】以上説明したように本発明によれば、走
行可能状態と走行待ち状態と走行状態と走行不可能状態
との少なくとも4つの実行状態とシステム内で一意の識
別子とを持つタスクが、タスク切り替えにより複数個実
行されるシステムにおけるスケジューリング装置であっ
て、各タスクの識別子と実行状態とを格納するタスク情
報格納部と、各タスクの識別子と各タスクが使用する最
大のスタック容量とを格納すると共に、タスクの実行状
態が走行不可能状態でありかつスタックが割り当てられ
ていない場合に実行状態が走行状態か走行待ち状態か走
行可能状態かのいずれかの状態となり、かつタスクの実
行状態が走行状態か走行待ち状態か走行可能状態かのい
ずれかの状態である場合に走行不可能状態となる実行保
護タスクの識別子と、実行保護タスクが走行不可能状態
となる場合に使用する最大のスタック容量とを格納する
実行保護タスク格納部と、タスクの切り替え要求を発生
するタスク切り替え要求部と、タスク切り替え要求部が
タスク切り替え要求を発生したときに、タスク情報格納
部と実行保護タスク格納部とを検索して、いずれのタス
クに対しても実行保護タスクではなくかつ実行状態が走
行不可能状態であるタスクの識別子を抽出する実行可能
タスク抽出部と、タスクの実行状態が走行状態であるタ
スクの実行状態を走行可能状態に変更し、タスク情報格
納部を検索してタスクの実行状態が走行待ち状態または
走行可能状態であるタスクの識別子を抽出する実行中タ
スク抽出部と、実行中タスク抽出部により抽出された識
別子を第1の識別子とし、実行可能タスク抽出部により
抽出された識別子を第2の識別子としたときに、実行保
護タスク格納部を検索して、第1の識別子に対応するタ
スクが第2の識別子に対応するタスクの実行保護タスク
である第1の識別子と第2の識別子との組合せを抽出す
るスタック使用可能タスク抽出部と、実行保護タスク格
納部を検索して、スタック使用可能タスク抽出部により
抽出された第1の識別子と第2の識別子との組合せにお
ける第1の識別子に対応するタスクが実行不可能状態と
なる場合に使用する最大のスタック容量を得、そのスタ
ック容量よりも第1の識別子に対応するタスクが現在使
用しているスタック容量が小さい第1の識別子と第2の
識別子との組合せを抽出するスタック使用可能タスク選
択部と、スタック使用可能タスク選択部により抽出され
た第1の識別子と第2の識別子との組合せにおける第1
の識別子に対応するタスクの実行状態を走行不可能状態
にし、第2の識別子に対応するタスクの実行状態を走行
状態にするタスク切り替え部と、を備えたので、実行可
能なタスクとスタックを使用することができる別のタス
クとの組合せを選択できることから、スタックの有効利
用を図ることができ、スタックの容量が少ない場合には
スケジューリングできないという従来の問題を良好に低
減できる。
As described above, according to the present invention, a task having at least four execution states of a runnable state, a run wait state, a runnable state and a runnable state and a unique identifier in the system is provided. , A scheduling device in a system in which a plurality of tasks are executed by task switching, and a task information storage unit that stores an identifier and an execution state of each task, an identifier of each task, and a maximum stack capacity used by each task. In addition to storing, if the task is in the run-disabled state and no stack is allocated, the run-state is either the run-state, the run-wait state or the run-ready state, and the task-run state The identifier of the execution protection task that will be in the run-disabled state if is in the running state, the run-waiting state, or the runnable state , The execution protection task storage unit that stores the maximum stack capacity used when the execution protection task is in the run-disabled state, the task switching request unit that issues a task switching request, and the task switching request unit When a request is issued, the task information storage unit and the execution protection task storage unit are searched to extract the identifier of a task that is not an execution protection task and whose execution state is not runnable for any task. Executable task extractor to change the task's execution state to the runnable state and the task information storage section to search the task's runnable state Executable by extracting the identifier of a certain task from the running task extractor and the identifier extracted by the running task extractor as the first identifier When the identifier extracted by the task extraction unit is used as the second identifier, the execution protection task storage unit is searched and the task corresponding to the first identifier is the execution protection task of the task corresponding to the second identifier. A stack usable task extraction unit that extracts a combination of a certain first identifier and a second identifier and an execution protection task storage unit are searched, and the first identifier and the first identifier extracted by the stack usable task extraction unit are searched. The maximum stack capacity to be used when the task corresponding to the first identifier in the combination with the identifier of 2 becomes the inexecutable state, and the task corresponding to the first identifier than the stack capacity is currently used. The stack available task selection unit that extracts a combination of the first identifier and the second identifier that has a small stack capacity, and the stack available task selection unit extracts the combination. The first in the combination of the first identifier and the second identifier
The task switching unit that sets the execution state of the task corresponding to the identifier of No. 1 to the run-disabled state and the task corresponding to the second identifier to the running state, and uses the executable task and stack. Since a combination with another task that can be performed can be selected, the stack can be effectively used, and the conventional problem that scheduling cannot be performed when the stack capacity is small can be favorably reduced.

【0027】また、走行可能状態と走行待ち状態と走行
状態と走行不可能状態との少なくとも4つの実行状態と
システム内で一意の識別子とを持つタスクが、タスク切
り替えにより複数個実行されるシステムにおけるスケジ
ューリング装置であって、各タスクの識別子と実行状態
とを格納するタスク情報格納部と、各タスクの識別子と
各タスクが使用する最大のスタック容量とを格納すると
共に、タスクの実行状態が走行不可能状態でありかつス
タックが割り当てられていない場合に実行状態が走行状
態か走行待ち状態か走行可能状態かのいずれかの状態と
なり、かつタスクの実行状態が走行状態か走行待ち状態
か走行可能状態かのいずれかの状態である場合に走行不
可能状態となる実行保護タスクの識別子と、実行保護タ
スクが走行不可能状態となる場合に使用する最大のスタ
ック容量とを格納する実行保護タスク格納部と、タスク
の識別子と実行状態とスタックポインタとを格納するス
タックポインタ格納部と、タスクの切り替え要求を発生
するタスク切り替え要求部と、タスク切り替え要求部が
タスク切り替え要求を発生したときに、タスク情報格納
部と実行保護タスク格納部とを検索して、いずれのタス
クに対しても実行保護タスクではなくかつ実行状態が走
行不可能状態であるタスクの識別子を抽出する実行可能
タスク抽出部と、タスクの実行状態が走行状態であるタ
スクの実行状態を走行可能状態に変更し、タスク情報格
納部を検索してタスクの実行状態が走行待ち状態または
走行可能状態であるタスクの識別子を抽出する実行中タ
スク抽出部と、実行中タスク抽出部により抽出された識
別子を第1の識別子とし、実行可能タスク抽出部により
抽出された識別子を第2の識別子としたときに、実行保
護タスク格納部を検索して、第1の識別子に対応するタ
スクが第2の識別子に対応するタスクの実行保護タスク
である第1の識別子と第2の識別子との組合せを抽出す
るスタック使用可能タスク抽出部と、スタック使用可能
タスク抽出部により抽出された第1の識別子と第2の識
別子との組合せにおいて実行保護タスクとなり得る識別
子に対応するタスクの実行状態をスタックポインタ格納
部に格納し、実行保護タスクとなり得るタスクの実行状
態を走行待ち状態に変更し、実行保護タスクとなり得る
タスクが使用しているスタック内のデータを圧縮し、実
行保護タスクとなり得るタスクのスタックポインタをス
タックポインタ格納部に格納するスタックデータ圧縮部
と、実行保護タスク格納部を検索して、スタック使用可
能タスク抽出部により抽出された第1の識別子と第2の
識別子との組合せにおける第1の識別子に対応するタス
クが実行不可能状態となる場合に使用する最大のスタッ
ク容量を得、そのスタック容量よりも第1の識別子に対
応するタスクが現在使用しているスタック容量が小さい
第1の識別子と第2の識別子との組合せを抽出するスタ
ック使用可能タスク選択部と、スタック使用可能タスク
選択部により抽出された第1の識別子と第2の識別子と
の組合せにおける第1の識別子に対応するタスクの実行
状態を走行不可能状態にし、第2の識別子に対応するタ
スクの実行状態を走行状態にするタスク切り替え部と、
タスク情報格納部を検索して実行状態が走行待ち状態で
あるタスクの識別子を全て抽出し、スタックポインタ格
納部を検索してタスク情報格納部から抽出した識別子に
対応するタスクのスタックポインタと実行状態とを抽出
し、スタックポインタ格納部からスタックポインタと実
行状態とを抽出したタスクが使用しているスタック内の
データを展開し、スタックポインタ格納部からスタック
ポインタと実行状態とを抽出したタスクの実行状態をス
タックポインタ格納部から抽出した実行状態に変更し、
スタックポインタ格納部からスタックポインタと実行状
態とを抽出したタスクのスタックポインタと実行状態と
をスタックポインタ格納部から削除するスタックデータ
展開部と、を備えたので、実行可能なタスクとスタック
を使用することができる別のタスクとの組合せを選択で
きることから、スタックの有効利用を図ることができ、
スタックの容量が少ない場合にはスケジューリングでき
ないという従来の問題を良好に低減できる。さらに、実
行可能なタスクとスタックを使用することができる別の
タスクとの組合せの範囲を広げることができることか
ら、スタックをより一層有効利用できる。
Further, in a system in which a plurality of tasks having at least four execution states of a runnable state, a run wait state, a runnable state and a runnable state and a unique identifier in the system are executed by task switching. A scheduling device, which stores a task information storage unit that stores an identifier and an execution state of each task, stores an identifier of each task and a maximum stack capacity used by each task, and stores the execution state of the task. If the task is in the runnable state and no stack is allocated, the execution state is either the running state, the run-waiting state, or the runnable state, and the task execution state is the runnable state, the run-waiting state, or the runnable state. If either of the above states is set, the identifier of the execution protection task that cannot run and the execution protection task cannot run State, the execution protection task storage unit that stores the maximum stack capacity that is used when the status becomes a state, the stack pointer storage unit that stores the task identifier, the execution status, and the stack pointer, and the task switching that generates the task switching request. When the request part and the task switching request part generate a task switching request, the task information storage part and the execution protection task storage part are searched, and neither of the tasks is an execution protection task and the execution status is Executable task extraction unit that extracts the identifier of the task that is in the non-runnable state, and the execution state of the task whose running state is the running state is changed to the runnable state, and the task information storage unit is searched to search for the task An executing task extracting unit that extracts an identifier of a task whose execution state is a running waiting state or a runnable state, and an executing task extracting unit When the extracted identifier is used as the first identifier and the identifier extracted by the executable task extraction unit is used as the second identifier, the execution protection task storage unit is searched and the task corresponding to the first identifier is searched. Is a stack usable task extraction unit that extracts a combination of the first identifier and the second identifier that is the execution protection task of the task corresponding to the second identifier, and the first task extracted by the stack usable task extraction unit The execution state of the task corresponding to the identifier that can be the execution protection task in the combination of the identifier of No. 2 and the second identifier is stored in the stack pointer storage unit, and the execution state of the task that can be the execution protection task is changed to the running waiting state The data in the stack used by the task that can be the execution protection task is compressed, and the stack pointer of the task that can be the execution protection task is saved. A first identifier in a combination of the first identifier and the second identifier extracted by the stack usable task extraction unit by searching the stack data compression unit to be stored in the tack pointer storage unit and the execution protection task storage unit. The maximum stack capacity used when the task corresponding to is in the non-executable state, and the stack capacity currently used by the task corresponding to the first identifier is smaller than that stack capacity A stack usable task selection unit that extracts a combination with the second identifier, and a task corresponding to the first identifier in the combination of the first identifier and the second identifier extracted by the stack usable task selection unit A task switching unit that sets the execution state to the run-disabled state and sets the execution state of the task corresponding to the second identifier to the run state;
The task information storage unit is searched to extract all the identifiers of the tasks whose execution status is waiting to run, the stack pointer storage unit is searched, and the stack pointer and execution status of the task corresponding to the identifier extracted from the task information storage unit Extract the and extract the stack pointer and execution state from the stack pointer storage, expand the data in the stack used by the task, and execute the task that extracted the stack pointer and execution state from the stack pointer storage. Change the state to the execution state extracted from the stack pointer storage,
Since a stack data decompression unit that deletes the stack pointer and execution state of a task that has extracted the stack pointer and execution state from the stack pointer storage unit from the stack pointer storage unit, an executable task and stack are used. Since you can select a combination with another task that can
The conventional problem that scheduling is not possible when the stack capacity is small can be reduced satisfactorily. Further, since the range of combinations of executable tasks and other tasks that can use the stack can be expanded, the stack can be used more effectively.

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

【図1】本発明の実施例1におけるスケジューリング装
置の構成図である。
FIG. 1 is a configuration diagram of a scheduling device according to a first embodiment of the present invention.

【図2】本発明の実施例1におけるスケジューリング装
置の動作を説明するフローチャートである。
FIG. 2 is a flowchart illustrating an operation of the scheduling device according to the first exemplary embodiment of the present invention.

【図3】タスク切り替え前におけるタスク情報格納部の
内容の概念図である。
FIG. 3 is a conceptual diagram of contents of a task information storage unit before task switching.

【図4】実行保護タスク格納部の内容の概念図である。FIG. 4 is a conceptual diagram of contents of an execution protection task storage unit.

【図5】タスク切り替え後におけるタスク情報格納部の
内容の概念図である。
FIG. 5 is a conceptual diagram of contents of a task information storage unit after task switching.

【図6】本発明の実施例2におけるスケジューリング装
置の構成図である。
FIG. 6 is a configuration diagram of a scheduling device according to a second embodiment of the present invention.

【図7】本発明の実施例2におけるスケジューリング装
置の動作を説明するフローチャートである。
FIG. 7 is a flowchart illustrating an operation of the scheduling device according to the second exemplary embodiment of the present invention.

【図8】タスク切り替え前におけるタスク情報格納部の
内容の概念図である。
FIG. 8 is a conceptual diagram of contents of a task information storage unit before task switching.

【図9】実行保護タスク格納部の内容の概念図である。FIG. 9 is a conceptual diagram of contents of an execution protection task storage unit.

【図10】タスク切り替え前におけるタスク情報格納部
の内容の概念図である。
FIG. 10 is a conceptual diagram of contents of a task information storage unit before task switching.

【図11】スタックポインタ格納部の内容の概念図であ
る。
FIG. 11 is a conceptual diagram of contents of a stack pointer storage unit.

【図12】タスク切り替え後におけるタスク情報格納部
の内容の概念図である。
FIG. 12 is a conceptual diagram of contents of a task information storage unit after task switching.

【図13】切り替えられたタスクの処理が終了した直後
におけるタスク情報格納部の内容の概念図である。
FIG. 13 is a conceptual diagram of contents of a task information storage unit immediately after processing of a switched task is completed.

【図14】処理終了後におけるタスク情報格納部の内容
の概念図である。
FIG. 14 is a conceptual diagram of contents of a task information storage unit after processing is completed.

【図15】処理終了後におけるスタックポインタ格納部
の内容の概念図である。
FIG. 15 is a conceptual diagram of contents of a stack pointer storage unit after processing is completed.

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

1 タスク情報格納部 2 実行保護タスク格納部 3 タスク切り替え要求部 4 実行可能タスク抽出部 5 実行中タスク抽出部 6 スタック使用可能タスク抽出部 7 スタック使用可能タスク選択部 8 タスク切り替え部 11 タスク情報格納部 12 実行保護タスク格納部 13 タスク切り替え要求部 14 実行可能タスク抽出部 15 実行中タスク抽出部 16 スタック使用可能タスク抽出部 17 スタック使用可能タスク選択部 18 スタックポインタ格納部 19 スタックデータ圧縮部 20 スタックデータ展開部 21 タスク切り替え部 1 task information storage unit 2 execution protection task storage unit 3 task switching request unit 4 executable task extraction unit 5 running task extraction unit 6 stack available task extraction unit 7 stack available task selection unit 8 task switching unit 11 task information storage Part 12 Execution protection task storage part 13 Task switching request part 14 Executable task extraction part 15 Executing task extraction part 16 Stack available task extraction part 17 Stack available task selection part 18 Stack pointer storage part 19 Stack data compression part 20 Stack Data development unit 21 Task switching unit

───────────────────────────────────────────────────── フロントページの続き (72)発明者 安武 剛一 大阪府門真市大字門真1006番地 松下電 器産業株式会社内 (72)発明者 伊藤 謙次 大阪府門真市大字門真1006番地 松下電 器産業株式会社内 (72)発明者 安倍 秀二 大阪府門真市大字門真1006番地 松下電 器産業株式会社内 ─────────────────────────────────────────────────── ─── Continuation of the front page (72) Inventor Goichi Anbu 1006 Kadoma, Kadoma City, Osaka Prefecture Matsushita Electric Industrial Co., Ltd. (72) Kenji Ito, 1006 Kadoma, Kadoma City, Osaka Matsushita Electric Industrial Co., Ltd. (72) Inventor Shuji Abe 1006 Kadoma, Kadoma City, Osaka Prefecture Matsushita Electric Industrial Co., Ltd.

Claims (4)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 走行可能状態と走行待ち状態と走行状態
と走行不可能状態との少なくとも4つの実行状態とシス
テム内で一意の識別子とを持つタスクが、タスク切り替
えにより複数個実行されるシステムにおけるスケジュー
リング方法であって、各タスクの識別子と実行状態とを
格納するタスク情報格納部と、各タスクの識別子と各タ
スクが使用する最大のスタック容量とを格納すると共
に、タスクの実行状態が走行不可能状態でありかつスタ
ックが割り当てられていない場合に実行状態が走行状態
か走行待ち状態か走行可能状態かのいずれかの状態とな
り、かつタスクの実行状態が走行状態か走行待ち状態か
走行可能状態かのいずれかの状態である場合に走行不可
能状態となる実行保護タスクの識別子と、前記実行保護
タスクが走行不可能状態となる場合に使用する最大のス
タック容量とを格納する実行保護タスク格納部とを用
い、 タスクの切り替え要求を発生するタスク切り替え要求ス
テップと、 前記タスク切り替え要求ステップにおいてタスク切り替
え要求が発生されることにより、前記タスク情報格納部
と前記実行保護タスク格納部とを検索して、いずれのタ
スクに対しても実行保護タスクではなくかつ実行状態が
走行不可能状態であるタスクの識別子を抽出する実行可
能タスク抽出ステップと、 タスクの実行状態が走行状態であるタスクの実行状態を
走行可能状態に変更し、前記タスク情報格納部を検索し
てタスクの実行状態が走行待ち状態または走行可能状態
であるタスクの識別子を抽出する実行中タスク抽出ステ
ップと、 前記実行中タスク抽出ステップにおいて抽出された識別
子を第1の識別子とし、前記実行可能タスク抽出ステッ
プにおいて抽出された識別子を第2の識別子としたとき
に、前記実行保護タスク格納部を検索して、前記第1の
識別子に対応するタスクが前記第2の識別子に対応する
タスクの実行保護タスクである第1の識別子と第2の識
別子との組合せを抽出するスタック使用可能タスク抽出
ステップと、 前記実行保護タスク格納部を検索して、前記スタック使
用可能タスク抽出ステップにおいて抽出された第1の識
別子と第2の識別子との組合せにおける第1の識別子に
対応するタスクが実行不可能状態となる場合に使用する
最大のスタック容量を得、そのスタック容量よりも前記
第1の識別子に対応するタスクが現在使用しているスタ
ック容量が小さい第1の識別子と第2の識別子との組合
せを抽出するスタック使用可能タスク選択ステップと、 前記スタック使用可能タスク選択ステップにおいて抽出
された第1の識別子と第2の識別子との組合せにおける
第1の識別子に対応するタスクの実行状態を走行不可能
状態にし、第2の識別子に対応するタスクの実行状態を
走行状態にするタスク切り替えステップと、 を実行することを特徴とするスケジューリング方法。
1. A system in which a plurality of tasks having at least four execution states of a runnable state, a run waiting state, a runnable state and a runnable state and a unique identifier in the system are executed by task switching A scheduling method, in which a task information storage unit that stores an identifier and an execution state of each task, an identifier of each task and the maximum stack capacity used by each task are stored, and the execution state of the task is not run. If the task is in the runnable state and no stack is allocated, the execution state is either the running state, the run-waiting state, or the runnable state, and the task execution state is the runnable state, the run-waiting state, or the runnable state. Of the execution protection task that is in the run-disabled state when either of the A task switching request step for issuing a task switching request, and a task switching request is generated in the task switching request step, using the execution protection task storage unit that stores the maximum stack capacity used when By doing so, the task information storage unit and the execution protection task storage unit are searched, and an identifier of a task which is not an execution protection task and whose execution state is in the run-disabled state for any task is executed. Available task extraction step and task execution state is running state Change the task running state to runnable state, search the task information storage unit, and the task execution state is run waiting state or runnable state An executing task extracting step of extracting a task identifier, and extracting in the executing task extracting step When the generated identifier is used as the first identifier and the identifier extracted in the executable task extraction step is used as the second identifier, the execution protection task storage unit is searched to correspond to the first identifier. A stack usable task extracting step of extracting a combination of a first identifier and a second identifier, which is an execution protection task of a task corresponding to the second identifier, and searching the execution protection task storage unit. , Obtaining the maximum stack capacity used when the task corresponding to the first identifier in the combination of the first identifier and the second identifier extracted in the stack usable task extraction step is in the inexecutable state A first identifier and a second identifier whose stack capacity currently used by the task corresponding to the first identifier is smaller than the stack capacity. A stack usable task selecting step for extracting a combination of the first and second identifiers in the stack usable task selecting step, and the task execution state corresponding to the first identifier in the combination of the first identifier and the second identifier extracted. And a task switching step of changing the execution state of the task corresponding to the second identifier to the running state, and executing the task switching step.
【請求項2】 走行可能状態と走行待ち状態と走行状態
と走行不可能状態との少なくとも4つの実行状態とシス
テム内で一意の識別子とを持つタスクが、タスク切り替
えにより複数個実行される計算機システムにおけるスケ
ジューリング装置であって、 各タスクの識別子と実行状態とを格納するタスク情報格
納部と、 各タスクの識別子と各タスクが使用する最大のスタック
容量とを格納すると共に、タスクの実行状態が走行不可
能状態でありかつスタックが割り当てられていない場合
に実行状態が走行状態か走行待ち状態か走行可能状態か
のいずれかの状態となり、かつタスクの実行状態が走行
状態か走行待ち状態か走行可能状態かのいずれかの状態
である場合に走行不可能状態となる実行保護タスクの識
別子と、前記実行保護タスクが走行不可能状態となる場
合に使用する最大のスタック容量とを格納する実行保護
タスク格納部と、 タスクの切り替え要求を発生するタスク切り替え要求部
と、 前記タスク切り替え要求部がタスク切り替え要求を発生
したときに、前記タスク情報格納部と前記実行保護タス
ク格納部とを検索して、いずれのタスクに対しても実行
保護タスクではなくかつ実行状態が走行不可能状態であ
るタスクの識別子を抽出する実行可能タスク抽出部と、 タスクの実行状態が走行状態であるタスクの実行状態を
走行可能状態に変更し、前記タスク情報格納部を検索し
てタスクの実行状態が走行待ち状態または走行可能状態
であるタスクの識別子を抽出する実行中タスク抽出部
と、 前記実行中タスク抽出部により抽出された識別子を第1
の識別子とし、前記実行可能タスク抽出部により抽出さ
れた識別子を第2の識別子としたときに、前記実行保護
タスク格納部を検索して、前記第1の識別子に対応する
タスクが前記第2の識別子に対応するタスクの実行保護
タスクである第1の識別子と第2の識別子との組合せを
抽出するスタック使用可能タスク抽出部と、 前記実行保護タスク格納部を検索して、前記スタック使
用可能タスク抽出部により抽出された第1の識別子と第
2の識別子との組合せにおける第1の識別子に対応する
タスクが実行不可能状態となる場合に使用する最大のス
タック容量を得、そのスタック容量よりも前記第1の識
別子に対応するタスクが現在使用しているスタック容量
が小さい第1の識別子と第2の識別子との組合せを抽出
するスタック使用可能タスク選択部と、 前記スタック使用可能タスク選択部により抽出された第
1の識別子と第2の識別子との組合せにおける第1の識
別子に対応するタスクの実行状態を走行不可能状態に
し、第2の識別子に対応するタスクの実行状態を走行状
態にするタスク切り替え部と、 を備えたことを特徴とするスケジューリング装置。
2. A computer system in which a plurality of tasks having at least four execution states of a runnable state, a run waiting state, a runnable state and a runnable state and a unique identifier in the system are executed by task switching. And a task information storage unit that stores an identifier and an execution state of each task, an identifier of each task and a maximum stack capacity used by each task, and a running state of the task. If the task is in the impossible state and the stack is not allocated, the execution state is either the running state, the waiting state or the runnable state, and the task execution state is the running state, the waiting state, or the runnable state. The identifier of the execution protection task that is in the run-disabled state if any of the states and the execution protection task is running. The execution protection task storage unit that stores the maximum stack capacity used when the status becomes ready, the task switching request unit that issues a task switching request, and the task switching request unit when the task switching request is issued. An executable task that searches the task information storage unit and the execution protection task storage unit and extracts an identifier of a task that is not an execution protection task for any task and whose execution state is a non-runnable state The extraction unit and the task execution state is the running state. The task execution state is changed to the runnable state, the task information storage unit is searched, and the task execution state of the task waiting state or runnable state is searched. A running task extracting unit that extracts an identifier, and an identifier extracted by the running task extracting unit
And the identifier extracted by the executable task extraction unit is used as the second identifier, the execution protection task storage unit is searched to find the task corresponding to the first identifier as the second identifier. A stack usable task extraction unit that extracts a combination of a first identifier and a second identifier that is an execution protection task of the task corresponding to the identifier; and a stack usable task that searches the execution protection task storage unit The maximum stack capacity used when the task corresponding to the first identifier in the combination of the first identifier and the second identifier extracted by the extraction unit is in the inexecutable state is obtained, and is larger than that stack capacity. A stack usable task for extracting a combination of the first identifier and the second identifier, which is currently used by the task corresponding to the first identifier and has a small stack capacity And a second identifier, in which the execution state of the task corresponding to the first identifier in the combination of the first identifier and the second identifier extracted by the stack usable task selector is set to the run-disabled state. And a task switching unit for changing the execution state of the task corresponding to the running state to a running state.
【請求項3】 走行可能状態と走行待ち状態と走行状態
と走行不可能状態との少なくとも4つの実行状態とシス
テム内で一意の識別子とを持つタスクが、タスク切り替
えにより複数個実行される計算機システムにおけるスケ
ジューリング方法であって、各タスクの識別子と実行状
態とを格納するタスク情報格納部と、各タスクの識別子
と各タスクが使用する最大のスタック容量とを格納する
と共に、タスクの実行状態が走行不可能状態でありかつ
スタックが割り当てられていない場合に実行状態が走行
状態か走行待ち状態か走行可能状態かのいずれかの状態
となり、かつタスクの実行状態が走行状態か走行待ち状
態か走行可能状態かのいずれかの状態である場合に走行
不可能状態となる実行保護タスクの識別子と、前記実行
保護タスクが走行不可能状態となる場合に使用する最大
のスタック容量とを格納する実行保護タスク格納部と、
タスクの識別子と実行状態とスタックポインタとを格納
するスタックポインタ格納部とを用いて、 タスクの切り替え要求を発生するタスク切り替え要求ス
テップと、 前記タスク切り替え要求ステップにおいてタスク切り替
え要求が発生されることにより、前記タスク情報格納部
と前記実行保護タスク格納部とを検索して、いずれのタ
スクに対しても実行保護タスクではなくかつ実行状態が
走行不可能状態であるタスクの識別子を抽出する実行可
能タスク抽出ステップと、 タスクの実行状態が走行状態であるタスクの実行状態を
走行可能状態に変更し、前記タスク情報格納部を検索し
てタスクの実行状態が走行待ち状態または走行可能状態
であるタスクの識別子を抽出する実行中タスク抽出ステ
ップと、 前記実行中タスク抽出ステップにおいて抽出された識別
子を第1の識別子とし、前記実行可能タスク抽出ステッ
プにおいて抽出された識別子を第2の識別子としたとき
に、前記実行保護タスク格納部を検索して、前記第1の
識別子に対応するタスクが前記第2の識別子に対応する
タスクの実行保護タスクである第1の識別子と第2の識
別子との組合せを抽出するスタック使用可能タスク抽出
ステップと、 前記スタック使用可能タスク抽出ステップにおいて抽出
された第1の識別子と第2の識別子との組合せにおいて
実行保護タスクとなり得る識別子に対応するタスクの実
行状態を前記スタックポインタ格納部に格納し、前記実
行保護タスクとなり得るタスクの実行状態を走行待ち状
態に変更し、前記実行保護タスクとなり得るタスクが使
用しているスタック内のデータを圧縮し、前記実行保護
タスクとなり得るタスクのスタックポインタを前記スタ
ックポインタ格納部に格納するスタックデータ圧縮ステ
ップと、 前記実行保護タスク格納部を検索して、前記スタック使
用可能タスク抽出ステップにおいて抽出された第1の識
別子と第2の識別子との組合せにおける第1の識別子に
対応するタスクが実行不可能状態となる場合に使用する
最大のスタック容量を得、そのスタック容量よりも前記
第1の識別子に対応するタスクが現在使用しているスタ
ック容量が小さい第1の識別子と第2の識別子との組合
せを抽出するスタック使用可能タスク選択ステップと、 前記スタック使用可能タスク選択ステップにおいて抽出
された第1の識別子と第2の識別子との組合せにおける
第1の識別子に対応するタスクの実行状態を走行不可能
状態にし、第2の識別子に対応するタスクの実行状態を
走行状態にするタスク切り替えステップと、 前記タスク情報格納部を検索して実行状態が走行待ち状
態であるタスクの識別子を全て抽出し、前記スタックポ
インタ格納部を検索して前記タスク情報格納部から抽出
した識別子に対応するタスクのスタックポインタと実行
状態とを抽出し、前記スタックポインタ格納部からスタ
ックポインタと実行状態とを抽出したタスクが使用して
いるスタック内のデータを展開し、前記スタックポイン
タ格納部からスタックポインタと実行状態とを抽出した
タスクの実行状態をスタックポインタ格納部から抽出し
た実行状態に変更し、前記スタックポインタ格納部から
スタックポインタと実行状態とを抽出したタスクのスタ
ックポインタと実行状態とを前記スタックポインタ格納
部から削除するスタックデータ展開ステップと、 を実行することを特徴とするスケジューリング方法。
3. A computer system in which a plurality of tasks having at least four execution states of a runnable state, a run-waiting state, a runnable state and a runnable state and a unique identifier in the system are executed by task switching. In the scheduling method, the task information storage unit that stores the identifier and execution state of each task, the identifier of each task and the maximum stack capacity used by each task are stored, and the execution state of the task is run. If the task is in the impossible state and the stack is not allocated, the execution state is either the running state, the waiting state or the runnable state, and the task execution state is the running state, the waiting state, or the runnable state. The identifier of the execution protection task that is in the run-disabled state if any of the states is Execution protection task storage unit that stores the maximum stack capacity used when it becomes ready,
A task switching request step for generating a task switching request using a stack pointer storage unit that stores a task identifier, an execution state, and a stack pointer, and a task switching request generated in the task switching request step. An executable task that searches the task information storage unit and the execution protection task storage unit and extracts an identifier of a task that is not an execution protection task for any task and whose execution state is a non-runnable state The extraction step and the task execution state is the running state. The task execution state is changed to the runnable state, the task information storage unit is searched, and the task execution state of the task waiting state or runnable state is searched. In the executing task extracting step for extracting the identifier, and in the executing task extracting step, When the extracted identifier is used as the first identifier and the identifier extracted in the executable task extraction step is used as the second identifier, the execution protection task storage unit is searched and the first identifier is used as the first identifier. A stack available task extracting step of extracting a combination of a first identifier and a second identifier, the corresponding task being an execution protection task of a task corresponding to the second identifier, and the stack available task extracting step The execution state of the task corresponding to the identifier that can be the execution protection task in the combination of the extracted first identifier and second identifier is stored in the stack pointer storage unit, and the execution state of the task that can be the execution protection task is stored. Change to the running wait state, compress the data in the stack used by the task that can be the execution protection task, A stack data compression step of storing a stack pointer of a task that can be the execution protection task in the stack pointer storage unit; and a first data extracted in the stack usable task extraction step by searching the execution protection task storage unit. The maximum stack capacity used when the task corresponding to the first identifier in the combination of the identifier and the second identifier is in the inexecutable state is obtained, and the task corresponding to the first identifier is obtained from the stack capacity. A stack usable task selecting step for extracting a combination of the first identifier and the second identifier having a small stack capacity currently used by the first identifier and the first identifier extracted in the stack usable task selecting step; Runs the task execution state corresponding to the first identifier in combination with the second identifier A task switching step in which the task is enabled and the execution state of the task corresponding to the second identifier is in the running state; and the task information storage unit is searched to extract all the task identifiers whose execution state is in the running waiting state, A task that retrieves the stack pointer storage unit and extracts the stack pointer and execution state of the task corresponding to the identifier extracted from the task information storage unit, and extracts the stack pointer and execution state from the stack pointer storage unit The data in the stack being used is expanded, and the execution state of the task in which the stack pointer and the execution state are extracted from the stack pointer storage unit is changed to the execution state extracted from the stack pointer storage unit. Task stack pointer and execution status extracted from the stack pointer and execution status Scheduling method and executes a stack data expansion step to remove the door from the stack pointer storage portion.
【請求項4】 走行可能状態と走行待ち状態と走行状態
と走行不可能状態との少なくとも4つの実行状態とシス
テム内で一意の識別子とを持つタスクが、タスク切り替
えにより複数個実行される計算機システムにおけるスケ
ジューリング装置であって、 各タスクの識別子と実行状態とを格納するタスク情報格
納部と、 各タスクの識別子と各タスクが使用する最大のスタック
容量とを格納すると共に、タスクの実行状態が走行不可
能状態でありかつスタックが割り当てられていない場合
に実行状態が走行状態か走行待ち状態か走行可能状態か
のいずれかの状態となり、かつタスクの実行状態が走行
状態か走行待ち状態か走行可能状態かのいずれかの状態
である場合に走行不可能状態となる実行保護タスクの識
別子と、前記実行保護タスクが走行不可能状態となる場
合に使用する最大のスタック容量とを格納する実行保護
タスク格納部と、 タスクの識別子と実行状態とスタックポインタとを格納
するスタックポインタ格納部と、 タスクの切り替え要求を発生するタスク切り替え要求部
と、 前記タスク切り替え要求部がタスク切り替え要求を発生
したときに、前記タスク情報格納部と前記実行保護タス
ク格納部とを検索して、いずれのタスクに対しても実行
保護タスクではなくかつ実行状態が走行不可能状態であ
るタスクの識別子を抽出する実行可能タスク抽出部と、 タスクの実行状態が走行状態であるタスクの実行状態を
走行可能状態に変更し、前記タスク情報格納部を検索し
てタスクの実行状態が走行待ち状態または走行可能状態
であるタスクの識別子を抽出する実行中タスク抽出部
と、 前記実行中タスク抽出部により抽出された識別子を第1
の識別子とし、前記実行可能タスク抽出部により抽出さ
れた識別子を第2の識別子としたときに、前記実行保護
タスク格納部を検索して、前記第1の識別子に対応する
タスクが前記第2の識別子に対応するタスクの実行保護
タスクである第1の識別子と第2の識別子との組合せを
抽出するスタック使用可能タスク抽出部と、 前記スタック使用可能タスク抽出部により抽出された第
1の識別子と第2の識別子との組合せにおいて実行保護
タスクとなり得る識別子に対応するタスクの実行状態を
前記スタックポインタ格納部に格納し、前記実行保護タ
スクとなり得るタスクの実行状態を走行待ち状態に変更
し、前記実行保護タスクとなり得るタスクが使用してい
るスタック内のデータを圧縮し、前記実行保護タスクと
なり得るタスクのスタックポインタを前記スタックポイ
ンタ格納部に格納するスタックデータ圧縮部と、 前記実行保護タスク格納部を検索して、前記スタック使
用可能タスク抽出部により抽出された第1の識別子と第
2の識別子との組合せにおける第1の識別子に対応する
タスクが実行不可能状態となる場合に使用する最大のス
タック容量を得、そのスタック容量よりも前記第1の識
別子に対応するタスクが現在使用しているスタック容量
が小さい第1の識別子と第2の識別子との組合せを抽出
するスタック使用可能タスク選択部と、 前記スタック使用可能タスク選択部により抽出された第
1の識別子と第2の識別子との組合せにおける第1の識
別子に対応するタスクの実行状態を走行不可能状態に
し、第2の識別子に対応するタスクの実行状態を走行状
態にするタスク切り替え部と、 前記タスク情報格納部を検索して実行状態が走行待ち状
態であるタスクの識別子を全て抽出し、前記スタックポ
インタ格納部を検索して前記タスク情報格納部から抽出
した識別子に対応するタスクのスタックポインタと実行
状態とを抽出し、前記スタックポインタ格納部からスタ
ックポインタと実行状態とを抽出したタスクが使用して
いるスタック内のデータを展開し、前記スタックポイン
タ格納部からスタックポインタと実行状態とを抽出した
タスクの実行状態をスタックポインタ格納部から抽出し
た実行状態に変更し、前記スタックポインタ格納部から
スタックポインタと実行状態とを抽出したタスクのスタ
ックポインタと実行状態とを前記スタックポインタ格納
部から削除するスタックデータ展開部と、 を備えたことを特徴とするスケジューリング装置。
4. A computer system in which a plurality of tasks having at least four execution states of a runnable state, a run-waiting state, a runnable state and a runnable state and a unique identifier in the system are executed by task switching. And a task information storage unit that stores an identifier and an execution state of each task, an identifier of each task and a maximum stack capacity used by each task, and a running state of the task. If the task is in the impossible state and the stack is not allocated, the execution state is either the running state, the waiting state or the runnable state, and the task execution state is the running state, the waiting state, or the runnable state. The identifier of the execution protection task that is in the run-disabled state if any of the states and the execution protection task is running. Execution protection task storage that stores the maximum stack capacity used when the status becomes ready, a stack pointer storage that stores the task identifier, execution status, and stack pointer, and a task that issues a task switching request A switching request unit, and when the task switching request unit issues a task switching request, the task information storage unit and the execution protection task storage unit are searched for And the executable task extraction unit that extracts the identifier of the task whose execution state is the non-runnable state, and the execution state of the task whose task execution state is the running state is changed to the runnable state, and the task information storage unit is Task ID extraction that searches and extracts the identifier of the task whose task execution status is the RUNNING state or RUNNABLE state If the identifier extracted by the executing task extractor first
And the identifier extracted by the executable task extraction unit is used as the second identifier, the execution protection task storage unit is searched to find the task corresponding to the first identifier as the second identifier. A stack usable task extraction unit that extracts a combination of a first identifier and a second identifier, which is an execution protection task of a task corresponding to the identifier, and a first identifier extracted by the stack usable task extraction unit The execution state of the task corresponding to the identifier that can be the execution protection task in combination with the second identifier is stored in the stack pointer storage unit, and the execution state of the task that can be the execution protection task is changed to the running wait state, The data in the stack used by the task that can be an execution protection task is compressed, and the stack port of the task that can be the execution protection task is compressed. A stack data compression unit that stores an interface in the stack pointer storage unit; and a combination of the first identifier and the second identifier extracted by the stack usable task extraction unit by searching the execution protection task storage unit. The maximum stack capacity to be used when the task corresponding to the first identifier becomes in the non-executable state, and the stack capacity currently used by the task corresponding to the first identifier is larger than the stack capacity. A stack usable task selection unit that extracts a combination of a small first identifier and a second identifier, and a first combination of the first identifier and the second identifier extracted by the stack usable task selection unit. Of the task corresponding to the second identifier is set to the running state, and the execution state of the task corresponding to the second identifier is set to the running state. The switching unit and the task information storage unit are searched to extract all the identifiers of the tasks whose execution state is the running waiting state, and the stack pointer storage unit is searched to correspond to the identifier extracted from the task information storage unit. The stack pointer and the execution state of the task are extracted, the stack pointer and the execution state are extracted from the stack pointer storage unit, and the data in the stack used by the task is expanded. The execution state and the execution state of the extracted task are changed to the execution state extracted from the stack pointer storage unit, and the stack pointer and the execution state of the task whose stack pointer and execution state are extracted from the stack pointer storage unit are stored in the stack. A stack data expansion unit that deletes from the pointer storage unit is provided. Scheduling apparatus according to claim.
JP5279376A 1993-11-09 1993-11-09 Scheduling method and scheduling device Expired - Fee Related JP2544896B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5279376A JP2544896B2 (en) 1993-11-09 1993-11-09 Scheduling method and scheduling device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5279376A JP2544896B2 (en) 1993-11-09 1993-11-09 Scheduling method and scheduling device

Publications (2)

Publication Number Publication Date
JPH07134655A JPH07134655A (en) 1995-05-23
JP2544896B2 true JP2544896B2 (en) 1996-10-16

Family

ID=17610288

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5279376A Expired - Fee Related JP2544896B2 (en) 1993-11-09 1993-11-09 Scheduling method and scheduling device

Country Status (1)

Country Link
JP (1) JP2544896B2 (en)

Also Published As

Publication number Publication date
JPH07134655A (en) 1995-05-23

Similar Documents

Publication Publication Date Title
US5931935A (en) File system primitive allowing reprocessing of I/O requests by multiple drivers in a layered driver I/O system
JPH113269A (en) System and method for assisting accurate garbage collection by separating contents of stack into sub-stacks
CN102707990A (en) Container based processing method, device and system
JP2001249907A (en) Startup processing method
GB2386715A (en) Method for the use of a stack in a Java accelerator device
HK1003604A1 (en) Method and apparatus for handling nested interrupts
JP2544896B2 (en) Scheduling method and scheduling device
CN113254223B (en) Resource allocation method, system and related components after system restart
JP3110185B2 (en) Computer system
EP1008045B1 (en) File system primitive allowing reprocessing of i/o requests by multiple drivers in a layered driver i/o system
JPS59116840A (en) Parallel printing processing system
JPH05134930A (en) Memory protecting device
JPS63305439A (en) Compressive storing method for similar data file and its restoring method
JP3680228B2 (en) Execution state management method and system for parallel processing process
JP2989608B2 (en) Cell pool management device
JPH11134202A (en) Task switching device
JPH0833856B2 (en) Serial number management method
HK40067493A (en) Storage space recovery method, storage medium and program product
JP3223675B2 (en) Data collection processor
JP2850757B2 (en) Failure handling method in hierarchical file system
JPH0228846A (en) Data storing system
JPS63298543A (en) Access control system for file with key
JPS5911460A (en) disk file controller device
JP2006259806A (en) Pooling method, system and program
JPH02267643A (en) File extension system

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20070725

Year of fee payment: 11

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

Free format text: PAYMENT UNTIL: 20080725

Year of fee payment: 12

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

Free format text: PAYMENT UNTIL: 20090725

Year of fee payment: 13

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

Free format text: PAYMENT UNTIL: 20090725

Year of fee payment: 13

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

Free format text: PAYMENT UNTIL: 20100725

Year of fee payment: 14

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

Free format text: PAYMENT UNTIL: 20110725

Year of fee payment: 15

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

Free format text: PAYMENT UNTIL: 20110725

Year of fee payment: 15

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

Free format text: PAYMENT UNTIL: 20120725

Year of fee payment: 16

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

Free format text: PAYMENT UNTIL: 20120725

Year of fee payment: 16

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

Free format text: PAYMENT UNTIL: 20130725

Year of fee payment: 17

LAPS Cancellation because of no payment of annual fees