JP2003108391A - Task management apparatus, task management program and embedding device thereof - Google Patents

Task management apparatus, task management program and embedding device thereof

Info

Publication number
JP2003108391A
JP2003108391A JP2002131418A JP2002131418A JP2003108391A JP 2003108391 A JP2003108391 A JP 2003108391A JP 2002131418 A JP2002131418 A JP 2002131418A JP 2002131418 A JP2002131418 A JP 2002131418A JP 2003108391 A JP2003108391 A JP 2003108391A
Authority
JP
Japan
Prior art keywords
task
port
priority
queue
task queue
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2002131418A
Other languages
Japanese (ja)
Inventor
Ayaka Hamanaga
彩加 浜永
Shinichiro Eto
眞一郎 衛藤
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 JP2002131418A priority Critical patent/JP2003108391A/en
Publication of JP2003108391A publication Critical patent/JP2003108391A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To suppress increase in overhead when conducting aging in a realtime OS employing a priority scheduling method. SOLUTION: By using a port list representing the priority of the task concatenated to a plurality of linearly concatenated task queue ports, each executable task is managed by every priority. Consequently, the overhead when conducting aging can be suppressed.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、実行可能な複数の
タスクのうち最も優先度が高いタスクを実行させるタス
ク管理装置、タスク管理プログラム及び組込み機器に関
するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a task management device, a task management program and an embedded device for executing a task having the highest priority among a plurality of executable tasks.

【0002】[0002]

【従来の技術】例えばμITRON仕様に準拠したリアルタ
イムOS(Operating System)では、実行可能なタスクの
うちから次に実行するタスクを選択するスケジューリン
グの方式として、基本的に優先度スケジューリング方式
が用いられる。優先度スケジューリング方式では、実行
可能な複数のタスクは優先度毎に管理される。そして、
これらのタスクのうち、最も優先度の高いタスクが次に
実行される。
2. Description of the Related Art For example, in a real-time OS (Operating System) based on the μITRON specification, a priority scheduling method is basically used as a scheduling method for selecting a task to be executed next from among executable tasks. In the priority scheduling method, a plurality of executable tasks are managed for each priority. And
Among these tasks, the task with the highest priority is executed next.

【0003】もっとも、この方式では、タスクの状態が
実行可能状態であっても、実行可能状態にある他のタス
クよりも優先度が低ければ、待たされることになる。
However, in this method, even if the task is in the READY state, if the task has a lower priority than other tasks in the READY state, the task is kept waiting.

【0004】また、最も優先度の高いタスクが複数あれ
ば、実行可能状態になった順にタスクは実行されるが、
実行可能状態になったのが遅ければ、長期に渡って実行
されないこともある。
If there are a plurality of tasks with the highest priority, the tasks will be executed in the order in which they are in the ready state.
If it becomes ready for execution later, it may not be executed for a long time.

【0005】このように、優先度スケジューリング方式
を採用するリアルタイムOSでは、長期に渡ってタスク
が実行されず(スケジューリングされず)、結果とし
て、タスクの実行時間や実行回数が少なくなる飢餓状態
にタスクが陥ることがある。
As described above, in the real-time OS which employs the priority scheduling method, the task is not executed (scheduled) for a long period of time, and as a result, the task is in a starvation state in which the execution time and execution frequency of the task are reduced. May fall.

【0006】このため、時分割したCPU(Central Pro
cessing Unit)時間を各タスクに均等に割り当てるTSS
(Time Sharing System)によってもタスクのスケジュ
ーリングを行い、タスクの飢餓状態を回避しようとする
ものもある。
Therefore, the CPU (Central Pro
cessing unit) TSS that allocates time evenly to each task
There is also a (Time Sharing System) that attempts to avoid task starvation by scheduling tasks.

【0007】タスクのスケジューリングにTSSを併用す
るリアルタイムOSでは、例えば優先度が異なるタスク
についてエイジングと呼ばれる処理が、また優先度が同
じタスクについてローテイト(回転)と呼ばれる処理が
それぞれ行われる。
In a real-time OS that also uses TSS for task scheduling, for example, a process called aging is performed for tasks having different priorities, and a process called rotate is performed for tasks having the same priority.

【0008】エイジングは、実行可能状態にあるタスク
のうち、最も優先度が高いタスクよりも優先度が低いタ
スクの優先度を定期的に上げる処理である。エイジング
には、エイジングによって優先度が上げられたタスクが
実行されてから、当該タスクの優先度を元に戻すドロッ
プと呼ばれる処理が伴う。
Aging is a process of periodically raising the priority of a task having a lower priority than a task having the highest priority among the tasks in the executable state. Aging involves a process called drop, in which a task whose priority has been raised by aging is executed and then the priority of the task is restored.

【0009】また、ローテイトは、優先度の最も高いタ
スクが複数ある場合に、定期的に、そのうち実行順序が
最先のタスクを最後にまわし、その他のタスクの実行順
序を繰り上げる処理である。
In addition, the rotate is a process of periodically, when there are a plurality of tasks having the highest priority, by rotating the task having the earliest execution order to the end and raising the execution order of the other tasks.

【0010】さて、エイジングやローテイトなどの対象
となるタスク404A、404B、404C…は、例え
ば図25(a)に示すようなタスクキューテーブル42
0を用いて優先度毎に管理されていた。
The tasks 404A, 404B, 404C, ... Which are targets of aging, rotation, etc. are, for example, a task queue table 42 as shown in FIG.
It was managed for each priority using 0.

【0011】タスクキューテーブル420は、1次元の
配列構造を有するテーブルである。配列の各要素421
には、0、1、2、…、(MAX_PRI−2)、(MAX_PRI−1)
というインデックスが与えられる。これらのインデック
スが、タスクの優先度を表す。
The task queue table 420 is a table having a one-dimensional array structure. Each element 421 of the array
, 0, 1, 2, ..., (MAX_PRI-2), (MAX_PRI-1)
Index is given. These indexes represent the priority of the task.

【0012】各タスクの優先度は、インデックスが当該
優先度を表す要素421に、当該タスクの待ち行列であ
るタスクキュー403のポインタを保持する(タスクキ
ュー403を連結する)ことによって表される。
The priority of each task is represented by holding the pointer of the task queue 403, which is the queue of the task, in the element 421 whose index indicates the priority (connecting the task queue 403).

【0013】この例では、優先度が高いタスクを含むタ
スクキュー403ほど、当該タスクキュー403が連結
されるインデックスの値は小さくなる。インデックスが
「1」の要素4211に連結されたタスクキュー403
Rに含まれるタスク404Aの優先度が最も高い。
In this example, the task queue 403 including the task with the higher priority has a smaller index value to which the task queue 403 is linked. Task queue 403 linked to element 4211 with index "1"
The task 404A included in R has the highest priority.

【0014】ランキューインデックス422は、優先度
が最も高いタスク、すなわち実行されるタスクを含むタ
スクキュー(ランキュー)403Rが連結された要素4
211のインデックスを表す。図25(a)の例では、
ランキューインデックス422の値は「1」である。
The run queue index 422 is an element 4 in which a task queue (run queue) 403R including a task having the highest priority, that is, a task to be executed is connected.
It represents the index of 211. In the example of FIG. 25 (a),
The value of the run queue index 422 is “1”.

【0015】また、タスクの優先度は、基本的に予め設
定されたベース優先度に基づく。例えばベース優先度の
値が「3」のタスク404Cを含むタスクキュー403
が連結されるのは、インデックスが「3」の要素421
である。
The task priority is basically based on a preset base priority. For example, a task queue 403 including a task 404C whose base priority value is "3"
Are connected to each other by the element 421 whose index is "3".
Is.

【0016】エイジングやローテイトを行う場合、この
ようなタスクキューテーブル420に対して操作が行わ
れる。エイジングを行うにあたっては、予めランキュー
インデックス422の保持する変数run_ixの値が初期化
される。
When performing aging or rotation, such task queue table 420 is operated. When performing aging, the value of the variable run_ix held by the run queue index 422 is initialized in advance.

【0017】ランキューインデックス422の保持する
変数run_ixの値を初期化する場合、図26に示すような
手順S2601乃至S2603が行われる。これらの手
順を図25(a)に示すタスクキューテーブル420の
状態を例にしながら説明すると、まずランキューインデ
ックス422の保持する変数run_ixに0が代入される
(S2601)。次に、タスクキューテーブル420の
インデックスの値がrun_ixの要素421にタスクキュー
403が連結されているか否かが判断される。ここで
は、インデックスの値が「0」の要素421にタスクキ
ュー403が連結されていない。タスクキューテーブル
420のインデックスの値がrun_ixの要素421にタス
クキュー403が連結されていないと判断された場合、
変数run_ixの値が1だけインクリメントされる(S26
03)。このとき、変数run_ixの値は「1」となる。
When the value of the variable run_ix held by the run queue index 422 is initialized, steps S2601 to S2603 as shown in FIG. 26 are performed. These procedures will be described by taking the state of the task queue table 420 shown in FIG. 25A as an example. First, 0 is assigned to the variable run_ix held by the run queue index 422 (S2601). Next, it is determined whether the task queue 403 is linked to the element 421 whose index value of the task queue table 420 is run_ix. Here, the task queue 403 is not linked to the element 421 whose index value is “0”. When it is determined that the task queue 403 is not linked to the element 421 of the run_ix having the index value of the task queue table 420,
The value of the variable run_ix is incremented by 1 (S26
03). At this time, the value of the variable run_ix becomes “1”.

【0018】そして、手順S2602において、タスク
キューテーブル420のインデックスの値がrun_ixの要
素421にタスクキュー403が連結されていると判断
されるまで、手順S2603が繰り返される。図25
(a)の例の場合、インデックスの値が「1」の要素4
211には、タスクキュー403が連結されているか
ら、もう一度手順S2603を行うことなく、初期化処
理は終了することになる。
Then, in step S2602, step S2603 is repeated until it is determined that the value of the index of the task queue table 420 is linked to the element 421 of run_ix. Figure 25
In the case of the example of (a), the element 4 whose index value is "1"
Since the task queue 403 is connected to 211, the initialization process ends without performing step S2603 again.

【0019】このようにして、ランキューインデックス
422の保持する変数run_ixには、タスクキュー403
が連結された要素421のインデックスのうち、最小の
値(すなわち最も高い優先度を表すインデックスの値)
がセットされる。それから、エイジングが行われる。
In this way, the task queue 403 is stored in the variable run_ix held by the run queue index 422.
Of the indexes of the elements 421 that are linked with each other, that is, the minimum value (that is, the index value indicating the highest priority)
Is set. Then aging is done.

【0020】エイジングでは、図27に示すように、ま
ずインデックスを表す変数iに、(run_ix+1)が代入
される(S2701)。このとき、インデックスを表す
変数iは2となる。次に、インデックスの値が(run_ix
+1)の要素421にタスクキュー403が連結されて
いるか否かが判断される(S2702)。
In aging, as shown in FIG. 27, first, (run_ix + 1) is assigned to the variable i representing the index (S2701). At this time, the variable i representing the index becomes 2. Then the index value is (run_ix
It is determined whether the task queue 403 is connected to the element 421 of +1) (S2702).

【0021】インデックスの値が(run_ix+1)の要素
421にタスクキュー403が連結されていると判断さ
れた場合、当該タスクキュー403が、最も優先度が高
いタスクを含むランキュー403Rの最後尾に連結され
る(S2703)。
When it is determined that the task queue 403 is connected to the element 421 having the index value (run_ix + 1), the task queue 403 is connected to the tail of the run queue 403R including the task with the highest priority. (S2703).

【0022】図25(a)の例では、インデックスの値
が「2」の要素421にタスクキュー403は連結され
ていない。インデックスの値が(run_ix+1)の要素4
21にタスクキュー403が連結されていないと判断さ
れた場合、変数iが1だけインクリメントされる(S2
704)。これによって、変数iは3となる。
In the example of FIG. 25A, the task queue 403 is not linked to the element 421 whose index value is "2". Element 4 with index value (run_ix + 1)
If it is determined that the task queue 403 is not connected to the task 21, the variable i is incremented by 1 (S2
704). As a result, the variable i becomes 3.

【0023】次に、インデックスがiの要素421にタ
スクキュー403が連結されているか否かが判断される
(S2705)。
Next, it is determined whether or not the task queue 403 is linked to the element 421 with the index i (S2705).

【0024】このとき、変数iは3であり、インデック
スが「3」の要素421にはタスクキュー403が連結
されている。インデックスがiの要素421にタスクキ
ュー403が連結されていると判断された場合、インデ
ックスが(i−1)の要素421が保持するポインタ
に、当該タスクキュー403へのポインタが表すアドレ
スが代入される(S2706)。これによって、インデ
ックスが「3」の要素421に連結されていたタスクキ
ュー403が、インデックスが「2」の要素421に連
結されることになり、当該タスクキュー403に含まれ
るタスク404Cの優先度が1だけあがった。
At this time, the variable i is 3, and the task queue 403 is connected to the element 421 having the index "3". When it is determined that the task queue 403 is connected to the element 421 with the index i, the address represented by the pointer to the task queue 403 is assigned to the pointer held by the element 421 with the index (i-1). (S2706). As a result, the task queue 403 linked to the element 421 having the index “3” is linked to the element 421 having the index “2”, and the priority of the task 404C included in the task queue 403 is set. Only 1 went up.

【0025】また、手順S2705において、インデッ
クスがiの要素421にタスクキュー403が連結され
ていないと判断された場合や、手順S2706の後、変
数iが優先度の最大値(MAX_PRI−1)と等しいか否かが
判断される(S2707)。
In step S2705, when it is determined that the task queue 403 is not linked to the element 421 having the index i, or after step S2706, the variable i is set to the maximum priority value (MAX_PRI-1). It is determined whether they are equal (S2707).

【0026】そして、変数iが優先度の最大値(MAX_PRI
−1)と等しいか否かが判断されるまで、手順S270
4から手順S2707までの手順が繰り返される。
The variable i is the maximum value of the priority (MAX_PRI
-1) until it is determined whether or not it is equal to step S270.
The procedure from 4 to step S2707 is repeated.

【0027】これによって、インデックスがランキュー
インデックス422よりも値の大きな要素421の全て
について手順S2705の判断が行われ、タスクキュー
403が連結されていれば、図25(b)に示すよう
に、当該タスクキュー403に含まれるタスク404
C、404D、404Eの優先度が1だけ上げられるこ
とになる。
As a result, the determination in step S2705 is made for all the elements 421 whose index is larger than the run queue index 422, and if the task queue 403 is linked, as shown in FIG. Task 404 included in task queue 403
The priority of C, 404D, and 404E is increased by 1.

【0028】上述のようなエイジングによって優先度が
上がったタスクが実行されると、当該タスクに対してド
ロップが行われる。実行されるのはランキュー403R
の先頭にあるタスクであるから、ドロップするタスク
は、ランキュー403Rの先頭に位置することになる。
When a task whose priority has been increased by the aging as described above is executed, the task is dropped. Run queue 403R is executed
The task to be dropped is located at the head of the run queue 403R because it is the task at the head.

【0029】ここで、ドロップを行う直前のタスクキュ
ーテーブル420の状態が図28(a)に示すようなも
のであったとする。すなわち、ランキュー403Rの先
頭に、ベース優先度の値が「4」のタスク404dがあ
ったとする。
Here, it is assumed that the state of the task queue table 420 immediately before the drop is as shown in FIG. 28 (a). That is, it is assumed that there is a task 404d having a base priority value of "4" at the head of the run queue 403R.

【0030】図28(a)に示す状態を例にしながらド
ロップについて説明すると、まず図29に示すように、
ランキュー403Rの先頭にある(ドロップ対象の)タ
スク404dが、ランキュー403Rから削除される
(S2901)。
The drop will be described by taking the state shown in FIG. 28A as an example. First, as shown in FIG.
The task 404d (target of the drop) at the head of the run queue 403R is deleted from the run queue 403R (S2901).

【0031】次に、削除したタスク404dを、当該タ
スク404dのベース優先度の値base_priとインデック
スの値が一致する要素421が連結されたタスクキュー
403の最後尾に連結する(S2902)。この場合、
インデックスの値が「4」の要素421に連結されたタ
スクキュー403に、削除したタスク404dが連結さ
れることになる。
Next, the deleted task 404d is linked to the end of the task queue 403 to which the element 421 having the same base priority value base_pri of the task 404d and the index value is linked (S2902). in this case,
The deleted task 404d is linked to the task queue 403 linked to the element 421 whose index value is "4".

【0032】次に、ランキュー403Rに含まれたタス
クが、削除したタスク404dのみであったか否かの判
断が行われる(S2903)。ランキュー403Rに含
まれたタスクが、削除したタスク404dのみであった
場合、ランキューインデックス422の保持する変数ru
n_ixの値が1だけインクリメントされる(S290
4)。さらに、変数run_ixとインデックスの値が同じ要
素421にタスクが連結されているか否かの判断が行わ
れる(S2905)。変数run_ixとインデックスの値が
同じ要素421にタスクが連結されていないと判断され
た場合、変数run_ixとインデックスの値が同じ要素42
1にタスクが連結されていると判断されるまで、手順S
2904が繰り返される。
Next, it is judged whether or not the task included in the run queue 403R is only the deleted task 404d (S2903). When the task included in the run queue 403R is only the deleted task 404d, the variable ru retained by the run queue index 422
The value of n_ix is incremented by 1 (S290
4). Further, it is determined whether or not the task is linked to the element 421 having the same index value as the variable run_ix (S2905). When it is determined that the task is not connected to the element 421 having the same variable run_ix and the same index value, the element 42 having the same variable run_ix and the same index value is determined.
Until it is determined that the task is linked to step 1, step S
2904 is repeated.

【0033】そして、手順S2903において、ランキ
ュー403Rに含まれたタスクが、削除したタスク40
4dのみでなかったと判断された場合、又は手順S29
05を経て、ドロップは終了する。図28(a)の例で
は、ランキュー403Rに含まれたタスクが、削除した
タスク404dのみでないため、手順S2904、S2
905は行われず、ドロップ後の状態は図28(b)に
示すようなものになる。
Then, in step S2903, the task included in the run queue 403R is the deleted task 40.
If it is determined that it was not only 4d, or step S29
After 05, the drop ends. In the example of FIG. 28A, since the task included in the run queue 403R is not only the deleted task 404d, steps S2904 and S2.
905 is not performed, and the state after the drop is as shown in FIG. 28 (b).

【0034】また、ローテイトについて説明しておく
と、まず図30に示すように、ランキュー403Rに含
まれるタスクの数が1つだけであるか否かが判断される
(S3001)。ランキュー403Rに含まれるタスク
の数が1つだけであれば、そのままローテイトは終了す
る。ランキュー403Rに含まれるタスクの数が1つだ
けでなければ、ランキュー403Rの先頭にあるタスク
が削除され(S3002)、当該タスクがランキュー4
03Rの最後尾に連結される。
To explain rotation, first, as shown in FIG. 30, it is determined whether or not the number of tasks included in the run queue 403R is only one (S3001). If the number of tasks included in the run queue 403R is only one, the rotation ends as it is. If the number of tasks included in the run queue 403R is not only one, the task at the head of the run queue 403R is deleted (S3002), and the relevant task is assigned to the run queue 4
It is linked to the end of 03R.

【0035】[0035]

【発明が解決しようとする課題】上述した従来技術の問
題点は、優先度の最大値(すなわち要素421の個数)
が大きくなるにしたがって、または連結し直すタスクキ
ュー403の数が多くなるにしたがって、エイジング処
理に要する時間が増え、OSのオーバーヘッドが増大す
ることである。上述したエイジングの処理中は割り込み
を禁止する必要があるため、割り込み応答性の悪化を招
き、特にリアルタイムOSにとっては、大きな問題とな
る。
The problem of the above-mentioned prior art is that the maximum value of the priority (that is, the number of elements 421).
Is larger or the number of task queues 403 to be reconnected is larger, the time required for the aging process is increased and the overhead of the OS is increased. Since it is necessary to prohibit interrupts during the aging process described above, the interrupt responsiveness is deteriorated, which is a serious problem especially for real-time OSs.

【0036】本発明は、このような従来の技術における
課題を鑑みてなされたものであり、エイジングやそれに
伴うドロップの際のオーバーヘッドの増大を抑制するこ
とができるタスク管理装置、タスク管理プログラム及び
組込み機器を提供することを目的とするものである。
The present invention has been made in view of the above problems in the prior art, and is a task management device, task management program, and built-in system capable of suppressing an increase in the overhead during aging and accompanying drop. The purpose is to provide a device.

【0037】[0037]

【課題を解決するための手段】本発明は、上記目的を達
成するために以下の手段を採用している。すなわち、本
発明は、実行可能な複数のタスクそれぞれに予め設定さ
れた設定優先度に基づいた優先度毎に各タスクを管理す
る実行可能タスク管理手段を備えたタスク管理装置を前
提としている。この実行可能タスク管理手段が管理する
タスクのうち最も優先度が高いタスクが実行される。タ
スクの実行は、これもタスク管理装置が備えるスケジュ
ーリング手段が行わせる。また、スケジューリング手段
は、実行可能タスク管理手段に対して、最も優先度が高
いタスクよりも優先度が低いタスクの優先度を上げるエ
イジングの指示も行う。
The present invention employs the following means in order to achieve the above object. That is, the present invention is premised on a task management device provided with an executable task management means for managing each task for each priority based on a preset priority set for each of a plurality of executable tasks. Among the tasks managed by this executable task management means, the task with the highest priority is executed. The task is executed by the scheduling means also included in the task management device. The scheduling means also gives the executable task management means an instruction for aging to raise the priority of the task having the lower priority than the task having the highest priority.

【0038】このエイジングを行うにあたり、実行可能
タスク管理手段は、線状に連結された複数の要素の順序
が要素に関連付けられたタスクの優先度を表すリストに
対して操作を行う。このリストの具体的態様が、図1に
示すポートリスト401である。ポートリスト401に
おいて、要素に当たるのがタスクキューポート402で
ある。タスクキューポート402の順序、具体的にはそ
のインデックスの値がタスクキューポート402に関連
付けられたタスクの優先度を表す。
In carrying out this aging, the executable task management means operates a list in which the order of a plurality of linearly connected elements represents the priority of the task associated with the element. A specific aspect of this list is the port list 401 shown in FIG. The task queue port 402 corresponds to the element in the port list 401. The order of the task queue port 402, specifically the value of its index, represents the priority of the task associated with the task queue port 402.

【0039】エイジングを行うにあたって、このポート
リスト401に対して行われる操作は、タスクの関連付
けられたタスクキューポート402のうち、そのインデ
ックスが最も高い優先度を表すタスクキューポート40
21と、当該タスクキューポート402の次順にあるタ
スクキューポート4022との連結を削除して次々順に
あるタスクキューポート4023を代わりに連結すると
いうものである。
When performing aging, the operation performed on the port list 401 is the task queue port 40 whose index indicates the highest priority among the task queue ports 402 associated with the task.
21 and the task queue port 4022 in the next order of the task queue port 402 are deleted, and the task queue port 4023 in the next order is connected instead.

【0040】この操作によって、図5(a)に示すよう
に、タスクキューポート4023、4024など、タス
クキューポート4023以降のタスクキューポート40
2に関連付けられたタスクの優先度が上げられる。
By this operation, as shown in FIG. 5A, the task queue ports 4023, 4024, and the like, task queue ports 40 after the task queue port 4023 are shown.
The priority of the task associated with 2 is raised.

【0041】このようなリストの具体的態様からも理解
される通り、本発明では、タスクが関連づけられた要素
のうち最も高い優先度を表す順序にある最高優先度要素
に、その次々順にある要素を連結してしまえば、当該次
々順にある要素に以降の要素が連結されているから、そ
れら各要素に対してそれぞれ操作を行う必要がなくな
る。その結果、優先度の最大値に従って要素の個数が増
加しても、エイジングにおけるオーバーヘッドの増大を
抑えることができる。
As can be understood from the specific mode of such a list, according to the present invention, the highest priority element in the order of representing the highest priority among the elements with which the task is associated is followed by the elements in the order. If the elements are connected, the subsequent elements are connected to the element that is one after the other, so that it is not necessary to perform an operation for each of these elements. As a result, even if the number of elements increases in accordance with the maximum value of priority, it is possible to suppress an increase in overhead in aging.

【0042】さらに、実行可能タスク管理手段は、最高
優先度要素との連結を削除した要素にタスクが関連付け
られている場合に、当該タスクを最高優先度要素に関連
付ける操作も前記リストに対して行う。
Further, the executable task management means, when the task is associated with the element whose connection with the highest priority element is deleted, also performs the operation of associating the task with the highest priority element with respect to the list. .

【0043】また、最高優先度要素との連結が削除され
タスクとの関連付けもない要素については、例えばリス
トの最後尾にある要素の次順に連結し直せばよい。
Further, for the elements which are deleted from the connection with the highest priority element and are not associated with the task, for example, the elements at the end of the list may be reconnected in order.

【0044】ところで、スケジューリング手段は、実行
可能タスク管理手段に対して、エイジングによって優先
度が上げられたタスクのうち実行されたタスクの優先度
を当該タスクの設定優先度に戻すドロップの指示も行
う。
By the way, the scheduling means instructs the executable task management means to drop the priority of the executed task among the tasks whose priority has been raised by aging to the set priority of the task. .

【0045】この場合、実行可能タスク管理手段は、リ
ストの要素の順序に対応して配列された各配列要素がそ
れぞれ前記リストの要素を特定する特定情報を保持する
テーブルを有するのが好ましい。
In this case, it is preferable that the executable task management means has a table in which each array element arrayed corresponding to the order of the elements of the list holds specific information for identifying each element of the list.

【0046】このテーブルの具体的態様が、図10に示
すポートテーブル410である。ポートテーブル410
において、配列された要素411のインデックスは、ポ
ートリスト401のタスクキューポート402の順序と
一致する。この要素411は、特定情報として、タスク
キューポート402へのポインタを保持する。
A concrete mode of this table is the port table 410 shown in FIG. Port table 410
In, the index of the arrayed elements 411 matches the order of the task queue ports 402 in the port list 401. This element 411 holds a pointer to the task queue port 402 as specific information.

【0047】また、要素検索手段は、ドロップの対象と
なるタスクの設定優先度と同じ優先度を表す設定優先度
順序にあるリストの要素を、当該設定優先度順序に対応
するテーブルの配列要素に保持された特定情報を用いて
検索する。
Further, the element searching means sets the elements of the list in the setting priority order representing the same priority as the setting priority of the task to be dropped into the array element of the table corresponding to the setting priority order. Search using the stored specific information.

【0048】そして、ドロップの際、実行可能タスク管
理手段は、要素検索手段によって検索したリストの要素
にドロップの対象となったタスクを関連付ける操作を行
う。
Then, at the time of dropping, the executable task management means performs an operation of associating the task of the drop target with the element of the list searched by the element searching means.

【0049】このようにしてドロップを行えば、設定優
先度順序にあるリストの要素が簡単に得られ、リストの
先頭から要素を順次辿って、ドロップの対象となったタ
スクを関連付ける要素を探索する必要がなくなる。従っ
て、その分だけドロップにおけるオーバーヘッドを抑え
ることができる。
By performing the drop in this way, the elements of the list in the set priority order can be easily obtained, and the elements are sequentially traced from the head of the list to search for the element to which the task to be dropped is associated. There is no need. Therefore, the overhead in the drop can be suppressed accordingly.

【0050】さらに、要素検索手段は、テーブルに配列
された配列要素のうち、当該配列要素の保持する特定情
報によって特定されるリストの要素の順序が当該配列要
素の対応しているものとは異なる配列要素で最も先頭側
に配列された配列要素の順序を表す更新インデックスを
保持するのがよい。
Further, the element search means differs from the array elements arranged in the table in the order of the elements of the list specified by the specification information held by the array element, which is different from the order of the array element. It is preferable to hold an update index that indicates the order of the array element arranged at the topmost position among the array elements.

【0051】この更新インデックスの具体的態様は、図
10(b)に示す更新インデックス412である。この
更新インデックス412が保持するのは、ポートテーブ
ル410における要素411のインデックスの値であ
る。ここで、更新インデックス412は、「2」という
値を保持している。インデックスが「2」の要素411
2の保持するポインタの指すのは、タスクキューポート
402Aであり、当該要素4112の対応しているタス
クキューポート402とは順序が異なる。また、インデ
ックスが「3」以上の要素411も同様に順序が異なる
が、このように順序が異なるものの中で最も先頭側にあ
るのは、要素4112である。このため、更新インデッ
クス412は、要素4112のインデックスの値「2」
を保持している。
A specific mode of this update index is the update index 412 shown in FIG. 10 (b). The update index 412 holds the index value of the element 411 in the port table 410. Here, the update index 412 holds the value “2”. Element 411 whose index is "2"
The pointer held by 2 points to the task queue port 402A, which is in a different order from the corresponding task queue port 402 of the element 4112. Similarly, the elements 411 whose indexes are “3” or more are also different in order, but the element 4112 is the element closest to the head among the elements having different orders. Therefore, the update index 412 is the index value “2” of the element 4112.
Holding

【0052】図10(b)に示す具体的態様のように、
要素411の保持するポインタの指すタスクキューポー
ト402と、当該要素411の対応しているタスクキュ
ーポート402とで順序が異なるのは、エイジングの結
果である。
As in the specific embodiment shown in FIG. 10 (b),
The order of the task queue port 402 pointed to by the pointer held by the element 411 and the task queue port 402 corresponding to the element 411 is different as a result of aging.

【0053】このような状態のままでは、要素検索手段
の検索結果が適切でなくなってしまう場合が生じる。
In such a state, the search result of the element search means may become inappropriate.

【0054】そこで、要素検索手段は、検索を行うにあ
たって、設定優先度順序が更新インデックスの表す順序
以降にあるか否かを判断し、設定優先度順序が更新イン
デックスの表す順序以降にあると判断した場合に、最高
優先度要素に対応する配列要素よりも最後尾側に配列さ
れ更新インデックスの表す順序以先に配列された配列要
素の保持する特定情報を、当該配列要素の対応している
順序にあるリストの要素を特定するものに更新する操作
を予め行う。
Therefore, when performing the search, the element search means determines whether or not the set priority order is after the order represented by the update index, and determines that the set priority order is after the order represented by the update index. In this case, the specific information held by the array elements that are arranged on the rearmost side of the array element corresponding to the highest priority element and that are arranged earlier than the order represented by the update index The operation of updating the elements of the list in 1 to be specified is performed in advance.

【0055】ここで、例えば図13(a)のような状態
に、ポートリスト401、ポートテーブル410があっ
たとする。そして、更新インデックス412の保持する
値は「2」であり、ドロップの対象となるタスクの設定
優先度は「3」であるとする。この場合、図13(b)
に示すように、最高優先度要素に対応する要素4111
よりも最後尾側に配列され更新インデックスの表す順序
以先にある要素411、すなわち要素4112とその次
順にあるインデックスの値が「3」の要素4113の保
持するポインタ(特定情報)が更新されることになる。
Here, it is assumed that the port list 401 and the port table 410 exist in the state as shown in FIG. The value held by the update index 412 is "2", and the setting priority of the task to be dropped is "3". In this case, FIG. 13 (b)
Element 4111 corresponding to the highest priority element
The pointer (specific information) held by the element 411 arranged on the rearmost side of the element and positioned before the order represented by the update index, that is, the element 4112 and the element 4113 having the index value “3” in the next order is updated. It will be.

【0056】図13(b)に示すような状態になれば、
要求検索手段は適切な検索を行える。しかも、特定情報
が更新されるのは、必要最小限の配列要素についてのみ
である。従って、更新に伴うオーバーヘッドの増大を抑
えることができ、結果として、ドロップにおけるオーバ
ーヘッドの増大抑制に寄与する。
If the state shown in FIG. 13B is reached,
The request search means can perform an appropriate search. Moreover, the specific information is updated only for the minimum necessary array elements. Therefore, it is possible to suppress the increase of the overhead due to the update, and as a result, it contributes to the suppression of the increase of the overhead in the drop.

【0057】なお、残りの配列要素の特定情報について
は、例えばアイドル状態の際に更新すればよい。また、
特定情報の更新に伴い、特定情報を更新した配列要素の
次順に更新インデックスが表す順序を更新する操作も行
われる。
The specific information of the remaining array elements may be updated in the idle state, for example. Also,
Along with the update of the specific information, an operation of updating the order represented by the update index next to the array element for which the specific information is updated is performed.

【0058】また、前記ポートリストは、低速メモリと
高速メモリとからなるメモリ領域のうち、高速メモリ領
域に格納されてることが多い。そこで、前記ポートリス
トが消費する高速メモリ領域を小さくするために、前記
ポートリストの容量は小さくしておく必要がある。
The port list is often stored in the high speed memory area of the memory areas consisting of the low speed memory and the high speed memory. Therefore, in order to reduce the high-speed memory area consumed by the port list, it is necessary to reduce the capacity of the port list.

【0059】そこで、前記ポートリスト401には、タ
スクが関連付けられている保持要素のみが線状に連結さ
れている。この保持要素は、関連付けられたタスクの優
先度(以下、「保持要素優先度」という)を表す値を保
持している。保持要素が連結されたリストの具体的態様
は図14に示すポートリスト401である。図14にお
いて、保持要素に当たるのがタスクキューポート408
0である。
Therefore, in the port list 401, only the holding elements associated with the tasks are linearly linked. This holding element holds a value indicating the priority of the associated task (hereinafter referred to as "holding element priority"). A specific mode of the list in which the holding elements are linked is the port list 401 shown in FIG. In FIG. 14, the holding element corresponds to the task queue port 408.
It is 0.

【0060】このようなポートリスト401において、
先頭のタスクキューポート4080(最高優先度保持要
素)に関連付けられたタスクのみ前記実行可能タスク管
理手段によって実行される。
In such a port list 401,
Only the task associated with the first task queue port 4080 (highest priority holding element) is executed by the executable task management means.

【0061】前記スケジューリング手段は、実行可能タ
スク管理手段に対してエイジングの指示を行うが、ここ
でのエイジングとは、保持要素優先度の最も高いタスク
キューポート4080以外のタスクキューポート408
2の保持要素優先度を上げる操作をいう。
The scheduling means gives an aging instruction to the executable task management means. The aging here means a task queue port 408 other than the task queue port 4080 having the highest holding element priority.
2 is an operation to raise the priority of the holding element.

【0062】図16に示すポートリスト401に対して
エイジングが行われると、図18に示すように、タスク
キューポート4081以降のタスクキューポート408
1、4082の保持要素優先度「3」、「4」が
「2」、「3」になる。更に、ポートリスト401が図
18に示す状態において、前記実行可能タスク管理手段
がもう一度エイジングを行うと、タスクキューポート4
081、4082の保持要素優先度が「1」、「2」と
なる。
When the port list 401 shown in FIG. 16 is aged, as shown in FIG. 18, the task queue port 4081 and subsequent task queue ports 408 are shown.
The holding element priorities “3” and “4” of 1,4082 become “2” and “3”. Further, in the state where the port list 401 is shown in FIG. 18, when the executable task management means performs aging again, the task queue port 4
The holding element priorities of 081 and 4082 are "1" and "2".

【0063】このようにエイジングを行うことで、タス
クキューポート4081とタスクキューポート4080
との保持要素優先度が等しくなる。先頭のタスクキュー
ポート4080と次順のタスクキューポート4081の
保持要素優先度が等しくなると、前記実行可能タスク管
理手段は、次順のタスクキューポート4081に関連付
けられているタスク4041を先頭のタスクキューポー
ト4080に関連付ける。そして、実行可能タスク管理
手段は、タスクキューポート4080と次順のタスクキ
ューポート4081との連結を削除し、タスクキューポ
ート4080に次々順のタスクキューポート4082を
連結する。
By performing aging in this way, the task queue port 4081 and the task queue port 4080
The holding element priorities of and become equal. When the holding element priorities of the first task queue port 4080 and the next task queue port 4081 become equal, the executable task management means sets the task 4041 associated with the next task queue port 4081 to the first task queue. Associate with port 4080. Then, the executable task management means deletes the connection between the task queue port 4080 and the next task queue port 4081, and connects the next task queue port 4082 to the task queue port 4080.

【0064】この結果、図19に示すように次順のタス
クキューポート4081に関連付けられていたタスク4
041は、タスクキューポート4080に関連付けられ
ることになる。
As a result, the task 4 associated with the next task queue port 4081 as shown in FIG.
041 will be associated with the task queue port 4080.

【0065】又、前記実行可能タスク管理手段は、タス
クが関連付けられなくなった次順のタスクキューポート
4081をメモリ上から削除することで、ポートリスト
401が消費するメモリ領域を小さくすることができ
る。
Further, the executable task management means can reduce the memory area consumed by the port list 401 by deleting the next task queue port 4081 from which no task is associated with the task queue port 4081.

【0066】前記スケジューリング手段102は、ドロ
ップの指示も前記実行可能タスク管理手段に指示する。
ここでのドロップとは、エイジングによって最も保持要
素優先度の高い先頭のタスクキューポート4080と関
連付けられたタスクキュー403Rのうち実行されたタ
スクを、当該タスクの設定優先度と対応する保持要素優
先度を保持するタスクキューポートに関連付けることを
いう。
The scheduling means 102 also gives a drop instruction to the executable task management means.
The term “drop” here means that the executed task in the task queue 403R associated with the first task queue port 4080 having the highest holding element priority due to aging is the holding element priority corresponding to the setting priority of the task. Is associated with the task queue port that holds the.

【0067】例えば図21に示す設定優先度が「3」の
タスク4041がドロップの対象である場合、前記実行
可能タスク管理手段は、保持要素検索手段に保持要素優
先度「3」を保持するタスクキューポートをポートリス
ト401から検索させ、検出されたタスクキューポート
4081にドロップの対象となるタスク4041を関連
付ける操作を行う。
For example, when the task 4041 having the setting priority "3" shown in FIG. 21 is the target of the drop, the executable task management means holds the holding element search means with the holding element priority "3". The queue port is searched for from the port list 401, and the task 4041 to be dropped is associated with the detected task queue port 4081.

【0068】又、例えば図22に示すタスク4042を
ドロップの対象とする場合、当該タスク4042の設定
優先度と対応する図23に示すように、保持要素優先度
が「7」のタスクキューポートがポートリスト401に
は存在しない。この場合、前記実行可能タスク管理手段
は、保持要素優先度が「7」のタスクキューポート40
83を作成し、ポートリスト401の配列順序が保持要
素優先度順になるように当該保持要素をポートリスト4
01に追加する。即ち、タスクキューポート4083
は、保持要素優先度が「7」よりも高い保持要素のう
ち、最も保持要素優先度が低いタスクキューポート、図
23ではタスクキューポート4082に連結される。ま
た、タスクキューポート4083には、保持要素優先度
が「7」よりも低い保持要素のうち最も保持要素優先度
が高いタスクキューポート、図23ではタスクキューポ
ート4085が連結される。更に、タスクキューポート
4083には、実行可能タスク管理手段によって、ドロ
ップの対象であるタスク4042が関連付けられる。
Further, for example, when the task 4042 shown in FIG. 22 is to be dropped, as shown in FIG. 23 corresponding to the set priority of the task 4042, the task queue port with the holding element priority “7” is It does not exist in the port list 401. In this case, the executable task management means uses the task queue port 40 whose holding element priority is "7".
83 is created, and the holding elements are arranged in the port list 4 so that the arrangement order of the port list 401 is the holding element priority order.
Add to 01. That is, task queue port 4083
23 is connected to the task queue port having the lowest holding element priority among the holding elements having the holding element priority higher than “7”, that is, the task queue port 4082 in FIG. Further, the task queue port 4083 is connected to the task queue port having the highest holding element priority among the holding elements having the holding element priority lower than "7", that is, the task queue port 4085 in FIG. Further, the task queue port 4083 is associated with the task 4042 to be dropped by the executable task management means.

【0069】又、図24に示すように、ドロップの実行
の結果、保持要素優先度の最も高いタスクキューポート
4080にタスクが関連付けられなくなった場合、前記
実行可能タスク管理手段は、タスクキューポート408
0と次順のタスクキューポート4081との連結を削除
する。このように、タスクが関連付けられなくなったタ
スクキューポート4080を削除することで、ポートリ
スト401全体の容量を小さくすることができる。
As shown in FIG. 24, when the task is no longer associated with the task queue port 4080 having the highest holding element priority as a result of the execution of the drop, the executable task management means is task queue port 408.
The connection between 0 and the next task queue port 4081 is deleted. In this way, by deleting the task queue port 4080 that is no longer associated with a task, the capacity of the entire port list 401 can be reduced.

【0070】また、上述のような発明は、タスク管理装
置としてだけでなく、タスク管理プログラムや、このタ
スク管理プログラムを記録したCDROMなどのコンピ
ュータ読み取り可能な記録媒体として実施されることも
ある。
The invention as described above may be implemented not only as a task management apparatus but also as a task management program or a computer-readable recording medium such as a CDROM recording the task management program.

【0071】このタスク管理プログラムは、コンピュー
タのCPUやメモリといったハードウェアと協働して、
コンピュータを上述のようなタスク管理装置として機能
させる。
This task management program cooperates with hardware such as CPU and memory of the computer,
The computer is made to function as the task management device as described above.

【0072】さらに、このタスク管理プログラムやそれ
を実装したリアルタイムOSを、例えばデジタル家電や
携帯電話などに組み込めば、タスク管理装置は、それら
組込み機器として実施されることになる。
Furthermore, if this task management program or the real-time OS in which it is installed is incorporated into, for example, a digital home appliance or a mobile phone, the task management apparatus will be implemented as such an embedded device.

【0073】[0073]

【発明の実施の形態】(実施の形態1)以下に本発明の
実施の形態を図面に従って説明する。
BEST MODE FOR CARRYING OUT THE INVENTION (Embodiment 1) Embodiments of the present invention will be described below with reference to the drawings.

【0074】この実施の形態では、本発明は、原則的に
優先度スケジューリング方式によってタスクのスケジュ
ーリングを行い、定期的にエイジングなども行うリアル
タイムOSに現れる。このリアルタイムOSは、例えば
図2に示すようなタスク管理装置1として少なくともコ
ンピュータを機能させる。
In this embodiment, the present invention appears in a real-time OS that basically performs task scheduling by a priority scheduling method and also performs aging regularly. This real-time OS causes at least a computer to function as the task management device 1 as shown in FIG.

【0075】タスク管理装置1において、システムコー
ル処理手段101は、アプリケーション201からのシ
ステムコールを受け、タスクの状態変化をスケジューリ
ング手段102に通知する。μITRON仕様に準拠したリ
アルタイムOSでは、タスクの状態には、実行状態(RU
N)、実行可能状態(READY)、待ち状態(WAIT)、休止状態
(DORMANT)などがあり、これらの間で状態が変化す
る。例えば待ち状態にあるタスクについて待ち解除が行
われると、当該タスクの状態は実行可能状態に変化す
る。
In the task management system 1, the system call processing means 101 receives the system call from the application 201 and notifies the scheduling means 102 of the task status change. In a real-time OS that conforms to the μITRON specifications, the task status is the execution status (RU
N), ready state (READY), waiting state (WAIT), dormant state (DORMANT), etc., and the state changes between these. For example, when the waiting state is released for the task in the waiting state, the state of the task changes to the executable state.

【0076】スケジューリング手段102は、実行可能
状態にあるタスクのうち、実行するタスクにコンピュー
タのCPUを割り当て、ディスパッチ手段103にタス
クの切替を指示する。ディスパッチ手段103は、スケ
ジューリング手段102の指示に従い、タスクの切替
(ディスパッチ)を実行する。この切替によって、実行
可能状態にあったタスクの状態は、実行状態に変化す
る。さらに、ディスパッチ手段103は、コンテキス
ト、すなわち処理中のタスクの状態や環境の保存や復元
も行う。
The scheduling means 102 assigns the CPU of the computer to the task to be executed among the tasks in the executable state, and instructs the dispatch means 103 to switch the tasks. The dispatch unit 103 executes task switching (dispatch) according to the instruction of the scheduling unit 102. By this switching, the state of the task in the ready state changes to the running state. Further, the dispatch means 103 also saves and restores the context, that is, the state and environment of the task being processed.

【0077】また、スケジューリング手段102は、レ
ディキュー管理手段104に対するエイジング、ドロッ
プ、ローテイトの指示も定期的に行う。
The scheduling means 102 also periodically issues aging, drop, and rotate instructions to the ready queue management means 104.

【0078】レディキュー管理手段104は、実行可能
状態にある複数のタスクを優先度毎に管理し、またスケ
ジューリング手段102の指示に従いエイジング、ドロ
ップ、ローテイトを行う。
The ready queue management means 104 manages a plurality of tasks in the ready state for each priority, and performs aging, drop and rotation according to the instruction of the scheduling means 102.

【0079】レディキュー管理手段104は、図1に示
すようなポートリスト401を用いて優先度毎にタスク
を管理する。ポートリスト401は、複数の要素(タス
クキューポート)402を線状に連結したリスト構造を
有する。
The ready queue management means 104 manages the task for each priority by using the port list 401 as shown in FIG. The port list 401 has a list structure in which a plurality of elements (task queue ports) 402 are linearly connected.

【0080】各タスクキューポート402のインデック
スは優先度を表し、ポートリスト401の先頭のタスク
キューポート402から順に、0、1、2、…、(MAX_P
RI−2)、(MAX_PRI−1)というインデックスが与えられ
る。ここで、MAX_PRIは、優先度の最大値を表す。すな
わち、タスクキューポート402は、優先度の数だけ用
意される。
The index of each task queue port 402 represents a priority, and the task queue port 402 at the head of the port list 401 is sequentially numbered 0, 1, 2, ..., (MAX_P
RI-2) and (MAX_PRI-1) indexes are given. Here, MAX_PRI represents the maximum value of the priority. That is, as many task queue ports 402 as the number of priorities are prepared.

【0081】各タスクキューポート402は、それより
も一つだけ優先度が低い次順のタスクキューポート40
2へのポインタを保持することによって、次順のタスク
キューポート402と連結される。但し、ポートリスト
401の最後尾にあるタスクキューポート402Tは、
他のタスクキューポート402へのポインタを保持しな
い(Nullポインタを保持する)。
Each task queue port 402 has the next lower priority than the task queue port 40 by one.
By holding the pointer to 2, the task queue port 402 in the next order is connected. However, the task queue port 402T at the end of the port list 401 is
Do not hold pointers to other task queue ports 402 (hold Null pointers).

【0082】また、タスクキューポート402は、タス
クキュー403へのポインタを保持することによって、
タスクキュー403にも連結されることがある。
Further, the task queue port 402 holds the pointer to the task queue 403,
It may also be linked to the task queue 403.

【0083】タスクキュー403は、例えばタスクのリ
ストを用いた待ち行列(キュー)である。タスクは、予
め設定されたベース優先度を保持しており、基本的にタ
スクキュー403が連結されたタスクキューポート40
2のインデックスが表す優先度の値と当該タスクキュー
403に含まれるタスクのベース優先度の値は同じであ
る。図1ではタスクを○で表し、ベース優先度の値を○
の中の数字で表しており、例えばタスクキューポート4
021に連結されているタスクキュー403に含まれる
タスクのベース優先度の値は、当該タスクキューポート
4021のインデックスの値と同じ「1」である。但
し、エイジングなどによってタスクの(現在の)優先度
の値は、ベース優先度の値と一致しないことがある。
The task queue 403 is a queue (queue) using a list of tasks, for example. The task holds a preset base priority, and basically, the task queue port 40 to which the task queue 403 is connected
The value of the priority represented by the index of 2 and the value of the base priority of the tasks included in the task queue 403 are the same. In Fig. 1, tasks are represented by ○, and the base priority value is ○.
It is represented by the number in, for example, task queue port 4
The value of the base priority of the task included in the task queue 403 connected to the 021 is “1” which is the same as the value of the index of the task queue port 4021. However, the value of the (current) priority of the task may not match the value of the base priority due to aging or the like.

【0084】また、タスクキュー403に複数のタスク
が含まれている場合には、各タスクの優先度は同じであ
ることを意味する。この場合、実行可能状態になったの
がより遅い他のタスクがあるとき、タスクは、当該他の
タスクへのポインタを保持する。最も実行可能状態にな
ったのが早かったタスクは、タスクキュー403の先頭
(図面で最も左側)に位置することになる。
When the task queue 403 includes a plurality of tasks, it means that the tasks have the same priority. In this case, when there is another task that is in the ready state later, the task holds a pointer to the other task. The task that was in the earliest ready state is located at the head of the task queue 403 (the leftmost side in the drawing).

【0085】ランキュー403Rは、タスクキュー40
3のうちタスクに対する優先度が最も高いタスクキュー
403である。レディキュー管理手段104は、ランキ
ュー403Rに含まれるタスクのうち最も先頭側にある
実行可能状態のタスクを次に実行するタスクとしてスケ
ジューリング手段102に通知する。ランキュー403
Rには、実行状態にあるタスクも含まれる。実行状態に
あるタスクは、ランキュー403Rの先頭に位置するこ
とになる。
The run queue 403R is the task queue 40.
The task queue 403 has the highest priority among the three tasks. The ready queue management unit 104 notifies the scheduling unit 102 of the task in the ready state at the head of the tasks included in the run queue 403R as the task to be executed next. Run queue 403
R also includes tasks in the running state. The task in the execution state is located at the head of the run queue 403R.

【0086】ランキューポート402Rは、ランキュー
403Rが連結されたタスクキューポート4021への
ポインタを保持する。また、ランキューインデックス4
05は、ランキュー403が連結されたタスクキューポ
ート4021のインデックスを表す。図1の例では、ラ
ンキューインデックス405は「1」を表すことにな
る。さらに、ポートリストヘッド406は、ポートリス
ト401の先頭にあるタスクキューポート4020への
ポインタを保持し、ポートリストテイル407は、ポー
トリスト401の最後尾にあるタスクキューポート40
2Tへのポインタを保持する。
The run queue port 402R holds a pointer to the task queue port 4021 to which the run queue 403R is connected. In addition, run queue index 4
Reference numeral 05 represents an index of the task queue port 4021 to which the run queue 403 is connected. In the example of FIG. 1, the run queue index 405 will represent “1”. Further, the port list head 406 holds a pointer to the task queue port 4020 at the head of the port list 401, and the port list tail 407 holds the task queue port 40 at the tail of the port list 401.
Holds a pointer to 2T.

【0087】スケジューリング手段102からエイジン
グの指示があると、レディキュー管理手段104は、こ
のようなポートリスト401に対して操作を行う。
When the scheduling means 102 gives an aging instruction, the ready queue management means 104 operates on such a port list 401.

【0088】エイジングを行うにあたって、レディキュ
ー管理手段104は、予めランキューポート402Rの
保持するポインタ、ランキューインデックス405の値
を初期化する。
When performing aging, the ready queue management means 104 initializes the value of the run queue index 405 and the pointer held in the run queue port 402R in advance.

【0089】図3に示すように、まず、レディキュー管
理手段104は、ランキューポート402Rの保持する
ポインタrun_port及びランキューインデックス405の
保持する変数run_ixに、ポートリストヘッド406の保
持するポインタが表すアドレスport_list_head及び0を
それぞれ代入する(S301)。
As shown in FIG. 3, first, the ready queue management means 104 sets the pointer run_port held by the run queue port 402R and the variable run_ix held by the run queue index 405 to the address port_list_head indicated by the pointer held by the port list head 406. And 0 are respectively substituted (S301).

【0090】次に、レディキュー管理手段104は、ポ
インタrun_portの指すタスクキューポート402に、タ
スクキュー403が連結されているか否かを判断する
(S302)。タスクキュー403が連結されているか
否かの判断は、ポインタrun_portの指すタスクキューポ
ート402がタスクキュー403へのポインタを保持し
ているか否かによって行う。
Next, the ready queue management means 104 judges whether or not the task queue 403 is connected to the task queue port 402 pointed to by the pointer run_port (S302). Whether or not the task queue 403 is connected is determined by whether or not the task queue port 402 indicated by the pointer run_port holds a pointer to the task queue 403.

【0091】タスクキューポート402にタスクキュー
403が連結されていると判断した場合、そのまま初期
化処理を終了する。一方、タスクキューポート402に
タスクキュー403が連結されていないと判断した場
合、次順のタスクキューポート402のアドレスをポイ
ンタrun_portに代入し(S303)、ランキューインデ
ックス405の変数run_ixの値を1だけインクリメント
する(S304)。レディキュー管理手段104は、手
順S302において、タスクキューポート402にタス
クキュー403が連結されていると判断されるまで、手
順S303、S304を繰り返す。
If it is determined that the task queue 403 is connected to the task queue port 402, the initialization process is terminated. On the other hand, when it is determined that the task queue 403 is not connected to the task queue port 402, the address of the next task queue port 402 is assigned to the pointer run_port (S303), and the value of the variable run_ix of the run queue index 405 is set to 1 only. Increment (S304). The ready queue management means 104 repeats steps S303 and S304 until it is determined in step S302 that the task queue 403 is connected to the task queue port 402.

【0092】図1の例では、ポートリストヘッド406
が保持するのは、タスクキューポート4020へのポイ
ンタである。このポインタが表すアドレスは、手順S3
01においてポインタrun_portに代入されるから、手順
S302における判断は、タスクキューポート4020
について行われることになる。タスクキューポート40
20には、タスクキュー403が連結されていないか
ら、手順S303、S304が行われる。次順のタスク
キューポート402は、タスクキューポート4021で
ある。このタスクキューポート4021には、タスクキ
ュー403(ランキュー403R)が連結されているか
ら、初期化処理は終了する。初期化後のポインタrun_po
rtはタスクキューポート4021のアドレスを表し、変
数run_ixの値はタスクキューポート4021のインデッ
クスの値と一致する。
In the example of FIG. 1, the port list head 406.
Holds a pointer to the task queue port 4020. The address indicated by this pointer is the step S3.
Since the pointer is assigned to the pointer run_port in 01, the determination in step S302 is made in the task queue port 4020
Will be done. Task queue port 40
Since the task queue 403 is not linked to 20, the steps S303 and S304 are performed. The task queue port 402 in the next order is the task queue port 4021. Since the task queue 403 (run queue 403R) is connected to the task queue port 4021, the initialization process ends. Pointer run_po after initialization
rt represents the address of the task queue port 4021, and the value of the variable run_ix matches the index value of the task queue port 4021.

【0093】すなわち、初期化によって、ランキューポ
ート402Rは、ランキュー403Rが連結されたタス
クキューポート4021へのポインタを保持し、ランキ
ューインデックス405は、タスクキューポート402
1のインデックスを保持する。
That is, by the initialization, the run queue port 402R holds a pointer to the task queue port 4021 to which the run queue 403R is linked, and the run queue index 405 sets the task queue port 402.
Holds an index of 1.

【0094】上述のような初期化処理を経てエイジング
を行う場合には、図4に示すように、まずレディキュー
管理手段104は、ポインタrun_portの指すタスクキュ
ーポート402に連結されている次順のタスクキューポ
ート402に、タスクキュー403が連結されているか
否かを判断する(S401)。すなわち、ランキュー4
03Rが連結されたタスクキューポート402に連結さ
れている次順のタスクキューポート402に、タスクキ
ュー403が連結されているか否かを判断する。
When performing aging through the above initialization processing, as shown in FIG. 4, the ready queue management means 104 first sets the next order connected to the task queue port 402 indicated by the pointer run_port. It is determined whether the task queue 403 is connected to the task queue port 402 (S401). That is, run queue 4
It is determined whether the task queue 403 is connected to the next task queue port 402 connected to the task queue port 402 to which 03R is connected.

【0095】ランキュー403Rが連結されたタスクキ
ューポート402に連結されている次順のタスクキュー
ポート402に、タスクキュー403が連結されている
と判断した場合、レディキュー管理手段104は、当該
タスクキュー403をランキュー403Rの最後尾に連
結する(S402)。
If it is determined that the task queue 403 is connected to the next task queue port 402 that is connected to the task queue port 402 to which the run queue 403R is connected, the ready queue management means 104 determines 403 is linked to the end of the run queue 403R (S402).

【0096】ランキュー403Rが連結されたタスクキ
ューポート402に連結されている次順のタスクキュー
ポート402に、タスクキュー403が連結されていな
いと判断した場合、又は手順S402を経てから、レデ
ィキュー管理手段104は、当該次順のタスクキューポ
ート402を削除する(S403)。ランキュー403
Rが連結されたタスクキューポート402には、当該次
順のタスクキューポート402の代わりに次々順のタス
クキューポート402を連結する。
When it is judged that the task queue 403 is not connected to the next task queue port 402 which is connected to the task queue port 402 to which the run queue 403R is connected, or after the step S402, the ready queue management is performed. The means 104 deletes the next task queue port 402 (S403). Run queue 403
To the task queue port 402 to which R is connected, the next task queue port 402 is connected instead of the next task queue port 402.

【0097】次に、レディキュー管理手段104は、削
除したタスクキューポート402を、ポートリスト40
1の最後尾に連結する(S404)。削除したタスクキ
ューポート402は、それまで最後尾であったタスクキ
ューポート402の次順に連結されることになる。それ
まで最後尾であったタスクキューポート402は、ポー
トリストテイル407が保持するポインタによって直ぐ
に検索することができる。また、手順S404によって
最後尾のタスクキューポート402が変わるため、レデ
ィキュー管理手段104は、削除したタスクキューポー
ト402のアドレスをポートリストテイル407の保持
するポインタに代入する。
Next, the ready queue management means 104 replaces the deleted task queue port 402 with the port list 40.
It is connected to the end of 1 (S404). The deleted task queue port 402 is connected in the order next to the task queue port 402 that was the last task queue. The task queue port 402, which was the last one until then, can be immediately searched by the pointer held by the port list tail 407. Further, since the last task queue port 402 is changed in step S404, the ready queue management unit 104 substitutes the address of the deleted task queue port 402 into the pointer held by the port list tail 407.

【0098】図1の例では、ランキュー403Rが連結
されたタスクキューポート4021に連結された次順の
タスクキューポート4022には、タスクキュー403
が連結されていない。このため、手順S401における
判断に従い、手順S402を経ず、手順S403が行わ
れる。手順S403では、タスクキューポート4021
に、次順のタスクキューポート4022の代わりに次々
順のタスクキューポート4023が連結される。そし
て、手順S404において、タスクキューポート402
2は、それまでポートリスト401の最後尾にあったタ
スクキューポート402Tの次順に連結される。図5
(a)は、このときのポートリスト401の状態を示
す。
In the example of FIG. 1, the task queue 403 is connected to the next task queue port 4022 connected to the task queue port 4021 to which the run queue 403R is connected.
Is not connected. Therefore, according to the determination in step S401, step S403 is performed without passing through step S402. In step S403, the task queue port 4021
Further, instead of the next task queue port 4022, the next task queue port 4023 is connected. Then, in step S404, the task queue port 402
2 are connected in the order next to the task queue port 402T that was at the end of the port list 401 until then. Figure 5
(A) shows the state of the port list 401 at this time.

【0099】図5(a)に示すように、上述のエイジン
グによって、ベース優先度の値が「3」のタスク404
6を含むタスクキュー403が連結されたタスクキュー
ポート4023は、タスクキューポート4021の次順
に連結されている。すなわち、ベース優先度の値が
「3」のタスク4046の(現在の)優先度は、一つ上
がって「2」となる。同様に、タスクキューポート40
23の次順以降にあるタスクキューポート402に連結
されたタスクキュー403に含まれるタスク4046の
優先度も、一つ上がる。図4のフローチャートから明ら
かなように、これらのタスクキューポート402に連結
されたタスクキュー403に含まれるタスクの優先度を
上げるのに行っている操作は、基本的に手順S403に
おける操作のみである。タスクキューポート4023に
次順以降のタスクキューポート402が連結されている
ため、タスクキューポート4023さえ、タスクキュー
ポート4021に連結してしまえば、各タスクキューポ
ート402について操作を行う必要がない。従って、優
先度の最大値が大きく(タスクキューポート402の数
が多く)なっても、エイジングにおけるオーバーヘッド
の増大を回避することができる。
As shown in FIG. 5A, the task 404 whose base priority value is "3" is a result of the above aging.
The task queue port 4023, to which the task queue 403 including 6 is connected, is connected in the order following the task queue port 4021. That is, the (current) priority of the task 4046 whose base priority value is “3” is increased by one to “2”. Similarly, the task queue port 40
The priority of the task 4046 included in the task queue 403 connected to the task queue port 402 subsequent to the order 23 is also increased by one. As is apparent from the flowchart of FIG. 4, the operation performed to raise the priority of the tasks included in the task queue 403 connected to these task queue ports 402 is basically only the operation in step S403. . Since the task queue port 402 is connected to the task queue port 402 in the next order and below, even if the task queue port 4023 is connected to the task queue port 4021, it is not necessary to operate each task queue port 402. Therefore, even if the maximum value of the priority is large (the number of task queue ports 402 is large), it is possible to avoid an increase in the overhead in aging.

【0100】また、優先度の最大値を保持するために
は、削除したタスクキューポート402をポートリスト
401のいずれかの部分に連結しておく必要があるが、
ポートリスト401の最後尾に連結すれるのであれば、
検索が容易で、しかもエイジング操作に影響を与えな
い。
To retain the maximum priority value, the deleted task queue port 402 needs to be linked to any part of the port list 401.
If you can connect to the end of the port list 401,
It is easy to search and does not affect the aging operation.

【0101】なお、図5(a)の例では、ベース優先度
の値が「3」のタスク4046は、タスクキューポート
4023に連結されたタスクキュー403に含まれてお
り、依然としてランキュー403Rには含まれていな
い。このため、ランキュー403Rにタスクが残ってい
る限り、ベース優先度の値が「3」のタスク4046が
実行されないことに変わりはないが、エイジングは定期
的に行われる。
In the example of FIG. 5A, the task 4046 having the base priority value of "3" is included in the task queue 403 connected to the task queue port 4023, and the run queue 403R is still in the run queue 403R. Not included. Therefore, as long as tasks remain in the run queue 403R, the task 4046 having a base priority value of "3" is not executed, but aging is performed regularly.

【0102】例えば図5(a)の状態からエイジングが
もう一度行われた場合、ランキュー403Rが連結され
たタスクキューポート4021に連結された次順のタス
クキューポート4023には、タスクキュー403が連
結されている。このため、手順S401における判断に
従い、手順S402が行われる。手順S402におい
て、タスクキューポート4023に連結されているタス
クキュー403は、ランキューポート403Rの最後尾
に連結される。すなわち、ベース優先度の値が「3」の
タスク4046は、図5(b)に示すように、ランキュ
ーポート403Rに含まれるタスクのうち最後尾にあっ
たベース優先度の値が「1」のタスク4047の次順に
連結される。従って、ベース優先度の値が「1」のタス
ク4047がランキュー403Rから削除されたり、ス
ケジューリング手段102の指示に従って、レディキュ
ー管理手段104がローテイトを実行すれば、ベース優
先度の値が「3」のタスク4046も実行されるような
状態となる。
For example, when aging is performed again from the state of FIG. 5A, the task queue 403 is connected to the next task queue port 4023 connected to the task queue port 4021 to which the run queue 403R is connected. ing. Therefore, step S402 is performed according to the determination in step S401. In step S402, the task queue 403 connected to the task queue port 4023 is connected to the end of the run queue port 403R. That is, as shown in FIG. 5B, the task 4046 having the base priority value of “3” has the base priority value of “1” at the end of the tasks included in the run queue port 403R. Tasks 4047 are linked in order. Therefore, if the task 4047 having a base priority value of "1" is deleted from the run queue 403R or the ready queue management means 104 executes rotation according to an instruction from the scheduling means 102, the base priority value is "3". The task 4046 is also executed.

【0103】上述のようなエイジングによって優先度が
上がったタスクが実行されると、スケジューリング手段
102の指示に従い、レディキュー管理手段104は当
該タスクについてドロップを行う。実行されるのはラン
キュー403Rの先頭にあるタスクであるから、ドロッ
プするタスクは、ランキュー403Rの先頭に位置する
ことになる。
When the task whose priority has been raised by the aging as described above is executed, the ready queue management means 104 drops the task according to the instruction of the scheduling means 102. Since the task at the head of the run queue 403R is executed, the task to be dropped is located at the head of the run queue 403R.

【0104】ドロップを行う場合、図6に示すように、
まずレディキュー管理手段104は、ランキュー403
Rの先頭にある(ドロップ対象の)タスクを、ランキュ
ー403Rから削除する(S601)。
When dropping, as shown in FIG.
First, the ready queue management unit 104 uses the run queue 403.
The task (drop target) at the head of R is deleted from the run queue 403R (S601).

【0105】次にレディキュー管理手段104は、ポイ
ンタ_run_port、変数_run_ixそれぞれに、ランキューポ
ート402Rの保持するポインタrun_portが表すアドレ
ス、ランキューインデックス405の保持する変数run_
ixの値を代入する(S602)。
Next, the ready queue management means 104, for each pointer_run_port and variable _run_ix, the address indicated by the pointer run_port held by the run queue port 402R and the variable run_ held by the run queue index 405.
The value of ix is substituted (S602).

【0106】次に、レディキュー管理手段104は、削
除したタスクのベース優先度の値base_priと変数_run_i
xの値とが等しいか否かを判断する(S603)。
Next, the ready queue management means 104 uses the base priority value base_pri and the variable _run_i of the deleted task.
It is determined whether or not the value of x is equal (S603).

【0107】削除したタスクのベース優先度の値base_p
riと変数_run_ixの値とが等しくないと判断した場合、
ポインタ_run_portが指すタスクキューポート402に
連結された次順のタスクキューポート402のアドレス
をポインタ_run_portに代入する(S604)。さら
に、変数_run_ixの値を1だけインクリメントする(S
605)。そして、レディキュー管理手段104は、手
順S603において、削除したタスクのベース優先度の
値base_priと変数_run_ixの値とが等しいと判断するま
で手順S604、S605を繰り返す。
Value of base priority of deleted task base_p
If it determines that ri and the value of variable _run_ix are not equal,
The address of the next task queue port 402 connected to the task queue port 402 pointed to by pointer_run_port is assigned to pointer_run_port (S604). Further, the value of the variable _run_ix is incremented by 1 (S
605). Then, the ready queue management means 104 repeats steps S604 and S605 until it determines in step S603 that the base priority value base_pri of the deleted task is equal to the value of the variable _run_ix.

【0108】手順S603において、削除したタスクの
ベース優先度の値base_priと変数_run_ixの値とが等し
いと判断した場合、レディキュー管理手段104は、そ
のときのポインタ_run_portが指すタスクキューポート
402に、削除したタスクを連結する(S606)。
In step S603, when it is determined that the base priority value base_pri of the deleted task and the value of the variable _run_ix are equal, the ready queue management means 104 determines the task queue port 402 pointed to by the pointer _run_port at that time. Then, the deleted tasks are linked (S606).

【0109】次に、レディキュー管理手段104は、ラ
ンキュー403Rに含まれていたタスクが削除したタス
クのみであったか否かを判断する(S607)。
Next, the ready queue management means 104 judges whether or not the tasks included in the run queue 403R are only the deleted tasks (S607).

【0110】ランキュー403Rに含まれていたタスク
が削除したタスクのみであったと判断した場合、レディ
キュー管理手段104は、ランキューポート402Rが
保持するポインタ、ランキューインデックス405の値
を更新する更新処理を行う(S608)。
When it is determined that the tasks included in the run queue 403R are only the deleted tasks, the ready queue management means 104 performs an update process for updating the pointer held by the run queue port 402R and the value of the run queue index 405. (S608).

【0111】図7に示すように、この更新処理では、ま
ずレディキュー管理手段104は、ポインタrun_portが
指すタスクキューポート402に、タスクキュー403
Rが連結されているか否かを判断する(S701)。
As shown in FIG. 7, in this update processing, the ready queue management means 104 first puts the task queue 403 in the task queue port 402 pointed to by the pointer run_port.
It is determined whether R is connected (S701).

【0112】ポインタrun_portが指すタスクキューポー
ト402に、タスクキュー403Rが連結されていない
と判断した場合、当該タスクキューポート402に連結
された次順のタスクキューポート402のアドレスを、
ポインタrun_portに代入する(S702)。さらに、変
数run_ixの値を1だけインクリメントする(S70
3)。そして、レディキュー管理手段104は、手順S
701において、ポインタrun_portが指すタスクキュー
ポート402に、タスクキュー403Rが連結されてい
ると判断するまで手順S702、S703を繰り返す。
When it is determined that the task queue 403R is not connected to the task queue port 402 pointed to by the pointer run_port, the address of the next task queue port 402 connected to the task queue port 402 is set to
It is assigned to the pointer run_port (S702). Further, the value of the variable run_ix is incremented by 1 (S70
3). Then, the ready queue management unit 104 performs the procedure S.
In step 701, steps S702 and S703 are repeated until it is determined that the task queue 403R is connected to the task queue port 402 pointed to by the pointer run_port.

【0113】手順S701において、ポインタrun_port
が指すタスクキューポート402に、タスクキュー40
3Rが連結されていると判断した場合、更新処理は終了
する。
In step S701, the pointer run_port
Task queue port 402 points to the task queue 40
If it is determined that the 3Rs are connected, the update process ends.

【0114】そして、このようにして更新処理が終了す
るか、手順S607において、ランキュー403Rに含
まれていたタスクが削除したタスクのみでないと判断し
た場合、ドロップは終了する。
When the update process is completed in this way or when it is determined in step S607 that the tasks included in the run queue 403R are not the only deleted tasks, the drop ends.

【0115】例えばドロップ直前のポートリスト401
の状態が図8(a)に示すようなものであったとする。
すなわち、タスクキューポート402aに連結されたラ
ンキュー403Rの先頭に、ベース優先度の値が「4」
のタスク4048が位置していたとする。
For example, the port list 401 immediately before the drop
It is assumed that the state of is as shown in FIG.
That is, the base priority value is "4" at the head of the run queue 403R connected to the task queue port 402a.
Task 4048 is located.

【0116】この状態に対してドロップがなされたとす
ると、まず手順S601において、ランキュー403R
の先頭にあるベース優先度の値が「4」のタスク404
8が、ランキュー403Rから削除される。手順S60
2では、ポインタ_run_port、変数_run_ixそれぞれに、
タスクキューポート402aのアドレス、ランキューイ
ンデックスの値「1」が代入される。ベース優先度の値
「4」と変数_run_ixの値「1」は等しくないから、手
順S603における判断に従って、手順S604、S6
05が行われる。手順S604では、タスクキューポー
ト402aに連結された次順のタスクキューポート40
2bのアドレスがポインタ_run_portに代入される。手
順S605では、変数_run_ixの値がインクリメントさ
れ、「2」となる。手順S605の後、手順S603が
行われるが、このときの変数_run_ixの値は「2」であ
るので、ベース優先度の値「4」とは等しくない。この
ため、手順S603における判断に従って、手順S60
4、S605が繰り返される。その結果、タスクキュー
ポート402cのアドレスがポインタ_run_portに代入
され、変数_run_ixの値は「3」になる。この後、手順
S603が行われるが、このときの変数_run_ixの値は
「3」であるので、やはりベース優先度の値「4」とは
等しくない。従って、手順S604、S605が行わ
れ、ポインタ_run_portはタスクキューポート402d
のアドレスを表し、変数_run_ixの値は「4」になる。
すなわち、次の手順S603では、変数_run_ixの値
は、ベース優先度の値「4」とは等しくなる。このた
め、手順S603における判断に従って、手順S606
が行われ、図8(b)に示すように、削除した優先度の
値が「4」のタスク4048を含むタスクキュー403
が、ポインタ_run_portの指すタスクキューポート40
2dに連結される。そして、図8(a)の例では、削除
した優先度の値が「4」のタスク4048の他に、ラン
キュー403Rには優先度の値が「1」のタスク404
9も含まれているから、手順S608における判断に従
い、手順S609を経ず、ドロップは終了する。
If a drop is performed in this state, first in step S601, the run queue 403R
Task 404 whose base priority value is “4” at the beginning of the
8 is deleted from the run queue 403R. Step S60
In 2, the pointer _run_port and the variable _run_ix,
The address of the task queue port 402a and the value “1” of the run queue index are substituted. Since the value "4" of the base priority and the value "1" of the variable _run_ix are not equal to each other, steps S604 and S6 are performed according to the determination in step S603.
05 is performed. In step S604, the next task queue port 40 connected to the task queue port 402a is connected.
The address of 2b is assigned to the pointer_run_port. In step S605, the value of variable _run_ix is incremented to "2". After step S605, step S603 is performed. Since the value of the variable _run_ix at this time is "2", it is not equal to the base priority value "4". Therefore, in accordance with the determination in step S603, step S60
4, S605 is repeated. As a result, the address of the task queue port 402c is assigned to the pointer_run_port, and the value of the variable _run_ix becomes “3”. After that, step S603 is performed, but the value of the variable _run_ix at this time is “3”, and therefore the value of the base priority is not equal to “4”. Therefore, steps S604 and S605 are performed, and the pointer_run_port is the task queue port 402d.
, And the value of the variable _run_ix is “4”.
That is, in the next step S603, the value of the variable _run_ix becomes equal to the base priority value “4”. Therefore, according to the determination in step S603, step S606
As shown in FIG. 8B, the task queue 403 including the deleted task 4048 whose priority value is “4” is displayed.
Is the task queue port 40 pointed to by the pointer _run_port
It is connected to 2d. In addition, in the example of FIG. 8A, in addition to the deleted task 4048 whose priority value is “4”, the task 404 whose priority value is “1” is stored in the run queue 403R.
Since 9 is also included, according to the determination in step S608, the drop ends without passing through step S609.

【0117】なお、上述の実施の形態1では、タスクキ
ューポート402は、次順のタスクキューポート402
へのポインタやタスクキュー403へのポインタを保持
したが、これに加えて、連結されたタスクキュー403
の最後尾にあるタスクへのポインタも保持するようにし
てもよい。これによって、タスクキュー403の最後尾
に他のタスクキュー403を連結する操作を高速に行う
ことができる。
In the first embodiment described above, the task queue port 402 is the next task queue port 402.
A pointer to the task queue 403 and a pointer to the task queue 403 are held.
You may also hold the pointer to the task at the end of the. As a result, the operation of connecting another task queue 403 to the end of the task queue 403 can be performed at high speed.

【0118】また、ポートリスト401や、タスクキュ
ー403などに対する操作は、これらについてそれぞれ
割り当てられたコンピュータのメモリに対して、上述の
リアルタイムOSによって制御されるコンピュータのC
PUが操作を行うことによって実現される。
In addition, operations on the port list 401, the task queue 403, etc. are performed by the C of the computer controlled by the above-mentioned real-time OS with respect to the memory of the computer respectively assigned to them.
It is realized by the PU performing an operation.

【0119】(実施の形態2)この実施の形態2におい
て、レディキュー管理手段104は、図9に示すよう
に、タスクキューポート検索手段105を有しており、
ポートリスト401だけでなく、図10(a)に示すよ
うなポートテーブル410、更新インデックス412も
用いてタスクを管理する。
(Second Embodiment) In this second embodiment, the ready queue management means 104 has a task queue port search means 105 as shown in FIG.
The tasks are managed using not only the port list 401 but also the port table 410 and the update index 412 as shown in FIG.

【0120】ポートテーブル410は、例えば優先度の
最大値MAX_PRIと同じ数の要素411が、タスクキュー
ポート402の順序に対応して配列されたテーブルであ
る。各要素411のインデックスは、タスクの優先度の
値に対応し、初期状態で同じインデックスを有するタス
クキューポート402へのポインタをそれぞれ保持す
る。
The port table 410 is, for example, a table in which the same number of elements 411 as the maximum priority value MAX_PRI are arranged in correspondence with the order of the task queue ports 402. The index of each element 411 corresponds to the task priority value, and holds a pointer to the task queue port 402 having the same index in the initial state.

【0121】タスクキューポート検索手段105は、ド
ロップの対象となるタスクのベース優先度と同じ値の優
先度に対応するインデックスの要素411が保持するポ
インタを用いて、当該インデックスのタスクキューポー
ト402を検索するものである。
The task queue port retrieving means 105 uses the pointer held by the element 411 of the index corresponding to the priority having the same value as the base priority of the task to be dropped to find the task queue port 402 of the index. It is something to search for.

【0122】また、更新インデックス412は、保持す
るポインタが指すタスクキューポート402とインデッ
クスが一致しない要素411のインデックスのうち、最
小の値を保持する。初期状態では、全要素411のイン
デックスの値が、各要素411の保持するポインタが指
すタスクキューポート402のインデックスの値と一致
するため、更新インデックス412の保持する変数upda
te_ixの値は(MAX_PRI−1)よりも一つ大きいMAX_PRIに
なる。
The update index 412 holds the smallest value among the indexes of the element 411 whose index does not match the task queue port 402 pointed to by the held pointer. In the initial state, the index values of all the elements 411 match the index values of the task queue port 402 pointed to by the pointer held by each element 411, so the variable upda held by the update index 412
The value of te_ix becomes MAX_PRI which is one more than (MAX_PRI-1).

【0123】スケジューリング手段102からエイジン
グ等の指示があると、レディキュー管理手段104は、
ポートリスト401、ポートテーブル410、更新イン
デックス412などについて操作を行う。
When the scheduling means 102 gives an instruction such as aging, the ready queue management means 104
Operations are performed on the port list 401, the port table 410, the update index 412, and the like.

【0124】エイジングを行うにあたって、レディキュ
ー管理手段104は、上述の実施の形態1と同様に、ラ
ンキューポート402Rの保持するポインタrun_port、
ランキューインデックス405の保持する変数run_ixを
初期化する。
When performing aging, the ready queue management means 104, as in the above-described first embodiment, has a pointer run_port held by the run queue port 402R,
The variable run_ix held by the run queue index 405 is initialized.

【0125】この初期化を経て、レディキュー管理手段
104が行うエイジングの手順も、図11に示すよう
に、手順S401から手順S404までは上述の通りで
ある。この実施の形態2では、レディキュー管理手段1
04は、手順S404の後エイジングを終了する前に手
順S1001を行う。
The aging procedure performed by the ready queue management means 104 after this initialization is the same as described above from step S401 to step S404, as shown in FIG. In the second embodiment, the ready queue management means 1
04 performs step S1001 after step S404 and before ending aging.

【0126】手順S1001は、レディキュー管理手段
104が、更新インデックス412の保持する変数upda
te_ixに、ランキューインデックス405の保持する変
数run_ixの値に1を加えた値を代入する手順である。
In step S1001, the ready queue management means 104 stores the variable upda stored in the update index 412.
This is a procedure of substituting te_ix with a value obtained by adding 1 to the value of the variable run_ix held by the run queue index 405.

【0127】図10(a)のような状態にあったポート
リスト401、ポートテーブル410に対してエイジン
グが行われた場合、ランキュー403Rが連結されたタ
スクキューポート402には、図10(b)に示すよう
に、当該タスクキューポート402の次々順にあったタ
スクキューポート402Bが連結される。当該タスクキ
ューポート402の次順にあったタスクキューポート4
02Aは、ポートリスト401の最後尾に連結される。
When aging is performed on the port list 401 and the port table 410 in the state shown in FIG. 10A, the task queue port 402 to which the run queue 403R is connected is shown in FIG. As shown in FIG. 5, the task queue ports 402B that are in sequence with the task queue port 402 are connected. Task queue port 4 that was in the next order of the task queue port 402
02A is linked to the end of the port list 401.

【0128】また、手順S1001によって、ランキュ
ーインデックス405の値「1」に1を加えた「2」と
いう値が、更新インデックス412の保持する変数upda
te_ixに代入される。更新インデックス412の保持す
る変数update_ixの値は、インデックスがこの値以上の
要素411(要素4112以降の要素)に保持されたポ
インタの指すタスクキューポート402のインデックス
が、当該要素411とは異なっていることを表す。例え
ばインデックスの値が「2」である要素4112に保持
されたポインタの指すタスクキューポート402Aのイ
ンデックスの値は、エイジング後には(MAX_PRI−1)
となり、要素4112とは異なっている。また、インデ
ックスの値が「3」以上の要素411に保持されたポイ
ンタの指すタスクキューポート402のインデックスの
値は、エイジング後には、1だけ小さくなる。すなわ
ち、これらのタスクキューポート402に連結されたタ
スクキュー403に含まれるタスクの優先度が1つ上が
る。
In step S1001, the value "2" obtained by adding 1 to the value "1" of the run queue index 405 is the variable upda held by the update index 412.
It is assigned to te_ix. As for the value of the variable update_ix held by the update index 412, the index of the task queue port 402 pointed to by the pointer held by the element 411 (element 4112 and subsequent elements) whose index is equal to or greater than this value is different from that element 411. It means that. For example, the index value of the task queue port 402A pointed to by the pointer held in the element 4112 whose index value is “2” is (MAX_PRI-1) after aging.
And is different from element 4112. In addition, the index value of the task queue port 402 pointed to by the pointer held in the element 411 having an index value of “3” or more decreases by 1 after aging. That is, the priority of the tasks included in the task queue 403 connected to these task queue ports 402 is increased by one.

【0129】次に、ドロップを行う場合について説明す
ると、図12に示すように、まずレディキュー管理手段
104は、上述の実施の形態1と同様、ランキュー40
3Rの先頭にあるタスクを、ランキュー403Rから削
除する(S1201)。
Next, the case of performing the drop will be described. As shown in FIG. 12, first, the ready queue management means 104, similar to the first embodiment, executes the run queue 40.
The task at the head of 3R is deleted from the run queue 403R (S1201).

【0130】次にタスクキューポート検索手段105
が、更新インデックス412の保持する変数update_ix
の値が、削除したタスクのベース優先度の値base_priよ
りも大きいか否かを判断する(S1202)。
Next, the task queue port search means 105
Is the variable update_ix held by the update index 412
Value is larger than the base priority value base_pri of the deleted task (S1202).

【0131】更新インデックス412の保持する変数up
date_ixの値が、削除したタスクのベース優先度の値bas
e_pri以下であると判断した場合、タスクキューポート
検索手段105は、優先度を表すインデックスの値が
(update_ix−1)の要素411の保持するポインタを
用いて、当該ポインタが指すタスクキューポート402
を検索する。タスクキューポート検索手段105は、検
索したタスクキューポート402の次順タスクキューポ
ート402のアドレスを、インデックスの値がupdate_i
xの要素411の保持するポインタに代入する(S12
03)。さらに、変数update_ixの値を1だけインクリ
メントする(S1204)。そして、タスクキューポー
ト検索手段105は、手順S1202において、更新イ
ンデックス412の保持する変数update_ixの値が、削
除したタスクのベース優先度の値base_priよりも大きい
と判断するまで、手順S1203、S1204を繰り返
す。
Variable up held by update index 412
The value of date_ix is the base priority value bas of the deleted task
When it is determined that the value is equal to or less than e_pri, the task queue port search unit 105 uses the pointer held by the element 411 whose index value indicating the priority is (update_ix-1) and uses the task queue port 402 to which the pointer points.
To search. The task queue port search unit 105 updates the address of the next-order task queue port 402 of the searched task queue port 402 with the index value update_i.
Substitute the pointer held by the element 411 of x (S12
03). Further, the value of the variable update_ix is incremented by 1 (S1204). Then, the task queue port search unit 105 repeats steps S1203 and S1204 until it determines in step S1202 that the value of the variable update_ix held by the update index 412 is larger than the base priority value base_pri of the deleted task. .

【0132】手順S1202において、更新インデック
ス412の保持する変数update_ixの値が、削除したタ
スクのベース優先度の値base_priよりも大きいと判断し
た場合、タスクキューポート検索手段105が、ベース
優先度の値base_priと同じインデックスの値の要素41
1が保持するポインタを用いて、当該ポインタが指すタ
スクキューポート402を検索する。レディキュー管理
手段104は、検索されたタスクキューポート402に
連結されたタスクキュー403の最後尾に削除したタス
クを連結する(S1205)。
In step S1202, when it is determined that the value of the variable update_ix held by the update index 412 is larger than the base priority value base_pri of the deleted task, the task queue port searching means 105 determines that the base priority value is the same. Element 41 with the same index value as base_pri
The pointer held by 1 is used to search the task queue port 402 pointed to by the pointer. The ready queue management unit 104 connects the deleted task to the end of the task queue 403 connected to the retrieved task queue port 402 (S1205).

【0133】そして、レディキュー管理手段104は、
上述の実施の形態1と同様、ランキュー403Rに含ま
れていたタスクが削除したタスクのみであったか否かを
判断する(S1206)。ランキュー403Rに含まれ
ていたタスクが削除したタスクのみであったと判断した
場合、レディキュー管理手段104は、ランキューポー
ト402Rが保持するポインタ、ランキューインデック
ス405の値を更新する更新処理を行う(S120
7)。
Then, the ready queue management means 104
Similar to the first embodiment described above, it is determined whether the tasks included in the run queue 403R are only the deleted tasks (S1206). When the ready queue management unit 104 determines that the tasks included in the run queue 403R are only the deleted tasks, the ready queue management unit 104 performs an update process for updating the pointer held by the run queue port 402R and the value of the run queue index 405 (S120).
7).

【0134】例えばドロップ直前のポートリスト40
1、ポートテーブル410の状態が図13(a)に示す
ようなものであったとする。すなわち、ランキュー40
3Rの先頭に、ベース優先度の値が「3」のタスク40
40が位置していたとする。また、更新インデックス4
12の保持する変数update_ixの値は「2」である。
For example, the port list 40 immediately before the drop
1. Assume that the state of the port table 410 is as shown in FIG. That is, the run queue 40
At the head of 3R, the task 40 whose base priority value is "3"
Suppose 40 was located. Also, update index 4
The value of the variable update_ix held by 12 is “2”.

【0135】この状態に対してドロップがなされたとす
ると、まず手順S1201において、ランキュー403
Rの先頭にあるベース優先度の値base_priが「3」のタ
スク4040が、ランキュー403Rから削除される。
変数update_ixの値は「2」であり、削除されたタスク
4040のベース優先度の値base_pri「3」よりも小さ
いから、手順S1202における判断に従って、手順S
1203、手順S1204が行われる。手順S1202
では、変数update_ixの値より1だけ小さいインデック
ス、すなわちインデックスの値が「1」の要素4111
の保持するポインタを用いて、当該ポインタが指すタス
クキューポート402Cが検索される。変数update_ix
の値より小さいインデックスの要素411の保持するポ
インタが指すタスクキューポート402のインデックス
の値は、当該要素411と同じであるから、ここでの検
索は適切に行われる。検索されたタスクキューポート4
02Cには、次順にあるタスクキューポート402Dへ
のポインタが保持されている。そこで、当該ポインタの
表すアドレスが、インデックスの値が「2」の要素41
12の保持するポインタに代入される。次に、手順S1
204では、変数update_ixの値が1だけインクリメン
トされ、「3」となる。
If a drop is performed in this state, first in step S1201, the run queue 403
The task 4040 having the base priority value base_pri of “3” at the head of R is deleted from the run queue 403R.
The value of the variable update_ix is “2”, which is smaller than the base priority value base_pri “3” of the deleted task 4040. Therefore, according to the determination in step S1202, step S1202 is performed.
Step 1203 and step S1204 are performed. Step S1202
Then, an index smaller than the value of the variable update_ix by 1, that is, the element 4111 whose index value is “1”
The task queue port 402C pointed to by the pointer is searched using the pointer held by the. Variable update_ix
Since the index value of the task queue port 402 indicated by the pointer held by the element 411 having an index smaller than the value of is the same as that of the element 411, the search here is appropriately performed. Searched task queue port 4
02C holds a pointer to the next task queue port 402D. Therefore, the address represented by the pointer is the element 41 whose index value is "2".
It is assigned to the pointer held by 12. Next, step S1
At 204, the value of the variable update_ix is incremented by 1 and becomes “3”.

【0136】インクリメントされても、変数update_ix
の値は、削除されたタスク4040のベース優先度の値
base_priと同じ「3」であるから、手順S1202にお
ける判断に従って、再び手順S1203、S1204が
行われる。手順S1203では、タスクキューポート4
02Dの保持するタスクキューポート402Eへのポイ
ンタの表すアドレスが、インデックスの値が「3」の要
素411の保持するポインタに代入される。さらに、手
順S1204では、変数update_ixの値が「4」にされ
る。
Even if it is incremented, the variable update_ix
Is the base priority value of the deleted task 4040.
Since it is the same "3" as base_pri, steps S1203 and S1204 are performed again according to the determination in step S1202. In step S1203, task queue port 4
The address indicated by the pointer to the task queue port 402E held by 02D is substituted for the pointer held by the element 411 whose index value is "3". Further, in step S1204, the value of the variable update_ix is set to "4".

【0137】この後、手順S1202が行われるが、変
数update_ixの値は、削除されたタスク4040のベー
ス優先度の値base_priより大きくなっているから、手順
S1205が行われる。手順S1205では、ベース優
先度の値base_priと値が同じインデックス「3」の要素
411の保持するポインタが指すタスクキューポート4
02Eが検索される。このポインタは更新されたばかり
であり、検索は適切に行われる。そして、図13(b)
に示すように、タスクキューポート402Eに連結され
たタスクキュー403の最後尾に、削除したタスク40
40が連結される。
After this, step S1202 is performed, but since the value of the variable update_ix is larger than the base priority value base_pri of the deleted task 4040, step S1205 is performed. In step S1205, the task queue port 4 pointed to by the pointer held by the element 411 of the index "3" having the same value as the base priority value base_pri.
02E is searched. This pointer has just been updated and the search is done properly. And FIG. 13 (b)
As shown in, the deleted task 40 is added at the end of the task queue 403 connected to the task queue port 402E.
40 are connected.

【0138】このようにしてドロップを行えば、削除し
たタスクを連結するタスクキュー403が連結されたタ
スクキューポート402が定まるまで、逐一ポートリス
ト401の先頭からタスクキューポート402を辿って
いく必要がなくなる。要素411の保持するタスクキュ
ーポート402へのポインタが適切に更新されれば、当
該ポインタによってポートリスト401の途中にあるタ
スクキューポート402を得ることができる。また、ド
ロップの際にタスクキューポート402へのポインタが
更新されるのは、必要最小限の要素411についてのみ
である。従って、ドロップがエイジングよりも頻繁に起
こることがあっても、ドロップにおけるオーバーヘッド
の増大を抑えることができる。
When the drop is performed in this way, it is necessary to trace the task queue port 402 from the beginning of the port list 401 one by one until the task queue port 402 to which the task queue 403 that links the deleted tasks is linked is determined. Disappear. If the pointer to the task queue port 402 held by the element 411 is appropriately updated, the task queue port 402 in the middle of the port list 401 can be obtained by the pointer. Further, the pointer to the task queue port 402 is updated at the time of dropping only for the minimum necessary elements 411. Therefore, even if drops occur more frequently than aging, it is possible to suppress an increase in overhead in drops.

【0139】なお、図10(b)にも示されている通
り、要素411のインデックスの値が、ドロップ後の更
新インデックス412が保持する変数の値以下であれ
ば、当該要素411の保持するタスクキューポート40
2へのポインタは更新されていない。この更新は、ドロ
ップ時にとりわけ行う必要はなく、例えばシステムがア
イルドル状態の際に、これらポインタの更新を行うよう
にすればよい。この更新は、手順S1202におけるベ
ース優先度の値base_priを、優先度の最大値MAX_PRIに
置き換えて、手順S1202、S1203、S1204
を行うことによって実施することができる。
As shown in FIG. 10B, if the value of the index of the element 411 is less than or equal to the value of the variable held by the post-drop update index 412, the task held by the element 411 Cue port 40
The pointer to 2 has not been updated. This update does not need to be performed at the time of dropping, and for example, these pointers may be updated when the system is in the idle state. In this update, the base priority value base_pri in step S1202 is replaced with the maximum priority value MAX_PRI, and steps S1202, S1203, and S1204 are performed.
Can be carried out.

【0140】また、上述の実施の形態1、2において、
レディキュー管理手段104が、スケジューリング手段
102の指示に従い、ローテイトを行うようにしてもよ
い。ローテイトの処理については、例えば図30で示し
た手順に従えばよい。
Further, in the above-mentioned first and second embodiments,
The ready queue management means 104 may perform rotation according to an instruction from the scheduling means 102. Regarding the rotation process, for example, the procedure shown in FIG. 30 may be followed.

【0141】また、上述のタスク管理装置は、例えばデ
ジタル家電や携帯電話などの組込み機器として実施され
ることがある。組込み機器は、汎用のコンピュータと異
なり、特定の用途を有しているが、汎用のコンピュータ
と同様、プログラムを記憶するメモリと、当該メモリに
記憶されたプログラムを実行するプロセッサを有してい
る。組込み機器にシステムコール処理手段101、スケ
ジューリング手段102、ディスパッチ手段103及び
レディキュー管理手段104を備えさせるには、例えば
当該組込み機器に合わせて実装した上述のリアルタイム
OSを当該組込み機器のメモリに記憶しておけばよい。
The task management device described above may be implemented as an embedded device such as a digital home appliance or a mobile phone. Unlike a general-purpose computer, an embedded device has a specific purpose, but like a general-purpose computer, it has a memory that stores a program and a processor that executes the program stored in the memory. In order to provide the embedded device with the system call processing means 101, the scheduling means 102, the dispatch means 103, and the ready queue management means 104, for example, the above-mentioned real-time OS mounted according to the embedded device is stored in the memory of the embedded device. You can leave it.

【0142】(実施の形態3)この実施の形態3では、
図14に示すようにタスクが関連付けられているタスク
キューポートのみが配列されたポートリスト401に対
して行うエイジングについて説明する。各タスクキュー
ポートは、関連付けられているタスクのベース優先度の
値base_priを表す値を保持要素優先度の値ele_priとし
て保持している。各タスクキューポートに関連付けられ
たタスクのベース優先度の値base_priと各タスクキュー
ポートに保持される保持要素優先度の値ele_pleは、エ
イジングが行われると一致しなくなることがある。図1
4では、各タスクキューポート4080、4082の保
持要素優先度の値ele_priをタスクキューポート408
0、4082内に書き込まれている数値で表している。
更に、各タスクキューポートは、次順のタスクキューポ
ートへのポインタを保持することで、次順のタスクキュ
ーポートと連結されている。
(Third Embodiment) In the third embodiment,
Aging performed on the port list 401 in which only task queue ports associated with tasks as shown in FIG. 14 are arranged will be described. Each task queue port holds a value representing the base priority value base_pri of the associated task as a holding element priority value ele_pri. The base priority value base_pri of the task associated with each task queue port and the retention element priority value ele_ple held in each task queue port may not match when aging is performed. Figure 1
4, the value ele_pri of the holding element priority of each task queue port 4080, 4082 is set to the task queue port 408.
It is represented by the numerical value written in 0,4082.
Furthermore, each task queue port is connected to the next task queue port by holding a pointer to the next task queue port.

【0143】このようなポートリスト401の作成方法
の例として、図15に示すような方法がある。
As an example of the method of creating such a port list 401, there is a method as shown in FIG.

【0144】所定のタスクが待ち状態や休止状態から実
行可能状態となると、ポートリスト401の作成を担当
する作成手段が、前記ポートリストヘッド406が示す
アドレスport_list_headをナウポート409が保持する
ポインタに代入する(図15、S1501)。
When a predetermined task goes from the waiting state or the dormant state to the ready state, the creating means in charge of creating the port list 401 substitutes the address port_list_head indicated by the port list head 406 into the pointer held by the now port 409. (FIG. 15, S1501).

【0145】次に、前記作成手段は、ナウポート409
が指すタスクキューポート(注目タスクキューポート)
の保持要素優先度の値ele_priと、実行可能状態となっ
たタスクのベース優先度の値base_priとを比較する(図
15、S1502)。注目タスクキューポートの保持要
素優先度の値ele_priがベース優先度の値base_priより
も小さい場合、前記作成手段は、注目タスクキューポー
トに他のタスクキューポートが連結されているか否かを
判断する(図15、S1503)。注目タスクキューポ
ートに他のタスクキューポートが連結されているか否か
の判断は、注目タスクキューポートが他のタスクキュー
ポートへのポインタを保持しているか否かによって行
う。
Next, the creating means uses the NOWPORT 409.
Task queue port pointed to by (attention task queue port)
The holding element priority value ele_pri of is compared with the base priority value base_pri of the task in the executable state (FIG. 15, S1502). When the holding element priority value ele_pri of the target task queue port is smaller than the base priority value base_pri, the creating unit determines whether or not another task queue port is connected to the target task queue port ( (FIG. 15, S1503). Whether or not another task queue port is connected to the target task queue port is determined by whether or not the target task queue port holds a pointer to another task queue port.

【0146】他のタスクキューポートが連結されている
と判断した場合、前記作成手段は、ナウポート409が
保持するポインタに、注目タスクキューポートに連結さ
れている次順のタスクキューポートのアドレスを代入す
る(図15、S1504)。そして、前記作成手段は、
手順S1502の比較を再度行う。
When it is determined that another task queue port is connected, the creating means substitutes the address of the next task queue port connected to the target task queue port into the pointer held by the now port 409. (FIG. 15, S1504). And the creating means is
The comparison in step S1502 is performed again.

【0147】一方、手順S1503において、他のタス
クキューポートが連結されていないと判断した場合、前
記作成手段は、実行可能状態となったタスクのベース優
先度の値base_priと同じ値の保持要素優先度の値ele_pr
iを保持するタスクキューポートを作成する。前記作成
手段は、注目タスクキューポートに作成したタスクキュ
ーポートへのポインタを保持させる。このようにして、
新たに作成したタスクキュポートと注目タスクキューポ
ートとが連結される(図15、S1505)。
On the other hand, when it is determined in step S1503 that another task queue port is not connected, the creating means gives priority to the holding element having the same value as the base priority value base_pri of the task in the executable state. Degree value ele_pr
Create a task queue port that holds i. The creating means holds a pointer to the created task queue port in the target task queue port. In this way
The newly created task queue port and the target task queue port are linked (FIG. 15, S1505).

【0148】そして、前記作成手段は、新たに連結した
タスクキューポートに実行可能状態となったタスクを関
連付ける(図15、S1506)。
Then, the creating means associates the task in the ready state with the newly connected task queue port (FIG. 15, S1506).

【0149】前記手順S1502において、注目タスク
キューポートの保持要素優先度の値ele_priがベース優
先度の値base_pri以上であると判断した場合、作成手段
は、当該保持要素優先度の値ele_priと当該ベース優先
度の値base_priとが同一か否かを判断する(図15、S
1507)。
In step S1502, if it is determined that the holding element priority value ele_pri of the task queue port of interest is equal to or greater than the base priority value base_pri, the creating means determines the holding element priority value ele_pri and the base. It is determined whether or not the priority value base_pri is the same (FIG. 15, S).
1507).

【0150】同一でないと判断すると、作成手段は、実
行可能状態となったタスクのベース優先度の値base_pri
と同じ値の保持要素優先度の値ele_priを保持するタス
クキューポートを作成する。前記作成手段は、作成した
タスクキューポートを、注目タスクキューポートよりポ
ートリスト401における配列順序が1つ前のタスクキ
ューポートに連結する(図15、S1508)。尚、手
順S1508における注目タスクキューポートに他のタ
スクキューポートが連結されている場合がある。この場
合、前記作成手段は、新たに連結したタスクキューポー
トに、注目タスクキューポートに連結されている他の
(次順の)タスクキューポートへのポインタを保持させ
る。このようにして新たに作成したタスクキューポート
と注目タスクキューポートの次順のタスクキューポート
とが連結される。
When it is determined that they are not the same, the creating means determines the base priority value base_pri of the task in the ready state.
Create a task queue port that holds the value ele_pri of the holding element priority that is the same value as. The creating unit connects the created task queue port to the task queue port whose arrangement order in the port list 401 is one before the task queue port of interest (FIG. 15, S1508). Note that another task queue port may be connected to the target task queue port in step S1508. In this case, the creating means causes the newly connected task queue port to hold a pointer to another (next-order) task queue port connected to the target task queue port. The task queue port newly created in this way and the task queue port next to the task queue port of interest are linked.

【0151】手順S1508にて作成したタスクキュー
ポートを連結すると、前記作成手段は、新たに連結した
タスクキューポートに実行可能状態となったタスクを関
連付ける(図15、S1506)。
When the task queue ports created in step S1508 are linked, the creating means associates the task in the ready state with the newly linked task queue port (FIG. 15, S1506).

【0152】また、前記手順S1507において、保持
要素優先度の値ele_priとベース優先度の値base_priと
が同一であると判断すると、前記作成手段は、注目タス
クキューポートに実行可能状態となったタスクを関連付
ける(図15、S1509)。
If it is determined in step S1507 that the holding element priority value ele_pri and the base priority value base_pri are the same, the creating means determines that the task in the task queue port of interest is ready to execute. Are associated with each other (FIG. 15, S1509).

【0153】例えば、ポートリスト401が図14に示
す状態であるとき、ベース優先度の値base_priが「3」
であるタスク4041が休止状態から実行可能状態にな
ったとする。すると前記作成手段は、手順S1501に
おいてポートリストヘッド406が保持するポインタが
示すアドレスport_list_head(ここでは、タスクキュー
ポート4080のアドレス)をナウポート409が保持
するポインタに代入する。
For example, when the port list 401 is in the state shown in FIG. 14, the base priority value base_pri is "3".
It is assumed that the task 4041, which is a task, goes from the sleep state to the executable state. Then, the creating means substitutes the address port_list_head (here, the address of the task queue port 4080) indicated by the pointer held by the port list head 406 into the pointer held by the now port 409 in step S1501.

【0154】次に前記作成手段は、手順S1502にて
注目タスクキューポート4080の保持要素優先度の値
ele_pri「1」と、実行可能状態となったタスク404
1のベース優先度の値base_pri「3」とを比較する。こ
こではタスク4041のベース優先度の値base_priの方
が大きく、注目タスクキューポート4080にタスクキ
ューポート4082が連結されているので、作成手段
は、手順S1504においてタスクキューポート408
2のアドレスをナウポート409が保持するポインタに
代入する。尚、このタスクキューポート4082の保持
要素優先度の値ele_priは「4」である。タスクキュー
ポート4082のアドレスが代入されると、ポートリス
ト401の作成処理は手順S1502に戻る。
Next, in step S1502, the creating means sets the holding element priority value of the task queue port 4080 of interest.
ele_pri "1" and the task 404 in the ready state
The base priority value of 1 base_pri “3” is compared. In this case, the base priority value base_pri of the task 4041 is larger, and the task queue port 4082 is connected to the target task queue port 4080.
The address 2 is assigned to the pointer held by the now port 409. The value ele_pri of the holding element priority of the task queue port 4082 is “4”. When the address of the task queue port 4082 is substituted, the process of creating the port list 401 returns to step S1502.

【0155】ナウポート409にタスクキューポート4
082のアドレスが入力されたことにより、注目タスク
キューポート4082の保持要素優先度の値ele_priが
タスク4041のベース優先度の値base_priよりも大き
くなる。そのため、ポートリストの作成処理は、手順S
1501から手順S1507を経て、手順S1508に
移行する。
Task queue port 4 in now port 409
Since the address 082 is input, the holding element priority value ele_pri of the task queue port 4082 of interest becomes larger than the base priority value base_pri of the task 4041. Therefore, the process of creating the port list is performed in step S.
The procedure moves from step 1501 to step S1508 through step S1507.

【0156】ここで前記作成手段は、タスク4041の
ベース優先度の値base_priと同じ値の保持要素優先度の
値ele_priを保持するタスクキューポート4081を作
成する。前記作成手段は、作成したタスクキューポート
4081を、注目タスクキューポート4082の1つ前
のタスクキューポート4080に連結する。更に、前記
作成手段は、新たに連結したタスクキューポート408
1に注目タスクキューポート4082を連結する。
Here, the creating means creates the task queue port 4081 which holds the holding element priority value ele_pri of the same value as the base priority value base_pri of the task 4041. The creating means connects the created task queue port 4081 to the task queue port 4080 immediately before the task queue port 4082 of interest. Furthermore, the creating means is configured to newly connect the task queue port 408.
The task queue port 4082 of interest is connected to 1.

【0157】そして、手順S1506において、作成手
段は、新たに連結したタスクキューポート4081にタ
スク4041を関連付け、ポートリスト401は図16
に示すような状態となる。
Then, in step S1506, the creating means associates the task 4041 with the newly connected task queue port 4081, and the port list 401 is shown in FIG.
The state becomes as shown in.

【0158】尚、前記作成手段は、前記レディキュー管
理手段104と別個の手段であっても良いし、またレデ
ィキュー管理手段104が、前記作成手段として機能し
てポートリストの作成処理を行うようにしても良い。
The creating means may be separate means from the ready queue managing means 104, or the ready queue managing means 104 functions as the creating means to perform the port list creating process. You can

【0159】本実施の形態3においても、実施の形態1
と同じように、前記レディキュー管理手段104によっ
てランキュー403Rの先頭のタスクが実行される。
尚、以下で述べるランキュー403Rは、保持要素優先
度の最も高いタスクキューポートに関連付けられたタス
クキュー403を言う。
Also in the third embodiment, the first embodiment
Similarly to the above, the ready queue management means 104 executes the task at the head of the run queue 403R.
The run queue 403R described below is the task queue 403 associated with the task queue port having the highest holding element priority.

【0160】スケジューリング手段102からエイジン
グの指示があると、前記レディキュー管理手段104
は、ポートリスト401に対して操作を行う。
When there is an aging instruction from the scheduling means 102, the ready queue management means 104
Operates the port list 401.

【0161】エイジングの指示があると、レディキュー
管理手段104は、ポートリストヘッド406が保持す
るポインタが表すアドレスport_list_headのタスクキュ
ーポートに他のタスクキューポートが連結されているか
否かを判断する(図17、S1701)。
When there is an aging instruction, the ready queue management means 104 determines whether or not another task queue port is connected to the task queue port of the address port_list_head indicated by the pointer held by the port list head 406 ( FIG. 17, S1701).

【0162】タスクキューポートに他のタスクキューポ
ートが連結されていないと判断した場合、レディキュー
管理手段104はエイジングを終了する。
When it is determined that another task queue port is not connected to the task queue port, the ready queue management means 104 ends the aging.

【0163】一方、タスクキューポートに他のタスクキ
ューポートが連結されていると判断した場合、前記レデ
ィキュー管理手段104は、ポートリストヘッド406
が指すタスクキューポートのアドレスをナウポート40
9が保持するポインタに代入する(図17、S170
2)。
On the other hand, when it is determined that another task queue port is connected to the task queue port, the ready queue management means 104 causes the port list head 406.
The address of the task queue port pointed to by nowport 40
9 is assigned to the pointer held by S9 (FIG. 17, S170).
2).

【0164】前記レディキュー管理手段104は、ナウ
ポート409が指す注目タスクキューポートの保持要素
優先度の値ele_priが、当該注目タスクキューポートに
連結された次順のタスクキューポートの保持要素優先度
の値ele_priから1つ減算した値と同一否かを判断する
(図17、S1703)。
In the ready queue management means 104, the holding element priority value ele_pri of the task queue port of interest pointed to by the now port 409 indicates the holding element priority of the next task queue port connected to the task queue port of interest. It is determined whether it is the same as the value obtained by subtracting one from the value ele_pri (FIG. 17, S1703).

【0165】同一と判断すると、前記レディキュー管理
手段104は、注目タスクキューポートに連結されるタ
スクキューポートを次順のタスクキューポートから次々
順のタスクキューポートに変更する(図17、S170
4)。ただし、次々順のタスクキューポートが存在しな
い場合は、次順のタスクキューポートにタスクキューポ
ートは連結しない。このとき、前記レディキュー管理手
段104は、次順のタスクキューポートに関連付けられ
ているタスクを、注目タスクキューポートに関連付け
る。そして前記レディキュー管理手段104は、次順の
タスクキューポートを削除する(図17、S170
5)。尚、以上のようなポートリスト401は低速メモ
リと高速メモリからなるメモリのうち、高速メモリ領域
に格納されていることが多い。高速メモリ領域は、比較
的容量が小さいので、ポートリスト401が消費する高
速メモリ領域を小さくしておく必要がある。よって、手
順S1705にて、タスクが関連付けられなくなった次
順のタスクポートはメモリ上から削除されることが好ま
しい。
When it is determined that they are the same, the ready queue management means 104 changes the task queue port connected to the target task queue port from the next task queue port to the next task queue port (FIG. 17, S170).
4). However, if there is no next task queue port, the task queue port is not linked to the next task queue port. At this time, the ready queue management means 104 associates the task associated with the next task queue port with the task queue port of interest. Then, the ready queue management means 104 deletes the next task queue port (FIG. 17, S170).
5). The port list 401 as described above is often stored in the high speed memory area of the memory including the low speed memory and the high speed memory. Since the high speed memory area has a relatively small capacity, it is necessary to reduce the high speed memory area consumed by the port list 401. Therefore, in step S1705, it is preferable that the next task port whose task is no longer associated is deleted from the memory.

【0166】手順S1705で次順のタスクキューポー
トを削除した後、又は手順S1703で同一でないと判
断した後、前記レディキュー管理手段104は、注目タ
スクキューポートに他のタスクキューポートが連結され
ているか否かを判断する(図17、S1706)。
After deleting the next task queue port in step S1705 or determining that they are not the same in step S1703, the ready queue management means 104 determines that another task queue port is connected to the target task queue port. It is determined whether or not (S1706 in FIG. 17).

【0167】ここで、注目タスクキューポートに他のタ
スクキューポートが連結されていないと判断した場合、
前記レディキュー管理手段104は、エイジングを終了
する。
If it is determined that the task queue port of interest is not connected to another task queue port,
The ready queue management means 104 ends the aging.

【0168】一方、注目タスクキューポートに他のタス
クキューポートが連結されていると判断した場合、前記
レディキュー管理手段104は、他のタスクキューポー
トのアドレスをナウポート代入する(図17、S170
7)。これにより、前記注目タスクキューポートに連結
されていた他のタスクキューポートが注目タスクキュー
ポートとなる。そして、前記レディキュー管理手段10
4は、新たに注目タスクキューポートとなったタスクキ
ューポートの保持要素優先度の値ele_priを1だけディ
クリメントする(図17、S1708)。
On the other hand, when it is determined that another task queue port is connected to the target task queue port, the ready queue managing means 104 substitutes the address of the other task queue port into the NOW port (FIG. 17, S170).
7). As a result, the other task queue port connected to the target task queue port becomes the target task queue port. Then, the ready queue management means 10
4 decrements the value ele_pri of the holding element priority of the task queue port that has newly become the target task queue port by 1 (FIG. 17, S1708).

【0169】前記レディキュー管理手段104は、保持
要素優先度の値ele_priをディクリメントすると、再度
注目タスクキューポートに他のタスクキューポートが連
結されているか否かを判断する(図17、S170
6)。前記レディキュー管理手段104は、他のタスク
キューポートが連結されていると判断した場合、再度手
順S1707と手順S1708を行う。
After decrementing the holding element priority value ele_pri, the ready queue management means 104 determines again whether or not another task queue port is connected to the target task queue port (FIG. 17, S170).
6). When the ready queue management unit 104 determines that another task queue port is connected, the ready queue management unit 104 performs steps S1707 and S1708 again.

【0170】図16の例では、ポートリストヘッド40
6は、タスクキューポート4080へのポインタが保持
されている。タスクキューポート4080には、タスク
キューポート4081が連結されているので、エイジン
グの処理は手順S1701を経て、手順1702に移行
する。手順S1702にて、前記レディキュー管理手段
104は、タスクキューポート4080のアドレスをナ
ウポート409が保持するポインタに代入する。
In the example of FIG. 16, the port list head 40
6 holds a pointer to the task queue port 4080. Since the task queue port 4081 is connected to the task queue port 4080, the aging process proceeds to step 1702 via step S1701. In step S1702, the ready queue management means 104 substitutes the address of the task queue port 4080 into the pointer held by the now port 409.

【0171】続いて手順S1703において、前記レデ
ィキュー管理手段104は、注目タスクキューポート4
080の保持要素優先度の値ele_priと、注目タスクキ
ューポート4080の次順のタスクキューポート408
1の保持要素優先度の値ele_priから1減算した値とが
同一かどうか判断する。タスクキューポート4080の
保持要素優先度の値ele_priは「1」であり、次順のタ
スクキューポート4081の保持要素優先度の値ele_pr
iは「3」であるので、前記レディキュー管理手段10
4は、同一でないと判断する。これによりエイジングの
処理は手順S1706に移行する。
Subsequently, in step S1703, the ready queue management means 104 determines the task queue port 4 of interest.
The holding element priority value ele_pri of 080 and the task queue port 408 next to the task queue port 4080 of interest.
It is determined whether or not the value obtained by subtracting 1 from the holding element priority value ele_pri of 1 is the same. The value ele_pri of the holding element priority of the task queue port 4080 is "1", and the value ele_pr of the holding element priority of the task queue port 4081 in the next order.
Since i is “3”, the ready queue management means 10
4 determines that they are not the same. As a result, the aging process moves to step S1706.

【0172】注目タスクキューポート4080には、タ
スクキューポート4081が連結されているので、前記
レディキュー管理手段104は手順1706を経て、手
順1707を行う。ここで、前記レディキュー管理手段
104は、次順のタスクキューポート4081のアドレ
スをナウポート409が保持するポインタに代入する。
これにより、次順のタスクキューポート4081が注目
タスクキューポート4081となる。手順S1708に
おいて、前記レディキュー管理手段104は、新たな注
目タスクキューポート4081が保持する保持要素優先
度の値ele_priを1ディクリメントし、手順1706の
判断を行う。
Since the task queue port 4081 is connected to the task queue port 4080 of interest, the ready queue management means 104 performs the procedure 1706 through the procedure 1706. Here, the ready queue management means 104 substitutes the address of the next task queue port 4081 into the pointer held by the now port 409.
As a result, the next task queue port 4081 becomes the target task queue port 4081. In step S1708, the ready queue management unit 104 decrements the holding element priority value ele_pri held by the new target task queue port 4081 by 1, and determines in step 1706.

【0173】更に、図16に示すように注目タスクキュ
ーポート4081にはタスクキューポート4082が連
結されているので、前記レディキュー管理手段104
は、再度手順S1707を行う。即ち、次順のタスクキ
ューポート4082のアドレスをナウポート409が保
持するポインタに代入する。更に、前記レディキュー管
理手段104は、新たに注目タスクキューポート408
2となったタスクキューポート4082が保持する保持
要素優先度の値ele_priを1つディクリメントし、手順
1706の判断を行う。
Further, as shown in FIG. 16, since the task queue port 4082 is connected to the target task queue port 4081, the ready queue managing means 104 is provided.
Performs step S1707 again. That is, the address of the next task queue port 4082 is assigned to the pointer held by the now port 409. Further, the ready queue management means 104 newly adds the task queue port 408 of interest.
The task queue port 4082 that has become 2 decrements the value ele_pri of the holding element priority held by the task queue port 4082, and the determination in step 1706 is performed.

【0174】図16に示すように注目タスクキューポー
ト4082には他のタスクキューポートが連結されてい
ないので、前記レディキュー管理手段104はエイジン
グを終了する。
As shown in FIG. 16, the task queue port 4082 of interest is not connected to any other task queue port, so that the ready queue management means 104 ends the aging.

【0175】エイジングの結果、図18に示すようにタ
スクキューポート4081、4082それぞれの保持要
素優先度は「3」・「4」から「2」・「3」に上が
る。
As a result of the aging, as shown in FIG. 18, the holding element priorities of the task queue ports 4081 and 4082 are increased from "3" / "4" to "2" / "3".

【0176】ポートリスト401が図18に示す状態で
もう一度エイジングの指示がレディキュー管理手段10
4にあると、前記レディキュー管理手段104は、前回
のエイジングト同様に、手順S1701を経て手順17
02を行う。ここでも、ポートリストヘッド406が保
持するポインタが表すアドレスは、タスクキューポート
4080のアドレスである。そのため、手順S1702
おいて、ナウポート409が保持するポインタにはタス
クキューポート4080のアドレスが代入される。
With the port list 401 shown in FIG. 18, the aging instruction is issued again to the ready queue management means 10.
4, the ready queue management means 104 goes through step S1701 to step 17 as in the previous aging.
Do 02. Here again, the address represented by the pointer held by the port list head 406 is the address of the task queue port 4080. Therefore, step S1702
The address of the task queue port 4080 is assigned to the pointer held by the now port 409.

【0177】前回のエイジング処理において、次順のタ
スクキューポート4081の保持要素優先度の値ele_pr
iは、1ディクリメントされて「2」となっている。そ
のため、注目タスクキューポート4080の保持要素優
先度の値ele_priと次順のタスクキューポート4081
の保持要素優先度の値ele_priを1つ減算した値とは同
一となる。よって、今回のエイジングの処理は、手順S
1703が行われると、手順S1704に移行すること
になる。
In the previous aging process, the value ele_pr of the holding element priority of the next task queue port 4081 is set.
i is decremented by 1 and becomes "2". Therefore, the value ele_pri of the holding element priority of the task queue port 4080 of interest and the next task queue port 4081
It is the same as the value obtained by subtracting one from the holding element priority value ele_pri of. Therefore, the process of this aging is the procedure S
When step 1703 is performed, the process proceeds to step S1704.

【0178】手順S1704にて、図19に示すように
前記レディキュー管理手段104は注目タスクキューポ
ート4080と次順のタスクキューポート4081との
連結を削除し、注目タスクキューポート4080に次々
順のタスクキューポート4082を連結する。前記レデ
ィキュー管理手段104は、次順のタスクキューポート
4081に関連で付けられていたタスク4041をタス
クキューポート4080に関連付けられている最後尾の
タスクに関連付ける。
In step S1704, the ready queue management means 104 deletes the connection between the target task queue port 4080 and the next task queue port 4081 as shown in FIG. The task queue port 4082 is connected. The ready queue management unit 104 associates the task 4041 associated with the next task queue port 4081 with the last task associated with the task queue port 4080.

【0179】そして、前記レディキュー管理手段104
は、次順のタスクキューポート4081をメモリ上から
も削除し、エイジングの処理は手順S1706に移行す
る。
The ready queue management means 104
Deletes the next task queue port 4081 from the memory as well, and the aging process moves to step S1706.

【0180】ここでは、注目タスクキューポート408
0にはタスクキューポート4082が連結されているの
で、前記タスク管理手段104は、上記のように手順S
1707と手順S1708を行い、エイジングを終了す
る。
Here, the task queue port 408 of interest is
Since the task queue port 4082 is connected to 0, the task management means 104 executes the procedure S as described above.
1707 and step S1708 are performed, and aging is completed.

【0181】以上のように、エイジングを2回行うこと
で、図19に示すようにタスクキューポート4081に
関連付けられていたタスク4041は、最も保持要素優
先度が高いタスクキューポート4080に関連付けられ
る。よって、エイジングによってタスクキューポート4
080に関連付けられたタスク4041は、ローテイト
等が行われることで実行されることになる。
As described above, by performing the aging twice, the task 4041 associated with the task queue port 4081 as shown in FIG. 19 is associated with the task queue port 4080 having the highest holding element priority. Therefore, task queue port 4 by aging
The task 4041 associated with 080 is executed by performing rotation or the like.

【0182】(実施の形態4)実施の形態3のように、
エイジングによってランキュー403Rに関連付けられ
たタスクのうち実行されたタスクは、前記レディキュー
管理手段104が行うドロップの対象となる。
(Embodiment 4) As in Embodiment 3,
Among the tasks associated with the run queue 403R due to aging, the executed task is the target of the drop performed by the ready queue management unit 104.

【0183】ドロップを行うにあたり、図20に示すよ
うに、ますレディュー管理手段104は、ランキュー4
03Rの先頭にあるタスクをランキュー403Rから削
除する(図20、S2001)。次に前記レディキュー
管理手段104は、ポートリストヘッド406が指すタ
スクキューポートのアドレスをナウポート409が保持
するポインタに代入する(図20、S2002)。
Upon performing the drop, the ready management means 104, as shown in FIG.
The task at the head of 03R is deleted from the run queue 403R (FIG. 20, S2001). Next, the ready queue management means 104 substitutes the address of the task queue port pointed to by the port list head 406 into the pointer held by the now port 409 (FIG. 20, S2002).

【0184】前記レディキュー管理手段104に備えら
れたタスクキューポート検索手段105は、注目タスク
キューポートの保持要素優先度の値ele_priと、ドロッ
プの対象となるタスクのベース優先度の値base_priとを
比較する(図20、S2003)。
The task queue port search means 105 provided in the ready queue management means 104 stores the value ele_pri of the holding element priority of the task queue port of interest and the base priority value base_pri of the task to be dropped. The comparison is made (FIG. 20, S2003).

【0185】タスクのベース優先度の値base_priが保持
要素優先度の値ele_priより大きければ、タスクキュー
ポート検索手段105は、注目タスクキューポートに他
のタスクキューポートが連結されているか否かを判断す
る(図20、S2004)。
If the base priority value base_pri of the task is larger than the holding element priority value ele_pri, the task queue port search means 105 determines whether another task queue port is connected to the target task queue port. (FIG. 20, S2004).

【0186】連結されていると判断した場合、前記タス
クキューポート検索手段105は、タスクのベース優先
度の値base_priが保持要素優先度の値ele_priと同一か
否か判断する(図20、S2005)。
If it is determined that they are connected, the task queue port searching means 105 determines whether the base priority value base_pri of the task is the same as the holding element priority value ele_pri (FIG. 20, S2005). .

【0187】同一でないと判断した場合、前記タスクキ
ューポート検索手段105は、注目タスクキューポート
に連結されている他のタスクキューポートのアドレスを
ナウポート409の保持するポインタに代入する(図2
0、S2006)。そして、前記タスクキューポート検
索手段105は、手順S2003の比較を再度行う。
When it is determined that they are not the same, the task queue port searching means 105 substitutes the address of another task queue port connected to the target task queue port into the pointer held by the now port 409 (FIG. 2).
0, S2006). Then, the task queue port search means 105 performs the comparison in step S2003 again.

【0188】一方、手順S2004において、前記タス
クキューポート検索手段105は、他のタスクキューポ
ートが連結されていないと判断した場合、ドロップの処
理は手順S2007に移行する。
On the other hand, in step S2004, when the task queue port search means 105 determines that another task queue port is not connected, the drop process proceeds to step S2007.

【0189】ここで前記レディキュー管理手段104
は、ドロップの対象であるタスクのベース優先度の値ba
se_priと同じ値の保持要素優先度の値ele_priを保持し
たタスクキューポートを作成する。前記レディキュー管
理手段104は、作成したタスクキューポートを注目タ
スクキューポートに連結する(図20、S2007)。
そして、前記レディキュー管理手段104は、新たに連
結したタスクキューポートのアドレスをナウポート40
9が保持するポインタに代入する(図20、S200
8)。そして、前記レディキュー管理手段104は、新
たに連結したタスクキューポートにドロップの対象であ
るタスクを関連付ける(図20、S2009)。
Here, the ready queue management means 104
Is the base priority value ba of the task that is the target of the drop.
Create a task queue port that holds the holding element priority value ele_pri, which is the same value as se_pri. The ready queue management means 104 connects the created task queue port to the target task queue port (FIG. 20, S2007).
Then, the ready queue management means 104 sets the address of the newly connected task queue port to the now port 40.
9 is assigned to the pointer held by S9 (FIG. 20, S200).
8). Then, the ready queue management means 104 associates the task to be dropped with the newly connected task queue port (FIG. 20, S2009).

【0190】また、手順S2005において、前記タス
クキューポート検索手段105が同一と判断した場合、
前記レディキュー管理手段104は、注目タスクキュー
ポートにタスクを関連付ける(図20、S2009)。
If it is determined in step S2005 that the task queue port searching means 105 are the same,
The ready queue management unit 104 associates the task with the task queue port of interest (FIG. 20, S2009).

【0191】更に、手順S2003においてタスクのベ
ース優先度の値base_priが注目タスクキューポートの保
持要素優先度の値ele_pri以下であると前記タスクキュ
ーポート検索手段105が判断した場合、ドロップの処
理は手順S2010に移行する。ここで前記レディキュ
ー管理手段104は、タスクのベース優先度の値base_p
riと同じ値の保持要素優先度の値ele_priを保持するタ
スクキューポートを作成する。前記レディキュー管理手
段104は、作成したタスクキューポートを、ポートリ
スト401における配列順序が注目タスクキューポート
より1つ前のタスクキューポートに連結する。更に、前
記レディキュー管理手段104は、新たに連結したタス
クキューポートに、注目タスクキューポートを連結する
(図20、S2010)。
Further, when the task queue port searching means 105 determines in step S2003 that the value base_pri of the task priority base_pri is less than or equal to the value ele_pri of the holding element priority of the task queue port of interest, the drop processing is the procedure. The process moves to S2010. Here, the ready queue management means 104 determines the value of the base priority of the task base_p.
Create a task queue port that holds the holding element priority value ele_pri, which is the same value as ri. The ready queue management means 104 connects the created task queue port to the task queue port that is one before the task queue port of interest in the arrangement order in the port list 401. Further, the ready queue management means 104 connects the task queue port of interest to the newly connected task queue port (FIG. 20, S2010).

【0192】作成したタスクキューポートを注目タスク
キューポートに連結すると、前記レディキュー管理手段
104は、連結したタスクキューポートにドロップの対
象であるタスクを関連付ける(図20、S2009)。
When the created task queue port is linked to the target task queue port, the ready queue management means 104 associates the task to be dropped with the linked task queue port (FIG. 20, S2009).

【0193】例えば図21に示すベース優先度の値base
_priが「3」のタスク4041をドロップの対象とする
場合、前記レディキュー管理手段104は、手順200
1にてタスク4041をランキュー403Rから削除す
る。
For example, the base priority value base shown in FIG.
When the task 4041 whose _pri is “3” is to be dropped, the ready queue management means 104 uses the procedure 200
At 1, the task 4041 is deleted from the run queue 403R.

【0194】手順S2002にて、前記レディキュー管
理手段104は、ナウポート409が保持するポインタ
に、先頭のタスクキューポート4080のアドレスを代
入する。
In step S2002, the ready queue management means 104 substitutes the address of the first task queue port 4080 into the pointer held by the now port 409.

【0195】この例では、注目タスクキューポート40
80の保持要素優先度の値ele_priが「1」であり、ド
ロップの対象となるタスク4041のベース優先度の値
base_pri「3」であるので、ドロップの処理は、手順S
2003から手順S2004に移行する。図21に示す
ように注目タスクキューポート4080にはタスクキュ
ーポート4081が連結されているので、ドロップの処
理は、手順S2005に移行する。
In this example, the target task queue port 40
The holding element priority value ele_pri of 80 is “1”, and the base priority value of the task 4041 to be dropped
Since the base_pri is “3”, the drop process is step S.
The procedure moves from 2003 to step S2004. As shown in FIG. 21, since the task queue port 4081 is connected to the target task queue port 4080, the drop processing moves to step S2005.

【0196】ここでは上述の通り、注目タスクキューポ
ート4080の保持要素優先度の値ele_priとドロップ
の対象となるタスク4041のベース優先度の値base_p
riとは同一でないので、ドロップの処理は手順S200
6に移行する。
Here, as described above, the value ele_pri of the holding element priority of the task queue port 4080 of interest and the value base_p of the base priority of the task 4041 to be dropped.
Since it is not the same as ri, the drop process is step S200.
Go to 6.

【0197】手順S2006にて前記タスクキューポー
ト検索手段105は、注目タスクキューポート4080
に連結された次順のタスクキューポート4081のアド
レスをナウポート409が保持するポインタに代入す
る。これによってタスクキューポート4081が注目タ
スクキューポート4081となる。これにより、ドロッ
プの処理は手順S2003に戻る。
In step S2006, the task queue port search means 105 causes the task queue port 4080 of interest.
The address of the next task queue port 4081 connected to is assigned to the pointer held by the now port 409. As a result, the task queue port 4081 becomes the target task queue port 4081. As a result, the drop processing returns to step S2003.

【0198】注目タスクキューポート4081の保持要
素優先度の値ele_priは「3」であり、タスク4041
のベース優先度の値base_priも「3」であるので、ドロ
ップの処理は手順S2003から手順S2004に移行
する。
The value ele_pri of the holding element priority of the target task queue port 4081 is “3”, and the task 4041
Since the base priority value base_pri of is also “3”, the drop processing moves from step S2003 to step S2004.

【0199】図21に示すように、注目タスクキューポ
ート4081にもタスクキューポート4082が連結さ
れているので、ドロップの処理は手順S2005に移行
する。
As shown in FIG. 21, since the task queue port 4082 is also connected to the task queue port 4081 of interest, the drop processing moves to step S2005.

【0200】この時点では、注目タスクキューポート4
081の保持要素優先度の値ele_priとタスク4041
のベース優先度の値base_priとは同一であるので、ドロ
ップの処理は手順S2009に移行する。手順S200
9にて、前記レディキュー管理手段104は、タスク4
041を注目タスクキューポート4081に関連付け、
ポートリスト401は図22に示す状態となる。
At this point, the task queue port 4 of interest
081 holding element priority value ele_pri and task 4041
Since it is the same as the base priority value base_pri of, the drop processing proceeds to step S2009. Step S200
9, the ready queue management means 104 executes the task 4
041 is associated with the task queue port 4081 of interest,
The port list 401 is in the state shown in FIG.

【0201】この状態で、再度ドロップの指示がある
と、手順S2001にて前記レディキュー管理手段10
4は、ランキュー403Rの先頭のタスク4042(保
持要素優先度の値ele_priは「7」)をランキュー40
3Rから削除する。
In this state, if there is a drop instruction again, the ready queue management means 10 is operated in step S2001.
4 is the task 4042 at the head of the run queue 403R (holding element priority value ele_pri is “7”)
Delete from 3R.

【0202】次に、手順S2002にて前記レディキュ
ー管理手段104は、先頭のタスクキューポート408
0のアドレスをナウポート409が保持するポインタに
入力する。ここでは、タスク4042のベース優先度の
値base_priが注目タスクキューポート4080の保持要
素優先度の値ele_priより大きいので、ドロップの処理
は手順S2003から手順S2004に移行することに
なる。
Next, in step S2002, the ready queue management means 104 causes the task queue port 408 at the head of the queue.
The address of 0 is input to the pointer held by the now port 409. Here, since the base priority value base_pri of the task 4042 is larger than the holding element priority value ele_pri of the task queue port 4080 of interest, the drop processing shifts from step S2003 to step S2004.

【0203】図22に示すように、ポートリスト401
には保持要素優先度の値ele_priが「3」、「4」、
「10」・・・のタスクキューポート4081、408
2、4085・・・が配列されている。よって、ドロッ
プの処理は、手順S2004、手順S2005、手順S
2006を繰り返すことになり、手順S2006を経る
度にナウポート409が保持するポインタには保持要素
優先度の値ele_priが「3」、「4」、「10」のタス
クキューポートのアドレスが代入される。
As shown in FIG. 22, the port list 401
The holding element priority value ele_pri is “3”, “4”,
“10” ... task queue ports 4081, 408
2, 4085 ... Are arranged. Therefore, the drop processing is performed in steps S2004, S2005, and S2005.
Since 2006 is repeated, the address of the task queue port whose holding element priority value ele_pri is "3", "4", or "10" is assigned to the pointer held by the now port 409 every time step S2006 is performed. .

【0204】手順S2006にて、ナウポート409が
保持するポインタに保持要素優先度の値ele_priが「1
0」のタスクキューポート4085のアドレスが代入さ
れると、注目タスクキューポート4085の保持要素優
先度の値ele_priがタスク4042のベース優先度の値b
ase_priよりも大きくなる。従って、ドロップの処理は
手順S2003から手順S2010に移行することにな
る。
In step S2006, the pointer held by the NOWPORT 409 sets the holding element priority value ele_pri to "1".
When the address of the task queue port 4085 of “0” is substituted, the value ele_pri of the holding element priority of the task queue port 4085 of interest is the base priority value b of the task 4042.
It will be larger than ase_pri. Therefore, the drop processing moves from step S2003 to step S2010.

【0205】手順S2010に移行すると、前記レディ
キュー管理手段104は、タスク4042のベース優先
度の値base_priと同じ値の保持要素優先度の値ele_pri
を保持するタスクキューポート4083を作成する。前
記レディキュー管理手段104は、作成したタスクキュ
ーポート4083を、注目タスクキューポート4085
よりも配列順序が1つ前のタスクキューポート4082
に連結する。更に前記レディキュー管理手段104は新
たに連結したタスクキューポート4083に注目タスク
キューポート4085を連結する。
When the procedure shifts to step S2010, the ready queue management means 104 has the same holding element priority value ele_pri as the base priority value base_pri of the task 4042.
A task queue port 4083 for holding is created. The ready queue management unit 104 replaces the created task queue port 4083 with the task queue port 4085 of interest.
Task queue port 4082 that is one order earlier than
Connect to. Further, the ready queue management means 104 connects the target task queue port 4085 to the newly connected task queue port 4083.

【0206】手順S2009にて、前記レディキュー管
理手段104は、新たに連結したタスクキューポート4
083にタスク4042を連結する。
In step S2009, the ready queue management means 104 causes the newly connected task queue port 4
The task 4042 is linked to 083.

【0207】これによって、図22に示すポートリスト
401は図23に示すような状態となる。
As a result, the port list 401 shown in FIG. 22 is brought into a state as shown in FIG.

【0208】ポートリスト401が図23に示す状態で
のとき、再度ドロップの指示があると、前記レディキュ
ー管理手段104は、ランキュー403Rの先頭のタス
ク4043をランキュー403Rから削除する。
When the port list 401 is in the state shown in FIG. 23, if the drop instruction is given again, the ready queue management means 104 deletes the task 4043 at the head of the run queue 403R from the run queue 403R.

【0209】図23に示すように、タスク4043のベ
ース優先度の値base_pri「8」と同じ値の保持要素優先
度の値ele_priを保持するタスクキューポートがポート
リスト401には存在しない。よって、タスク4042
と同様の方法で、前記レディキュー管理手段104は、
保持要素優先度の値ele_priが「8」のタスクキューポ
ート4084を作成し、図24に示すようにタスクキュ
ーポート4084をタスクキューポート4083に連結
する。また、ドロップの対象であるタスク4043は、
前記レディキュー管理手段104にて、タスクキューポ
ート4084に関連付けられる。
As shown in FIG. 23, there is no task queue port holding the holding element priority value ele_pri of the same value as the base priority value base_pri “8” of the task 4043 in the port list 401. Therefore, task 4042
In the same manner as described above, the ready queue management means 104
A task queue port 4084 having a holding element priority value ele_pri of “8” is created, and the task queue port 4084 is connected to the task queue port 4083 as shown in FIG. Also, the task 4043 that is the target of the drop is
The ready queue management means 104 is associated with the task queue port 4084.

【0210】今回のドロップによって、先頭のタスクキ
ューポート4080には、タスクが関連付けられていな
い状態となる。ポートリスト401が消費するメモリ領
域を小さくするため、タスクが関連付けられなくなった
タスクキューポート4080は、ポートリスト401か
ら削除するようにする。
By this drop, a task is not associated with the task queue port 4080 at the head. In order to reduce the memory area consumed by the port list 401, the task queue port 4080 that is no longer associated with a task is deleted from the port list 401.

【0211】そこで、タスクが関連付けられなくなった
先頭のタスクキューポート4080を削除するために、
例えば前記レディキュー管理手段104は、ドロップを
行った後、ポートリストヘッド406が指すタスクキュ
ーポート4080にタスクが関連づけられているか否か
を判断する。タスクキューポート4080にタスクが関
連付けられていないと判断した場合、前記レディキュー
管理手段104は、当該タスクキューポート4080を
ポートリスト401から削除する。
Therefore, in order to delete the first task queue port 4080 that is no longer associated with a task,
For example, the ready queue management unit 104 determines whether or not the task is associated with the task queue port 4080 indicated by the port list head 406 after the drop. When it is determined that the task queue port 4080 is not associated with a task, the ready queue management unit 104 deletes the task queue port 4080 from the port list 401.

【0212】図24では、ポートリストヘッド406が
指すタスクキューポート4080を削除した場合、前記
レディキュー管理手段104は、ポートリストヘッド4
06に保持されたアドレスを、新たに先頭のタスクキュ
ーポート4081となったタスクキューポート4081
のアドレスに更新する。
In FIG. 24, when the task queue port 4080 pointed to by the port list head 406 is deleted, the ready queue management means 104 causes the port list head 4
The address held in 06 is the task queue port 4081 that newly becomes the task queue port 4081 at the beginning.
Update to the address.

【0213】これにより、タスクが関連付けられたタス
クキューポートのみがポートリスト401に配列された
状態となる。
As a result, only the task queue ports associated with the tasks are arranged in the port list 401.

【0214】また、上述のタスク管理装置は、例えばデ
ジタル家電や携帯電話などの組込み機器として実施され
ることがある。組込み機器は、汎用のコンピュータと異
なり、特定の用途を有しているが、汎用のコンピュータ
と同様、プログラムを記憶するメモリと、当該メモリに
記憶されたプログラムを実行するプロセッサを有してい
る。組込み機器にシステムコール処理手段101、スケ
ジューリング手段102、ディスパッチ手段103及び
レディキュー管理手段104を備えさせるには、例えば
当該組込み機器に合わせて実装した上述のリアルタイム
OSを当該組込み機器のメモリに記憶しておけばよい。
The task management device described above may be implemented as an embedded device such as a digital home appliance or a mobile phone. Unlike a general-purpose computer, an embedded device has a specific purpose, but like a general-purpose computer, it has a memory that stores a program and a processor that executes the program stored in the memory. In order to provide the embedded device with the system call processing means 101, the scheduling means 102, the dispatch means 103, and the ready queue management means 104, for example, the above-mentioned real-time OS mounted according to the embedded device is stored in the memory of the embedded device. You can leave it.

【0215】[0215]

【発明の効果】以上説明した通り、本発明では、線状に
連結された複数の要素の順序が要素に関連付けられたタ
スクの優先度を表すリストに対して、タスクが関連付け
られた要素のうち最も高い優先度を表す順序にある要素
とその次順にある要素との連結を削除して、その代わり
に次々順にある要素を連結する操作が行われる。この操
作によってエイジングが行われるため、次々順にある要
素に連結された各要素に対してそれぞれ操作を行う必要
がなくなる。従って、優先度の最大値に従って要素の個
数が増加しても、エイジングにおけるオーバーヘッドの
増大を抑えることができる。
As described above, in the present invention, the order of a plurality of linearly connected elements indicates the priority of the task associated with the element, and An operation is performed in which the connection between the element in the order representing the highest priority and the element in the next order is deleted, and instead the elements in the next order are connected. Since the aging is performed by this operation, it is not necessary to perform the operation for each of the elements connected to the element one after another. Therefore, even if the number of elements increases according to the maximum value of the priority, it is possible to suppress an increase in overhead in aging.

【0216】また、リストの要素の順序に対応して配列
された各配列要素がそれぞれ前記リストの要素を特定す
る特定情報を保持するテーブルを用意しておく。この特
定情報を用いて、ドロップの対象となるタスクの設定優
先度と同じ優先度を表す順序にあるリストの要素を検索
する。そして、検索されたリストの要素にドロップの対
象となったタスクを関連付ける操作を行えば、リストの
先頭から要素を順次辿って、ドロップの対象となったタ
スクを関連付ける要素を探索する必要がなくなる。従っ
て、その分だけドロップにおけるオーバーヘッドを抑え
ることができる。
Further, a table is prepared in which each array element arranged corresponding to the order of the elements of the list holds specific information for specifying the element of the list. This specific information is used to search the elements of the list in the order of indicating the same priority as the set priority of the task to be dropped. Then, if the operation of associating the task targeted for the drop with the element of the searched list is performed, it is not necessary to sequentially trace the elements from the head of the list and search for the element associated with the task targeted for the drop. Therefore, the overhead in the drop can be suppressed accordingly.

【0217】さらに、テーブルに配列された配列要素の
うち、当該配列要素の保持する特定情報によって特定さ
れるリストの要素の順序が当該配列要素の対応している
ものとは異なる配列要素で最も先頭側に配列された配列
要素の順序を表す更新インデックスを保持しておく。ド
ロップの対象となるタスクの設定優先度と同じ優先度を
表す順序が更新インデックスの表す順序以降にあるか否
かを判断する。そして、更新インデックスの表す順序以
降にあると判断した場合に、タスクが関連付けられた要
素のうち最も高い優先度を表す順序にある要素に対応す
る配列要素よりも最後尾側に配列され更新インデックス
の表す順序以先に配列された配列要素の保持する特定情
報を、当該配列要素の対応している順序にあるリストの
要素を特定するものに更新する操作を予め行えば、検索
を適切に行うことができる。しかも、特定情報が更新さ
れるのは、必要最小限の配列要素についてのみであるか
ら、更新に伴うオーバーヘッドの増大も抑えることがで
きる。
Further, among the array elements arranged in the table, the order of the elements of the list specified by the specifying information held by the array element is different from the one corresponding to the array element, and is the first array element. The update index indicating the order of the array elements arranged on the side is held. It is determined whether or not the order of indicating the same priority as the set priority of the task to be dropped is after the order of the update index. Then, when it is determined that the update index is after the order represented by the update index, the task is associated with the update index of the element corresponding to the element having the highest priority among the elements associated with the task. If the operation to update the specific information held by the array elements arranged before the indicated order to the one that identifies the list element in the corresponding order of the array element is performed in advance, the search can be performed properly. You can Moreover, since the specific information is updated only for the minimum necessary array elements, it is possible to suppress an increase in overhead associated with the update.

【0218】また、タスクが関連付けられている保持要
素のみをリストに配列することで、リストの容量を小さ
くすることができる。このようなリストのタスクの優先
度を上げるエイジングを実行するには、保持要素優先度
が最も高い最高優先度保持要素以外の保持要素の保持要
素優先度を上げる操作を行えばよい。この操作によって
エイジングが行われるため、各保持要素に関連付けられ
た全部のタスクの優先度を上げる操作を行う必要がなく
なるので、エイジングにおけるオーバーヘッドを抑える
ことができる。
By arranging only the holding elements associated with tasks in the list, the capacity of the list can be reduced. In order to execute the aging for raising the priority of the task in such a list, an operation of raising the holding element priority of the holding element other than the highest priority holding element having the highest holding element priority may be performed. Since the aging is performed by this operation, it is not necessary to perform the operation of raising the priority of all the tasks associated with each holding element, and therefore the aging overhead can be suppressed.

【0219】尚、エイジングによって、タスクが関連付
けられなくなった保持要素をメモリ上から削減すること
で、リストが消費するメモリ領域を小さくすることがで
きる。特に、容量があまり大きくない高速メモリに前記
リストが格納されている場合、リストが消費する高速メ
モリ領域を小さくすることができる。
Note that the memory area consumed by the list can be reduced by reducing the holding elements in the memory that are no longer associated with the task by aging. In particular, when the list is stored in a high-speed memory having a small capacity, the high-speed memory area consumed by the list can be reduced.

【0220】また、保持要素のみが配列されたリストに
対してドロップを実行する場合、ドロップの対象となる
タスクの設定優先度と同じ値の保持要素優先度の保持要
素にタスクを関連付ける操作をリストに対して行う。こ
の操作によって、リストの先頭から要素を順次辿って、
ドロップの対象となったタスクを関連付ける要素を探索
する必要がなくなる。従って、その分だけドロップにお
けるオーバーヘッドを抑えることができる。
When a drop is executed for a list in which only holding elements are arranged, a list of operations for associating a task with a holding element having a holding element priority of the same value as the setting priority of the task to be dropped Do against. By this operation, the elements are sequentially traced from the beginning of the list,
There is no need to search for an element that associates the task that was the target of the drop. Therefore, the overhead in the drop can be suppressed accordingly.

【0221】尚、当該設定優先度と同じ値の保持要素優
先度の保持要素が存在しない場合、タスクの設定優先度
と同じ値の保持要素優先度を保持する保持要素を作成
し、作成した保持要素にドロップの対象となるタスクを
関連付ける操作をリストに対して行う。
When there is no holding element with the same holding element priority as the setting priority, a holding element for holding the holding element priority with the same value as the task setting priority is created, and the created holding Perform the operation to associate the task to be dropped with the element with respect to the list.

【0222】また、ドロップによって、最高優先度保持
要素に保持要素が関連付けられなくなった場合、最高優
先度保持要素を前記リストから削除する。これによって
前記リストの容量を小さくすることができ、消費するメ
モリ領域を小さくすることができる。
When the holding element is no longer associated with the highest priority holding element due to the drop, the highest priority holding element is deleted from the list. As a result, the capacity of the list can be reduced and the memory area consumed can be reduced.

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

【図1】実施の形態1におけるポートリストの構成を示
す図
FIG. 1 is a diagram showing a configuration of a port list according to the first embodiment.

【図2】実施の形態1におけるタスク管理装置の概略構
成を示す図
FIG. 2 is a diagram showing a schematic configuration of a task management device according to the first embodiment.

【図3】実施の形態1におけるランキューポート、ラン
キューインデックスの初期化処理を説明するためのフロ
ーチャート
FIG. 3 is a flowchart for explaining initialization processing of a run queue port and a run queue index according to the first embodiment.

【図4】実施の形態1におけるエイジングを説明するた
めのフローチャート
FIG. 4 is a flowchart for explaining aging in the first embodiment.

【図5】実施の形態1におけるポートリストのエイジン
グ前とエイジング後の状態の具体例を示す図
FIG. 5 is a diagram showing a specific example of states before and after aging of the port list according to the first embodiment.

【図6】実施の形態1におけるドロップを説明するため
のフローチャート
FIG. 6 is a flowchart for explaining a drop in the first embodiment.

【図7】実施の形態1におけるランキューポート、ラン
キューインデックスの更新処理を説明するためのフロー
チャート
FIG. 7 is a flowchart for explaining a process of updating a run queue port and a run queue index according to the first embodiment.

【図8】実施の形態1におけるポートリストのドロップ
前とドロップ後の状態の具体例を示す図
FIG. 8 is a diagram showing a specific example of states before and after dropping the port list according to the first embodiment.

【図9】実施の形態2におけるタスク管理装置の概略構
成を示す図
FIG. 9 is a diagram showing a schematic configuration of a task management device according to the second embodiment.

【図10】実施の形態2におけるポートリスト、ポート
テーブルのエイジング前とエイジング後の状態の具体例
を示す図
FIG. 10 is a diagram showing a specific example of the states of the port list and port table before and after aging according to the second embodiment.

【図11】実施の形態2におけるエイジングを説明する
ためのフローチャート
FIG. 11 is a flowchart for explaining aging in the second embodiment.

【図12】実施の形態2におけるドロップを説明するた
めのフローチャート
FIG. 12 is a flowchart for explaining a drop according to the second embodiment.

【図13】実施の形態2おけるポートリスト、ポートテ
ーブルのドロップ前とドロップ後の状態の具体例を示す
FIG. 13 is a diagram showing a specific example of a port list before dropping and a state after dropping the port table according to the second embodiment.

【図14】実施の形態3におけるポートリストを示す図FIG. 14 is a diagram showing a port list according to the third embodiment.

【図15】実施の形態3における実行可能状態となった
タスクをリストに関連づける処理を説明するためのフロ
ーチャート
FIG. 15 is a flowchart for explaining a process of associating a task in an executable state with a list according to the third embodiment.

【図16】実施の形態3におけるポートリストを示す図FIG. 16 is a diagram showing a port list according to the third embodiment.

【図17】実施の形態3におけるエイジングを説明する
ためのフローチャート
FIG. 17 is a flowchart for explaining aging in the third embodiment.

【図18】実施の形態3におけるエイジング後のポート
リストを示す図
FIG. 18 is a diagram showing a port list after aging according to the third embodiment.

【図19】実施の形態3における2回目のエイジング後
のポートリストを示す図
FIG. 19 is a diagram showing a port list after the second aging according to the third embodiment.

【図20】実施の形態4におけるドロップを説明するた
めのフローチャート
FIG. 20 is a flowchart for explaining a drop according to the fourth embodiment.

【図21】実施の形態4のドッロプ直前のポートリスト
の状態を示す図
FIG. 21 is a diagram showing a state of a port list immediately before a drop according to the fourth embodiment.

【図22】実施の形態4の1回目のドロップ後のポート
リストの状態を示す図
FIG. 22 is a diagram showing the state of the port list after the first drop in the fourth embodiment.

【図23】実施の形態4の2回目のドロップ後のポート
リストの状態を示す図
FIG. 23 is a diagram showing a state of the port list after the second drop in the fourth embodiment.

【図24】実施の形態4の3回目のドロップ後のポート
リストの状態を示す図
FIG. 24 is a diagram showing the state of the port list after the third drop of the fourth embodiment.

【図25】従来用いられていたタスクキューテーブルの
エイジング前とエイジング後の状態の具体例を示す図
FIG. 25 is a view showing a concrete example of a state of a task queue table used before and before and after aging.

【図26】タスクキューテーブルを用いる場合のランキ
ューインデックスの初期化処理を説明するためのフロー
チャート
FIG. 26 is a flowchart for explaining initialization processing of a run queue index when using a task queue table.

【図27】タスクキューテーブルを用いる場合のエイジ
ングを説明するためのフローチャート
FIG. 27 is a flowchart for explaining aging when using a task queue table.

【図28】タスクキューテーブルのドロップ前とドロッ
プ後の状態の具体例を示す図
FIG. 28 is a diagram showing a specific example of the state of the task queue table before and after the drop.

【図29】タスクキューテーブルを用いる場合のドロッ
プを説明するためのフローチャート
FIG. 29 is a flowchart for explaining a drop when using a task queue table.

【図30】ローテイトを説明するためのフローチャートFIG. 30 is a flowchart for explaining rotation.

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

1 タスク管理装置 101 システムコール処理手段 102 スケジューリング手段 103 ディスパッチ手段 104 レディキュー管理手段 105 タスクキューポート検索手段 401 ポートリスト 402、4080〜4085 タスクキューポート 402R ランキューポート 403 タスクキュー 403R ランキュー 4040〜4043、4046〜4048 404A〜
404E、404dタスク 405 ランキューインデックス 406 ポートリストヘッド 407 ポートリストテイル 409 ナウポート 410 ポートテーブル 411 要素 412 更新インデックス
1 task management device 101 system call processing means 102 scheduling means 103 dispatch means 104 ready queue management means 105 task queue port search means 401 port list 402, 4080-4085 task queue port 402R run queue port 403 task queue 403R run queue 4040-4043, 4046 ~ 4048 404A ~
404E, 404d Task 405 Run queue index 406 Port list head 407 Port list tail 409 Now port 410 Port table 411 Element 412 Update index

Claims (18)

【特許請求の範囲】[Claims] 【請求項1】 実行可能な複数のタスクそれぞれに予め
設定された設定優先度に基づいた優先度毎に各タスクを
管理する実行可能タスク管理手段と、前記実行可能タス
ク管理手段が管理するタスクのうち最も優先度が高いタ
スクを実行させるスケジューリング手段とを備え、前記
スケジューリング手段は、前記実行可能タスク管理手段
に対して、最も優先度が高いタスクよりも優先度が低い
タスの優先度を上げるエイジングの指示も行うタスク管
理装置であって、 前記実行可能タスク管理手段は、線状に連結された複数
の要素の順序が要素に関連付けられたタスクの優先度を
表すリストを有しており、前記エイジングを行うにあた
り、タスクが関連付けられた要素のうち最も高い優先度
を表す順序にある最高優先度要素と、当該最高優先度要
素の次順にある要素との連結を削除して次々順にある要
素を代わりに連結する操作を前記リストに対して行うタ
スク管理装置。
1. An executable task management unit that manages each task for each priority based on a preset priority set for each of a plurality of executable tasks, and a task managed by the executable task management unit. A scheduling means for executing a task with the highest priority among them, and the scheduling means raises the priority of the task with lower priority than the task with the highest priority with respect to the executable task management means. In the task management device, the executable task management means has a list in which the order of a plurality of linearly connected elements represents the priority of the task associated with the element, When performing aging, the highest priority element in the order that represents the highest priority among the elements associated with the task, and the highest priority element Task management device that performs an operation for connecting instead to the list elements in the successive order to remove the connection between elements in the following order.
【請求項2】 前記実行可能タスク管理手段は、前記最
高優先度要素との連結を削除した要素にタスクが関連付
けられている場合に、当該タスクを前記最高優先度要素
に関連付ける操作も前記リストに対して行う請求項1記
載のタスク管理装置。
2. The executable task management means, when a task is associated with an element whose connection with the highest priority element has been deleted, also associates the task with the highest priority element in the list. The task management device according to claim 1, which is performed for the task management device.
【請求項3】 前記実行可能タスク管理手段は、前記最
高優先度要素との連結を削除されタスクとの関連付けも
ない要素を、前記リストの最後尾にある要素の次順に連
結する操作も前記リストに対して行う請求項2記載のタ
スク管理装置。
3. The executable task management means also performs an operation of connecting elements that are deleted from the highest priority element and are not associated with a task, in the order following the last element in the list. The task management device according to claim 2, which is performed for
【請求項4】 前記スケジューリング手段は、前記実行
可能タスク管理手段に対して、前記エイジングによって
優先度が上げられたタスクのうち実行されたタスクの優
先度を当該タスクの設定優先度に戻すドロップの指示も
行い、 前記実行可能タスク管理手段は、前記リストの要素の順
序に対応して配列された各配列要素がそれぞれ前記リス
トの要素を特定する特定情報を保持するテーブルと、前
記ドロップの対象となるタスクの設定優先度と同じ優先
度を表す設定優先度順序にある前記リストの要素を、当
該設定優先度順序に対応する前記テーブルの配列要素に
保持された特定情報を用いて検索する要素検索手段とを
有し、前記ドロップを行うにあたり、前記要素検索手段
によって検索した前記リストの要素に前記ドロップの対
象となったタスクを関連付ける操作を行う請求項2記載
のタスク管理装置。
4. The scheduling means instructs the executable task management means to drop the priority of the executed task among the tasks whose priority has been raised by the aging to the set priority of the task. The executable task management means also provides a table in which each array element arranged corresponding to the order of the elements of the list holds specific information for identifying an element of the list, and a target of the drop. An element search for searching the elements of the list in the setting priority order indicating the same priority as the setting priority of the task using the specific information held in the array element of the table corresponding to the setting priority order And a means for performing the drop, the element of the list searched by the element search means is targeted for the drop. Task management device of claim 2, wherein performing an operation to associate the disk.
【請求項5】 前記要素検索手段は、前記配列要素のう
ち、当該配列要素の保持する前記特定情報によって特定
される前記リストの要素の順序が当該配列要素の対応し
ているものとは異なる配列要素で最も先頭側に配列され
た配列要素の順序を表す更新インデックスを保持し、前
記検索を行うにあたって、前記設定優先度順序が前記更
新インデックスの表す順序以降にあるか否かを判断し、
前記設定優先度順序が前記更新インデックスの表す順序
以降にあると判断した場合に、前記最高優先度要素に対
応する配列要素よりも最後尾側に配列され前記更新イン
デックスの表す順序以先に配列された配列要素の保持す
る前記特定情報を、当該配列要素の対応している順序に
ある前記リストの要素を特定するものに更新する操作を
予め行う請求項4記載のタスク管理装置。
5. The element search unit is an array element in which the order of elements of the list specified by the specification information held by the array element is different from the array element corresponding to the array element. Retaining the update index indicating the order of the array element arranged at the most front side in the element, in performing the search, it is determined whether or not the setting priority order is after the order represented by the update index,
When it is determined that the set priority order is after the order represented by the update index, the set priority order is arranged on the rearmost side of the array element corresponding to the highest priority element and arranged before the order represented by the update index. The task management device according to claim 4, wherein an operation for updating the identification information held by the array element to identify an element of the list in an order corresponding to the array element is performed in advance.
【請求項6】 前記要素検索手段は、アイドル状態の際
に、前記更新インデックスが表す順序よりも最後尾側に
配列された配列要素が保持する前記特定情報を、当該配
列要素の対応している順序にある前記リストの要素を特
定するものに更新する操作を行う請求項5記載のタスク
管理装置。
6. The element search means, in the idle state, associates the specific information held by array elements arranged on the rearmost side of the order represented by the update index with the array element. The task management device according to claim 5, which performs an operation of updating the elements of the list in order to specify the elements.
【請求項7】 前記要素検索手段は、前記特定情報の更
新に伴い、前記特定情報を更新した配列要素の次順に前
記更新インデックスが表す順序を更新する操作も行う請
求項5又は6記載のタスク管理装置。
7. The task according to claim 5, wherein the element search means also performs an operation of updating the order represented by the update index in the order next to the array element that has updated the specific information, in association with the update of the specific information. Management device.
【請求項8】 コンピュータを請求項1乃至7のいずれ
かに記載のタスク管理装置として機能させるためのタス
ク管理プログラム。
8. A task management program for causing a computer to function as the task management device according to claim 1.
【請求項9】 請求項1乃至7のいずれかに記載のタス
ク管理装置を備えた組込み機器。
9. An embedded device equipped with the task management device according to claim 1.
【請求項10】 実行可能な複数のタスクそれぞれに予
め設定された設定優先度に基づいた優先度毎に各タスク
を管理する実行可能タスク管理手段と、前記実行可能タ
スク管理手段が管理するタスクのうち最も優先度が高い
タスクを実行させるスケジューリング手段とを備え、前
記スケジューリング手段は、前記実行可能タスク管理手
段に対して、最も優先度が高いタスクよりも優先度が低
いタスの優先度を上げるエイジングの指示も行うタスク
管理装置であって、 前記実行可能タスク管理手段は、タスクが関連付けら
れ、関連付けられたタスクの優先度を表す値を保持する
保持要素のみが前記優先度の値に従った順序で連結され
るリストを有しており、 前記エイジングを行うにあたり、前記リストの先頭の保
持要素である最高優先度保持要素以外の保持要素が保持
する値の操作を前記リストに対して行うことを特徴とす
るタスク管理装置。
10. An executable task management unit that manages each task for each priority based on a preset priority set for each of a plurality of executable tasks, and a task managed by the executable task management unit. A scheduling means for executing a task with the highest priority among them, and the scheduling means raises the priority of the task with lower priority than the task with the highest priority with respect to the executable task management means. In the task management device, the executable task management means associates tasks with each other, and only a holding element that holds a value representing the priority of the associated task is in the order according to the priority value. Has a list linked by, and when performing the aging, the highest priority holding element that is the holding element at the head of the list is required. Task management apparatus characterized by operating the value held retaining element other than the to the list.
【請求項11】 前記実行可能タスク管理手段は、前記
エイジングを行うことで、前記最高優先度保持要素と当
該最高優先度保持要素の次順の保持要素とが保持する値
が等しくなった場合、次順の保持要素に関連付けられて
いるタスクを前記最高優先度保持要素に関連付けると共
に、前記最高優先度保持要素と次順の保持要素との連結
を削除して、次々順の保持要素を前記最高優先度保持要
素と連結する操作を前記リストに対して行う請求項10
に記載のタスク管理装置。
11. The executable task management means, by performing the aging, when the values held by the highest-priority holding element and the next-order holding elements of the highest-priority holding element are equal, The task associated with the next-order holding element is associated with the highest-priority holding element, the connection between the highest-priority holding element and the next-order holding element is deleted, and the next-order holding element is set to the highest-ranking holding element. The operation for connecting to a priority holding element is performed on the list.
Task management device described in.
【請求項12】 前記実行可能タスク管理手段は、次順
の保持要素を前記リストを格納するメモリ上からも削除
する請求項11に記載のタスク管理装置。
12. The task management device according to claim 11, wherein the executable task management unit deletes the next-order holding element also from the memory that stores the list.
【請求項13】 前記スケジューリング手段は、前記実
行可能タスク管理手段に対して、前記エイジングによっ
て最高優先度保持要素に関連付けられているタスクのう
ち実行されたタスクを、当該タスクの設定優先度と対応
する値を保持する保持要素に関連付けるドロップの指示
も行い、 前記実行可能タスク管理手段は、前記最高優先度保持要
素に関連付けられたドロップの対象となるタスクの設定
優先度と対応する値を保持する保持要素を検索する保持
要素検索手段を有し、 前記ドロップを行うにあたり、前記保持要素検索手段に
よって検索された保持要素に、ドロップの対象となるタ
スクを関連付ける操作を前記リストに対して行う請求項
10に記載のタスク管理装置。
13. The scheduling means associates with the executable task management means the executed task among the tasks associated with the highest priority holding element by the aging with the set priority of the task. The executable task management unit holds a value corresponding to the set priority of the task to be dropped associated with the highest priority holding element. A holding element search means for searching a holding element is provided, and when performing the drop, an operation of associating a task to be dropped with a holding element searched by the holding element search means is performed on the list. 10. The task management device according to item 10.
【請求項14】 前記実行可能タスク管理手段は、前記
保持要素検索手段による検索の結果、前記ドロップの対
象となるタスクの設定優先度と対応する値を保持する保
持要素を検出することができない場合、前記ドロップの
対象であるタスクの設定優先度と対応する値を保持する
保持要素を前記リストに追加すると共に、当該保持要素
にドロップの対象となるタスクを関連付ける操作を前記
リストに対して行う請求項13に記載のタスク管理装
置。
14. When the executable task management means cannot detect a holding element holding a value corresponding to the setting priority of the task to be dropped as a result of the search by the holding element searching means. , Adding a holding element holding a value corresponding to the setting priority of the task to be dropped to the list, and performing an operation of associating the task to be dropped with the holding element with respect to the list. Item 13. The task management device according to item 13.
【請求項15】 前記実行可能タスク管理手段は、前記
ドロップの実行結果、前記最高優先度保持要素にタスク
が関連付けられなくなった場合、前記最高優先度保持要
素と次順の保持要素との連結を削除し、前記最高優先度
保持要素を前記リストの先頭から削除する請求項13に
記載のタスク管理装置。
15. The executable task management means connects the highest priority holding element and the next-order holding element when a task is no longer associated with the highest priority holding element as a result of the execution of the drop. The task management device according to claim 13, wherein the task management device is deleted and the highest priority holding element is deleted from the top of the list.
【請求項16】 前記実行可能タスク管理手段は、各保
持要素をシステム内に備えられた高速メモリと低速メモ
リのうち、高速メモリ領域に置く請求項10に記載のタ
スク管理装置。
16. The task management device according to claim 10, wherein the executable task management means places each holding element in a high speed memory area of a high speed memory and a low speed memory provided in the system.
【請求項17】 コンピュータを請求項10乃至16の
いずれかに記載のタスク管理装置として機能させるため
のタスク管理プログラム。
17. A task management program for causing a computer to function as the task management device according to claim 10.
【請求項18】 請求項10乃至16のいずれかに記載
のタスク管理装置を備えた組込み機器。
18. An embedded device comprising the task management device according to claim 10.
JP2002131418A 2001-07-26 2002-05-07 Task management apparatus, task management program and embedding device thereof Pending JP2003108391A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002131418A JP2003108391A (en) 2001-07-26 2002-05-07 Task management apparatus, task management program and embedding device thereof

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2001225616 2001-07-26
JP2001-225616 2001-07-26
JP2002131418A JP2003108391A (en) 2001-07-26 2002-05-07 Task management apparatus, task management program and embedding device thereof

Publications (1)

Publication Number Publication Date
JP2003108391A true JP2003108391A (en) 2003-04-11

Family

ID=26619299

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002131418A Pending JP2003108391A (en) 2001-07-26 2002-05-07 Task management apparatus, task management program and embedding device thereof

Country Status (1)

Country Link
JP (1) JP2003108391A (en)

Similar Documents

Publication Publication Date Title
US9959313B2 (en) Database management system and method capable of dynamically issuing inputs/outputs and executing operations in parallel
CA2785398C (en) Managing queries
US7302686B2 (en) Task management system
CN110096353B (en) Task scheduling method and device
US20090083746A1 (en) Method for job management of computer system
US9928004B2 (en) Assigning device adaptors to use to copy source extents to target extents in a copy relationship
JP6885193B2 (en) Parallel processing device, job management method, and job management program
JPH09293006A (en) Method for dividing parallel database and control system thereof
US20220237016A1 (en) Apparatus for determining resource migration schedule
JP2003108391A (en) Task management apparatus, task management program and embedding device thereof
US20080127194A1 (en) Job allocation program and job allocation method
JPH05250187A (en) Task control system by ready space queue
JP2009541852A (en) Computer micro job
JP3231101B2 (en) Task queue management method
JPH1049504A (en) Load distribution batch system
JP2988427B2 (en) Recording medium recording job operation method, job operation method, and job operation program
JP2828000B2 (en) Job scheduling class management system and management method
JP2562515B2 (en) Direct access storage device selection processing method
JPH01188977A (en) Job execution control system
JPH0424828A (en) Multi-task control system
JP2003330624A (en) Extra disk assignment system and its method
JPH10171666A (en) Task control block management mechanism and its managing method
JPS63298543A (en) Access control system for file with key