JPH10171666A - Task control block management mechanism and its managing method - Google Patents

Task control block management mechanism and its managing method

Info

Publication number
JPH10171666A
JPH10171666A JP33321496A JP33321496A JPH10171666A JP H10171666 A JPH10171666 A JP H10171666A JP 33321496 A JP33321496 A JP 33321496A JP 33321496 A JP33321496 A JP 33321496A JP H10171666 A JPH10171666 A JP H10171666A
Authority
JP
Japan
Prior art keywords
task control
control block
priority
queue
pointer
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
JP33321496A
Other languages
Japanese (ja)
Inventor
Kazuhiro Mori
一浩 森
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.)
NEC Corp
Original Assignee
NEC Corp
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 NEC Corp filed Critical NEC Corp
Priority to JP33321496A priority Critical patent/JPH10171666A/en
Publication of JPH10171666A publication Critical patent/JPH10171666A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To quickly retrieve an inserting position into a task control block queue in an operating system. SOLUTION: Each task control block 200 corresponding to each of plural tasks managed by the operating system includes a priority queue pointer 210 constituting a priority queue. A management data area 100 in the operating system includes an overall end pointer 110 indicating the leading element of the priority queue and plural priority end pointers 120 indicating the final task control blocks of respective priority elements in the priority queue. The inserting position of a task control block to be inserted is determined by referring to the priority end pointer 120 based on the priority of the task control block.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、オペレーティング
システムにおけるタスクを制御するためのデータ構造で
あるタスク制御ブロックを管理するためのタスク制御ブ
ロック管理機構及びその管理方法に関し、特に優先度別
にタスク制御ブロックを待ち行列として管理する機構及
びその方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a task control block management mechanism for managing a task control block, which is a data structure for controlling a task in an operating system, and a management method thereof. And a method for managing a queue as a queue.

【0002】[0002]

【従来の技術】従来この種の技術では、タスク制御ブロ
ックの待ち行列を優先度順に構成するとともに、各優先
度の先頭タスク制御ブロックを接続する待ち行列を別途
構成している。
2. Description of the Related Art Conventionally, in this type of technology, a queue of task control blocks is formed in order of priority, and a queue for connecting a head task control block of each priority is separately formed.

【0003】たとえば、特開平4−101233号公報
には2階層待ち行列構造によるタスク管理方法が記載さ
れている。この従来の方法を図6を使用して説明する。
図6を参照すると、オペレーティングシステム内の各タ
スクはタスク制御ブロック900として管理され、優先
度待ち行列ポインタ910によって各タスク制御ブロッ
ク900を接続することにより、優先度待ち行列を構成
している。また、専用待ち行列ポインタ920によって
各優先度の先頭タスクのみを接続することにより、専用
待ち行列を構成している。
For example, Japanese Patent Laid-Open No. 4-101233 discloses a task management method using a two-level queue structure. This conventional method will be described with reference to FIG.
Referring to FIG. 6, each task in the operating system is managed as a task control block 900, and a priority queue is configured by connecting each task control block 900 by a priority queue pointer 910. Also, a dedicated queue is formed by connecting only the first task of each priority by the dedicated queue pointer 920.

【0004】この従来技術では、実行可能状態にあるタ
スクを優先度順にスケジューリングするために、タスク
制御ブロックをタスクの優先度順に待ち行列に挿入して
接続する。このとき、挿入するタスクの優先度と専用待
ち行列に接続されている各タスク制御ブロックに関する
タスクの優先度とを比較し、挿入位置を決定している。
すなわち、同一優先度の他のタスクとの比較をせずに挿
入位置の検索を行っている。
In this prior art, in order to schedule tasks in an executable state in order of priority, task control blocks are inserted in a queue in order of task priority and connected. At this time, the insertion position is determined by comparing the priority of the task to be inserted with the task priority of each task control block connected to the dedicated queue.
That is, the search of the insertion position is performed without comparing with other tasks of the same priority.

【0005】[0005]

【発明が解決しようとする課題】しかしながら、上述の
従来技術では、各優先度の先頭タスクを順番に辿ってい
かなければ挿入位置を検索できず、そのための処理に時
間を要するという問題がある。
However, in the above-mentioned prior art, there is a problem that the insertion position cannot be searched unless the first task of each priority is traced in order, and it takes time to perform the processing for that.

【0006】本発明はこのような従来技術の問題を解決
するものであり、簡易な構成で高速にタスク制御ブロッ
クの挿入位置を検索するための機構を提供することを目
的とする。
An object of the present invention is to solve such a problem of the prior art, and an object of the present invention is to provide a mechanism for quickly searching a task control block insertion position with a simple configuration.

【0007】[0007]

【課題を解決するための手段】上記課題を解決するため
に本発明のタスク制御ブロック管理機構は、オペレーテ
ィングシステムにおけるタスクを制御するためのデータ
構造であるタスク制御ブロックの待ち行列を管理するタ
スク制御ブロック管理機構であって、前記タスク制御ブ
ロックの待ち行列の全体の端のタスク制御ブロックへの
ポインタを保持する全体端ポインタと、前記タスク制御
ブロックの待ち行列における優先度毎の端のタスク制御
ブロックへのポインタを保持する優先度端ポインタとを
前記タスク制御ブロック外の管理データ領域に含み、新
規タスク制御ブロックの優先度に対応する前記優先度端
ポインタの示すタスク制御ブロックの次に前記新規タス
ク制御ブロックを挿入する手段と、前記優先度端ポイン
タが前記新規タスク制御ブロックを示すように更新する
手段とを含む。
According to the present invention, there is provided a task control block management mechanism for managing a queue of task control blocks, which is a data structure for controlling a task in an operating system. A block management mechanism, comprising: an entire end pointer for holding a pointer to a task control block at an entire end of the queue of the task control blocks; and a task control block at an end for each priority in the queue of the task control blocks. A priority end pointer for holding a pointer to the new task control block in the management data area outside the task control block, and the task control block indicated by the priority end pointer corresponding to the priority of the new task control block. Means for inserting a control block and the priority end pointer And means for updating as a control block.

【0008】また、本発明の他のタスク制御ブロック管
理機構は、オペレーティングシステムにおけるタスクを
制御するためのデータ構造であるタスク制御ブロックの
待ち行列を管理するタスク制御ブロック管理機構であっ
て、前記タスク制御ブロックの待ち行列の全体の端のタ
スク制御ブロックへのポインタを保持する全体端ポイン
タと、前記タスク制御ブロックの待ち行列における優先
度毎の端のタスク制御ブロックへのポインタを保持する
優先度端ポインタとを前記タスク制御ブロック外の管理
データ領域に含み、新規タスク制御ブロックの優先度と
同一の優先度を有するタスク制御ブロックが前記タスク
制御ブロックの待ち行列にある場合には前記優先度に対
応する前記優先度端ポインタの示すタスク制御ブロック
の次に前記新規タスク制御ブロックを挿入する第一の挿
入手段と、この第一の挿入手段で前記新規タスク制御ブ
ロックを挿入した場合には前記優先度端ポインタが前記
新規タスク制御ブロックを示すように更新する第一の更
新手段と、前記新規タスク制御ブロックの優先度と同一
の優先度を有するタスク制御ブロックが前記タスク制御
ブロックの待ち行列にない場合には前記優先度よりも高
く最も近い優先度に対応する前記優先度端ポインタの示
すタスク制御ブロックの次に前記新規タスク制御ブロッ
クを挿入する第二の挿入手段と、この第二の挿入手段で
前記新規タスク制御ブロックを挿入した場合には前記優
先度端ポインタが前記新規タスク制御ブロックを示すよ
うに更新する第二の更新手段とを含む。
Another task control block management mechanism of the present invention is a task control block management mechanism for managing a queue of task control blocks, which is a data structure for controlling a task in an operating system. A whole end pointer that holds a pointer to a task control block at the entire end of the control block queue; and a priority end that holds a pointer to a task control block at the end of each priority in the task control block queue. A pointer is included in the management data area outside the task control block, and corresponds to the priority when a task control block having the same priority as the priority of the new task control block is in the queue of the task control block. Next to the task control block indicated by the priority end pointer First inserting means for inserting a new task control block, and a first updating means for updating the priority end pointer to indicate the new task control block when the new task control block is inserted by the first inserting means. Updating means, and when a task control block having the same priority as the priority of the new task control block is not in the queue of the task control block, the task control block corresponding to the closest priority higher than the priority Second insertion means for inserting the new task control block next to the task control block indicated by the priority end pointer, and the priority end pointer when the new task control block is inserted by the second insertion means. And second updating means for updating to indicate the new task control block.

【0009】また、本発明の他のタスク制御ブロック管
理機構では、前記全体の端は前記タスク制御ブロックの
待ち行列の先頭要素であり、前記優先度毎の端は前記タ
スク制御ブロックの待ち行列の優先度毎の最後尾であ
る。
In another task control block management mechanism of the present invention, the entire end is a head element of a queue of the task control block, and the end for each priority is an end of a queue of the task control block. This is the end of each priority.

【0010】また、本発明のタスク制御ブロック管理方
法は、タスク制御ブロックの待ち行列の全体の端のタス
ク制御ブロックへのポインタを保持する全体端ポインタ
と、前記タスク制御ブロックの待ち行列における優先度
毎の端のタスク制御ブロックへのポインタを保持する優
先度端ポインタとを前記タスク制御ブロック外の管理デ
ータ領域に含み、新規タスク制御ブロックの優先度と同
一の優先度を有するタスク制御ブロックが前記タスク制
御ブロックの待ち行列にある場合には前記優先度に対応
する前記優先度端ポインタの示すタスク制御ブロックの
次に前記新規タスク制御ブロックを挿入した上で前記優
先度端ポインタが前記新規タスク制御ブロックを示すよ
うにし、前記新規タスク制御ブロックの優先度と同一の
優先度を有するタスク制御ブロックが前記タスク制御ブ
ロックの待ち行列にない場合には前記優先度よりも高く
最も近い優先度に対応する前記優先度端ポインタの示す
タスク制御ブロックの次に前記新規タスク制御ブロック
を挿入した上で前記優先度端ポインタが前記新規タスク
制御ブロックを示すようにする。
In the task control block management method according to the present invention, an entire end pointer for holding a pointer to the task control block at the entire end of the queue of the task control block; and a priority of the task control block in the queue. A priority end pointer that holds a pointer to a task control block at each end in the management data area outside the task control block, and the task control block having the same priority as the priority of the new task control block is If the task control block is in the queue, the new task control block is inserted next to the task control block indicated by the priority end pointer corresponding to the priority, and the priority end pointer is set to the new task control. Blocks having the same priority as that of the new task control block. When the task control block is not in the task control block queue, the new task control block is inserted next to the task control block indicated by the priority end pointer corresponding to the closest priority higher than the priority. Above, the priority end pointer points to the new task control block.

【0011】また、本発明の他のタスク制御ブロック管
理方法は、タスク制御ブロックの待ち行列の全体の端の
タスク制御ブロックへのポインタを保持する全体端ポイ
ンタと、前記タスク制御ブロックの待ち行列における優
先度毎の端のタスク制御ブロックへのポインタを保持す
る優先度端ポインタとを前記タスク制御ブロック外の管
理データ領域に含み、新規タスク制御ブロックの優先度
と同一の優先度を有するタスク制御ブロックが前記タス
ク制御ブロックの待ち行列にある場合には前記優先度よ
りも高く最も近い優先度に対応する前記優先度端ポイン
タの示すタスク制御ブロックの次に前記新規タスク制御
ブロックを挿入し、前記新規タスク制御ブロックの優先
度と同一の優先度を有するタスク制御ブロックが前記タ
スク制御ブロックの待ち行列にない場合には前記優先度
よりも高く最も近い優先度に対応する前記優先度端ポイ
ンタの示すタスク制御ブロックの次に前記新規タスク制
御ブロックを挿入した上で前記優先度端ポインタが前記
新規タスク制御ブロックを示すようにする。
In another task control block management method according to the present invention, an entire end pointer for holding a pointer to a task control block at the entire end of a queue of task control blocks; A task control block having a priority end pointer holding a pointer to a task control block at the end of each priority in a management data area outside the task control block, and having the same priority as the priority of the new task control block When the new task control block is in the task control block queue, the new task control block is inserted next to the task control block indicated by the priority end pointer corresponding to the highest priority higher than the priority, and the new task control block is inserted. The task control block having the same priority as the priority of the task control block is the task control block. When not in the queue, after inserting the new task control block next to the task control block indicated by the priority end pointer corresponding to the closest priority higher than the priority, the priority end pointer is Indicate a new task control block.

【0012】また、本発明の他のタスク制御ブロック管
理方法では、前記全体の端は前記タスク制御ブロックの
待ち行列の先頭要素であり、前記優先度毎の端は前記タ
スク制御ブロックの待ち行列の優先度毎の最後尾であ
る。
In another task control block management method according to the present invention, the whole end is a head element of a queue of the task control block, and the end for each priority is an end of a queue of the task control block. This is the end of each priority.

【0013】[0013]

【発明の実施の形態】次に本発明のタスク制御ブロック
管理機構の実施の形態について図面を参照して詳細に説
明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Next, an embodiment of the task control block management mechanism of the present invention will be described in detail with reference to the drawings.

【0014】図1を参照すると、本発明のタスク制御ブ
ロック管理機構の実施の形態は、オペレーティングシス
テムにより管理される各タスクの各々に対応して設けら
れるタスク制御ブロック200を管理する。このタスク
制御ブロック200は、優先度待ち行列ポインタ210
を含み、この優先度待ち行列ポインタ210によって各
タスク制御ブロック200を接続することにより、優先
度待ち行列を構成している。この優先度待ち行列では、
例えば、優先度の高いタスクから順番にタスク制御ブロ
ックが接続され、最も優先度の低いタスクの優先度待ち
行列ポインタ210には最終要素であることを表す識別
子(例えば、「ヌルポインタ」)が設定される。
Referring to FIG. 1, an embodiment of the task control block management mechanism of the present invention manages a task control block 200 provided for each of the tasks managed by the operating system. The task control block 200 includes a priority queue pointer 210
Priority queues are configured by connecting the respective task control blocks 200 by the priority queue pointer 210. In this priority queue,
For example, task control blocks are connected in order from the task with the highest priority, and an identifier (for example, a “null pointer”) indicating the last element is set in the priority queue pointer 210 of the task with the lowest priority. Is done.

【0015】優先度待ち行列において、同一優先度内の
タスク制御ブロックの順序は、予め定められた管理方法
に従う。例えば、先入れ先出し(FIFO)管理を行う
ならば、新たに挿入しようとするタスク制御ブロックは
該当する優先度における最後尾要素として挿入される。
また、後入れ先出し(LIFO)管理を行うならば、新
たに挿入しようとするタスク制御ブロックは該当する優
先度における先頭要素として挿入される。
[0015] In the priority queue, the order of task control blocks within the same priority follows a predetermined management method. For example, when performing first-in first-out (FIFO) management, a task control block to be newly inserted is inserted as the last element in the corresponding priority.
If last-in-first-out (LIFO) management is performed, a task control block to be newly inserted is inserted as a head element at a corresponding priority.

【0016】タスク制御ブロック200はさらにタスク
制御情報220を含む。オペレーティングシステムで
は、このタスク制御情報220に基づいてタスクの実行
状態を制御する。このタスク制御情報220には、例え
ば、タスク名、プログラムカウンタの値、スタック領域
へのポインタ、レジスタの値などが退避されており、タ
スクの再開にあたってこれらの情報が処理装置に復元さ
れる。
The task control block 200 further includes task control information 220. The operating system controls the execution state of the task based on the task control information 220. In the task control information 220, for example, a task name, a value of a program counter, a pointer to a stack area, a value of a register, and the like are saved, and when the task is restarted, these information are restored to the processing device.

【0017】管理データ領域100は、優先度待ち行列
の全体としての端要素(例えば、先頭要素)を示す全体
端ポインタ110と、優先度待ち行列内の各優先度の端
要素(例えば、最後尾)のタスク制御ブロックを示す優
先度端ポインタ120を含む。優先度端ポインタ120
は、各優先度の各々に対応して設けられる。該当する優
先度に対応するタスク制御ブロックが存在しない場合に
は、この優先度端ポインタ120は、空であることを表
す識別子(例えば、「ヌルポインタ」)が設定される。
The management data area 100 includes an overall end pointer 110 indicating an end element (for example, a head element) as a whole of the priority queue, and an end element (for example, a tail end) of each priority in the priority queue. ) Includes the priority end pointer 120 indicating the task control block. Priority end pointer 120
Are provided corresponding to each of the priorities. If there is no task control block corresponding to the priority, the priority end pointer 120 is set with an identifier indicating that it is empty (for example, a “null pointer”).

【0018】次に本発明のタスク制御ブロック管理機構
の上記一実施例の動作について図面を参照して説明す
る。なお、ここでは、全体端ポインタ110は優先度待
ち行列の先頭要素を示し、優先度端ポインタ120は優
先度待ち行列内の各優先度の最後尾のタスク制御ブロッ
クを示すものとする。
Next, the operation of the embodiment of the task control block management mechanism of the present invention will be described with reference to the drawings. Here, the overall end pointer 110 indicates the head element of the priority queue, and the priority end pointer 120 indicates the last task control block of each priority in the priority queue.

【0019】図2を参照すると、新たなタスク制御ブロ
ックを先入れ先出し管理により挿入する場合には、オペ
レーティングシステムのディスパッチャは、新たに挿入
するタスクの優先度を変数Xに設定する(ステップS3
01)。そして、優先度Xのタスク制御ブロックが優先
度待ち行列内にあるか否かを調べる(ステップS30
2)。ステップS302において、優先度Xのタスク制
御ブロックが優先度待ち行列内にないと判断した場合に
は、ステップS400の挿入処理を行う。
Referring to FIG. 2, when a new task control block is inserted by first-in first-out management, the dispatcher of the operating system sets the priority of the newly inserted task to a variable X (step S3).
01). Then, it is checked whether or not the task control block of the priority X is in the priority queue (step S30).
2). If it is determined in step S302 that the task control block with the priority X is not in the priority queue, the insertion processing in step S400 is performed.

【0020】ステップS302において、優先度Xのタ
スク制御ブロックが優先度待ち行列内にあると判断した
場合には、挿入しようとするタスク(以下、挿入タスク
という。)の直前のタスク(以下、直前タスクとい
う。)として優先度Xの最後尾タスクを選択する(ステ
ップS303)。この最後尾タスクの選択は、管理デー
タ領域100内の優先度端ポインタ120より容易に得
ることができる。
In step S302, when it is determined that the task control block of the priority X is in the priority queue, the task immediately before the task to be inserted (hereinafter, referred to as an insertion task) (hereinafter, immediately before). The last task with the priority X is selected as a task (refer to step S303). The selection of the last task can be easily obtained from the priority end pointer 120 in the management data area 100.

【0021】次に、挿入タスクの優先度待ち行列ポイン
タ210に、直前タスクの優先度待ち行列ポインタ21
0を複写する(ステップS304)。そして、直前タス
クの優先度待ち行列ポインタ210に、挿入タスクへの
ポインタを設定する(ステップS305)。その後、優
先度Xの優先度端ポインタ120に、挿入タスクへのポ
インタを設定する(ステップS306)。
Next, the priority queue pointer 210 of the immediately preceding task is added to the priority queue pointer 210 of the inserted task.
0 is copied (step S304). Then, a pointer to the inserted task is set in the priority queue pointer 210 of the immediately preceding task (step S305). Then, a pointer to the insertion task is set as the priority end pointer 120 of the priority X (step S306).

【0022】図3を参照すると、上記図2のステップS
303からS306の動作結果が示される。すなわち、
図3(a)はステップS303実行後の状態を表し、図
3(b)はステップS304実行後の状態を表し、ま
た、図3(c)はステップS305及びS306実行後
の状態を表している。この一連の処理により、挿入タス
クに係るタスク制御ブロックが優先度待ち行列に挿入さ
れる。
Referring to FIG. 3, step S in FIG.
The operation results from 303 to S306 are shown. That is,
3A illustrates a state after execution of step S303, FIG. 3B illustrates a state after execution of step S304, and FIG. 3C illustrates a state after execution of steps S305 and S306. . Through this series of processing, the task control block relating to the insertion task is inserted into the priority queue.

【0023】次に、図4を参照すると、上記図2のステ
ップS400の挿入処理は以下のように行われる。ま
ず、オペレーティングシステムのディスパッチャは、挿
入タスクの優先度を変数Yに設定する(ステップS40
1)。そして、変数Yの値を1つ減じ(ステップS40
2)、この新たな変数Yにつき優先度Yのタスク制御ブ
ロックが優先度待ち行列内にあるか否かを調べる(ステ
ップS403)。但し、本願では、優先度は0が最も高
くこの値が増すにつれて優先度が低くなるものとする。
Next, referring to FIG. 4, the insertion processing in step S400 in FIG. 2 is performed as follows. First, the dispatcher of the operating system sets the priority of the insertion task to the variable Y (step S40).
1). Then, the value of the variable Y is reduced by one (step S40).
2) It is checked whether a task control block of priority Y is in the priority queue for the new variable Y (step S403). However, in the present application, the priority is the highest and the priority decreases as this value increases.

【0024】ステップS403において、優先度Yのタ
スク制御ブロックが優先度待ち行列内にないと判断した
場合には、さらにその優先度Yがオペレーティングシス
テムで管理できる最高の優先度か否かを調べ(ステップ
S404)、最高の優先度でなければステップS402
へ戻る。
If it is determined in step S403 that the task control block with the priority Y is not in the priority queue, it is further checked whether the priority Y is the highest priority that can be managed by the operating system (step S403). Step S404), if not the highest priority, step S402
Return to

【0025】ステップS404において、優先度Yが最
高の優先度であると判断した場合には、以下の動作を行
う。まず、挿入タスクの優先度待ち行列ポインタ210
に、全体端ポインタ110を複写する(ステップS40
5)。そして、全体端ポインタ110に、挿入タスクへ
のポインタを設定する(ステップS406)。その後、
優先度Xの優先度端ポインタ120に、挿入タスクへの
ポインタを設定する(ステップS410)。
If it is determined in step S404 that the priority Y is the highest priority, the following operation is performed. First, the priority queue pointer 210 of the insertion task
Then, the entire end pointer 110 is copied (step S40).
5). Then, a pointer to the insertion task is set as the entire end pointer 110 (step S406). afterwards,
The pointer to the insertion task is set as the priority end pointer 120 of the priority X (step S410).

【0026】ステップ403において、優先度Yのタス
ク制御ブロックが優先度待ち行列内にあると判断した場
合には、直前タスクとして優先度Yの最後尾タスクを選
択する(ステップS407)。そして、挿入タスクの優
先度待ち行列ポインタ210に直前タスクの優先度待ち
行列ポインタ210を複写し(ステップS408)、直
前タスクの優先度待ち行列ポインタ210に挿入タスク
へのポインタを設定する(ステップS409)。その
後、優先度Xの優先度端ポインタ120に、挿入タスク
へのポインタを設定する(ステップS410)。
If it is determined in step 403 that the task control block of priority Y is in the priority queue, the last task of priority Y is selected as the immediately preceding task (step S407). Then, the priority queue pointer 210 of the immediately preceding task is copied to the priority queue pointer 210 of the inserted task (step S408), and a pointer to the inserted task is set as the priority queue pointer 210 of the immediately preceding task (step S409). ). Thereafter, a pointer to the insertion task is set as the priority end pointer 120 of the priority X (step S410).

【0027】次に図5を参照すると、新たなタスク制御
ブロックを後入れ先出し管理により挿入する場合には、
オペレーティングシステムのディスパッチャは、挿入タ
スクの優先度を変数Xに設定する(ステップS50
1)。そして、優先度Xのタスク制御ブロックが優先度
待ち行列内にあるか否かを調べる(ステップS50
2)。ステップS302において、優先度Xのタスク制
御ブロックが優先度待ち行列内にないと判断した場合に
は、ステップS600の挿入処理を行う。このステップ
S600の挿入処理は図4の挿入処理と同様である。
Referring now to FIG. 5, when a new task control block is inserted by last-in first-out management,
The dispatcher of the operating system sets the priority of the insertion task to the variable X (step S50).
1). Then, it is checked whether or not the task control block of the priority X is in the priority queue (step S50).
2). If it is determined in step S302 that the task control block with the priority X is not in the priority queue, the insertion processing in step S600 is performed. The insertion processing in step S600 is the same as the insertion processing in FIG.

【0028】ステップS502において、優先度Xのタ
スク制御ブロックが優先度待ち行列内にあると判断した
場合には、挿入タスクの優先度を変数Zに設定する(ス
テップS503)。そして、変数Zの値を1つ減じ(ス
テップS504)、この新たな変数Zにつき優先度Zの
タスク制御ブロックが優先度待ち行列内にあるか否かを
調べる(ステップS505)。
If it is determined in step S502 that the task control block of the priority X is in the priority queue, the priority of the inserted task is set to the variable Z (step S503). Then, the value of the variable Z is decremented by one (step S504), and it is checked whether or not the task control block of the priority Z is in the priority queue for the new variable Z (step S505).

【0029】ステップS505において、優先度Zのタ
スク制御ブロックが優先度待ち行列内にないと判断した
場合には、さらにその優先度Zがオペレーティングシス
テムで管理できる最高の優先度か否かを調べ(ステップ
S506)、最高の優先度でなければステップS504
へ戻る。
If it is determined in step S505 that the task control block of the priority Z is not in the priority queue, it is further checked whether or not the priority Z is the highest priority that can be managed by the operating system (step S505). Step S506), if not the highest priority, step S504
Return to

【0030】ステップS506において、優先度Zが最
高の優先度であると判断した場合には、以下の動作を行
う。まず、挿入タスクの優先度待ち行列ポインタ210
に、全体端ポインタ110を複写する(ステップS50
7)。そして、全体端ポインタ110に、挿入タスクへ
のポインタを設定する(ステップS508)。
If it is determined in step S506 that the priority Z is the highest priority, the following operation is performed. First, the priority queue pointer 210 of the insertion task
Then, the entire end pointer 110 is copied (step S50).
7). Then, a pointer to the insertion task is set as the entire end pointer 110 (step S508).

【0031】ステップ505において、優先度Zのタス
ク制御ブロックが優先度待ち行列内にあると判断した場
合には、直前タスクとして優先度Zの最後尾タスクを選
択する(ステップS509)。そして、挿入タスクの優
先度待ち行列ポインタ210に直前タスクの優先度待ち
行列ポインタ210を複写し(ステップS510)、直
前タスクの優先度待ち行列ポインタ210に挿入タスク
へのポインタを設定する(ステップS511)。
If it is determined in step 505 that the task control block having the priority Z is in the priority queue, the last task having the priority Z is selected as the immediately preceding task (step S509). Then, the priority queue pointer 210 of the immediately preceding task is copied to the priority queue pointer 210 of the inserted task (step S510), and a pointer to the inserted task is set as the priority queue pointer 210 of the immediately preceding task (step S511). ).

【0032】このように、本発明の一実施例であるタス
ク制御ブロック管理機構によれば、オペレーティングシ
ステムの管理データ領域100内に各優先度に対する優
先度端ポインタ120を設けたことにより、各優先度の
先頭タスクを順番に辿らなくてもタスク制御ブロックの
挿入位置を検索でき、簡易な構成により高速にタスク制
御ブロックの管理を行うことができる。
As described above, according to the task control block management mechanism of one embodiment of the present invention, the priority end pointer 120 for each priority is provided in the management data area 100 of the operating system. The insertion position of the task control block can be searched without tracing the first task in sequence, and the task control block can be managed at high speed with a simple configuration.

【0033】[0033]

【発明の効果】以上の説明で明らかなように、本発明に
よると、簡易な構成によりタスク制御ブロックの挿入位
置を高速に検索でき、効率の良いタスク制御ブロック管
理を実現できる。
As apparent from the above description, according to the present invention, the insertion position of the task control block can be searched at high speed with a simple configuration, and efficient task control block management can be realized.

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

【図1】本発明のタスク制御ブロック管理機構の一実施
例の構成を示すブロック図である。
FIG. 1 is a block diagram showing a configuration of an embodiment of a task control block management mechanism of the present invention.

【図2】本発明の一実施例のタスク制御ブロック管理機
構におけるタスク制御ブロックの先入れ先出し挿入処理
の動作を表す図である。
FIG. 2 is a diagram illustrating an operation of a first-in first-out insertion process of a task control block in the task control block management mechanism of one embodiment of the present invention.

【図3】本発明の一実施例のタスク制御ブロック管理機
構におけるタスク制御ブロックの挿入手順を表す図であ
る。
FIG. 3 is a diagram illustrating a procedure for inserting a task control block in a task control block management mechanism according to an embodiment of the present invention.

【図4】本発明の一実施例のタスク制御ブロック管理機
構におけるタスク制御ブロックの挿入処理の動作を表す
図である。
FIG. 4 is a diagram illustrating an operation of a task control block insertion process in the task control block management mechanism of one embodiment of the present invention.

【図5】本発明の一実施例のタスク制御ブロック管理機
構におけるタスク制御ブロックの後入れ先出し挿入処理
の動作を表す図である。
FIG. 5 is a diagram illustrating an operation of a last-in first-out insertion process of the task control block in the task control block management mechanism of one embodiment of the present invention.

【図6】従来のタスク制御ブロック管理機構の構成を示
すブロック図である。
FIG. 6 is a block diagram showing a configuration of a conventional task control block management mechanism.

【符号の説明】 100 管理データ領域 110 先頭要素ポインタ 120 最後尾ポインタ 200 タスク制御ブロック 210 優先度待ち行列ポインタ 220 タスク制御情報[Description of Signs] 100 management data area 110 first element pointer 120 last pointer 200 task control block 210 priority queue pointer 220 task control information

Claims (7)

【特許請求の範囲】[Claims] 【請求項1】 オペレーティングシステムにおけるタス
クを制御するためのデータ構造であるタスク制御ブロッ
クの待ち行列を管理するタスク制御ブロック管理機構で
あって、前記タスク制御ブロックの待ち行列の全体の端
のタスク制御ブロックへのポインタを保持する全体端ポ
インタと、前記タスク制御ブロックの待ち行列における
優先度毎の端のタスク制御ブロックへのポインタを保持
する優先度端ポインタとを前記タスク制御ブロック外の
管理データ領域に含み、 新規タスク制御ブロックの優先度に対応する前記優先度
端ポインタの示すタスク制御ブロックの次に前記新規タ
スク制御ブロックを挿入する手段と、 前記優先度端ポインタが前記新規タスク制御ブロックを
示すように更新する手段とを含むことを特徴とするタス
ク制御ブロック管理機構。
1. A task control block management mechanism for managing a queue of task control blocks, which is a data structure for controlling tasks in an operating system, comprising: a task control unit for controlling an entire end of the queue of the task control blocks. A management data area outside the task control block, including a whole end pointer holding a pointer to the block and a priority end pointer holding a pointer to a task control block at the end of each priority in the queue of the task control block. Means for inserting the new task control block next to the task control block indicated by the priority end pointer corresponding to the priority of the new task control block; and wherein the priority end pointer indicates the new task control block. Means for updating the task control block. Click management mechanism.
【請求項2】 オペレーティングシステムにおけるタス
クを制御するためのデータ構造であるタスク制御ブロッ
クの待ち行列を管理するタスク制御ブロック管理機構で
あって、前記タスク制御ブロックの待ち行列の全体の端
のタスク制御ブロックへのポインタを保持する全体端ポ
インタと、前記タスク制御ブロックの待ち行列における
優先度毎の端のタスク制御ブロックへのポインタを保持
する優先度端ポインタとを前記タスク制御ブロック外の
管理データ領域に含み、 新規タスク制御ブロックの優先度と同一の優先度を有す
るタスク制御ブロックが前記タスク制御ブロックの待ち
行列にある場合には前記優先度に対応する前記優先度端
ポインタの示すタスク制御ブロックの次に前記新規タス
ク制御ブロックを挿入する第一の挿入手段と、 この第一の挿入手段で前記新規タスク制御ブロックを挿
入した場合には前記優先度端ポインタが前記新規タスク
制御ブロックを示すように更新する第一の更新手段と、 前記新規タスク制御ブロックの優先度と同一の優先度を
有するタスク制御ブロックが前記タスク制御ブロックの
待ち行列にない場合には前記優先度よりも高く最も近い
優先度に対応する前記優先度端ポインタの示すタスク制
御ブロックの次に前記新規タスク制御ブロックを挿入す
る第二の挿入手段と、 この第二の挿入手段で前記新規タスク制御ブロックを挿
入した場合には前記優先度端ポインタが前記新規タスク
制御ブロックを示すように更新する第二の更新手段とを
含むことを特徴とするタスク制御ブロック管理機構。
2. A task control block management mechanism for managing a queue of task control blocks, which is a data structure for controlling tasks in an operating system, comprising: a task control unit for controlling an entire end of the queue of the task control blocks. A management data area outside the task control block, including a whole end pointer holding a pointer to the block and a priority end pointer holding a pointer to a task control block at the end of each priority in the queue of the task control block. In the case where a task control block having the same priority as the priority of the new task control block is in the queue of the task control block, the task control block indicated by the priority end pointer corresponding to the priority Next, first insertion means for inserting the new task control block, First updating means for updating the priority end pointer to indicate the new task control block when the new task control block is inserted by the first insertion means; and the priority of the new task control block. If there is no task control block having the same priority in the task control block queue, the task control block indicated by the priority end pointer corresponding to the closest priority higher than the priority and the new task control block is added to the new task control block. A second inserting means for inserting a task control block; and a second updating means for updating the priority end pointer so as to indicate the new task control block when the new task control block is inserted by the second inserting means. A task control block management mechanism.
【請求項3】 前記全体の端は前記タスク制御ブロック
の待ち行列の先頭要素であり、 前記優先度毎の端は前記タスク制御ブロックの待ち行列
の優先度毎の最後尾であることを特徴とする請求項1記
載のタスク制御ブロック管理機構。
3. The task control block according to claim 1, wherein the entire end is a head element of a queue of the task control block, and the end of each priority is a tail end of the task control block in a queue of each priority. 2. The task control block management mechanism according to claim 1, wherein:
【請求項4】 オペレーティングシステムにおけるタス
クを制御するためのデータ構造であるタスク制御ブロッ
クの待ち行列の全体の端のタスク制御ブロックへのポイ
ンタを保持する全体端ポインタと、前記タスク制御ブロ
ックの待ち行列における優先度毎の端のタスク制御ブロ
ックへのポインタを保持する優先度端ポインタとを前記
タスク制御ブロック外の管理データ領域に含み、 新規タスク制御ブロックの優先度と同一の優先度を有す
るタスク制御ブロックが前記タスク制御ブロックの待ち
行列にある場合には前記優先度に対応する前記優先度端
ポインタの示すタスク制御ブロックの次に前記新規タス
ク制御ブロックを挿入した上で前記優先度端ポインタが
前記新規タスク制御ブロックを示すようにし、 前記新規タスク制御ブロックの優先度と同一の優先度を
有するタスク制御ブロックが前記タスク制御ブロックの
待ち行列にない場合には前記優先度よりも高く最も近い
優先度に対応する前記優先度端ポインタの示すタスク制
御ブロックの次に前記新規タスク制御ブロックを挿入し
た上で前記優先度端ポインタが前記新規タスク制御ブロ
ックを示すようにすることを特徴とするタスク制御ブロ
ック管理方法。
4. An entire end pointer for holding a pointer to a task control block at an end of a queue of task control blocks, which is a data structure for controlling a task in an operating system; and a queue of the task control block. And a priority end pointer holding a pointer to a task control block at the end of each priority in the management data area outside the task control block, and the task control having the same priority as the priority of the new task control block When a block is in the task control block queue, the new task control block is inserted next to the task control block indicated by the priority end pointer corresponding to the priority, and the priority end pointer is A new task control block is indicated, and the superiority of the new task control block is indicated. If there is no task control block having the same priority as the task control block in the queue of the task control block, the task control block indicated by the priority end pointer corresponding to the closest priority higher than the priority is next A task control block management method, wherein the priority end pointer indicates the new task control block after inserting the new task control block.
【請求項5】 前記全体の端は前記タスク制御ブロック
の待ち行列の先頭要素であり、 前記優先度毎の端は前記タスク制御ブロックの待ち行列
の優先度毎の最後尾であることを特徴とする請求項3記
載のタスク制御ブロック管理方法。
5. The task control block according to claim 5, wherein the entire end is a head element of a queue of the task control block, and the end of each priority is a tail end of the task control block in a queue. 4. The task control block management method according to claim 3, wherein:
【請求項6】 オペレーティングシステムにおけるタス
クを制御するためのデータ構造であるタスク制御ブロッ
クの待ち行列の全体の端のタスク制御ブロックへのポイ
ンタを保持する全体端ポインタと、前記タスク制御ブロ
ックの待ち行列における優先度毎の端のタスク制御ブロ
ックへのポインタを保持する優先度端ポインタとを前記
タスク制御ブロック外の管理データ領域に含み、 新規タスク制御ブロックの優先度と同一の優先度を有す
るタスク制御ブロックが前記タスク制御ブロックの待ち
行列にある場合には前記優先度よりも高く最も近い優先
度に対応する前記優先度端ポインタの示すタスク制御ブ
ロックの次に前記新規タスク制御ブロックを挿入し、 前記新規タスク制御ブロックの優先度と同一の優先度を
有するタスク制御ブロックが前記タスク制御ブロックの
待ち行列にない場合には前記優先度よりも高く最も近い
優先度に対応する前記優先度端ポインタの示すタスク制
御ブロックの次に前記新規タスク制御ブロックを挿入し
た上で前記優先度端ポインタが前記新規タスク制御ブロ
ックを示すようにすることを特徴とするタスク制御ブロ
ック管理方法。
6. An entire end pointer for holding a pointer to a task control block at an end of a queue of task control blocks, which is a data structure for controlling a task in an operating system; and a queue for the task control block. And a priority end pointer holding a pointer to a task control block at the end of each priority in the management data area outside the task control block, and the task control having the same priority as the priority of the new task control block If the block is in the task control block queue, insert the new task control block next to the task control block indicated by the priority end pointer corresponding to the closest priority higher than the priority, A task control block that has the same priority as the priority of the new task control block If the task control block is not in the queue, the new task control block is inserted next to the task control block indicated by the priority end pointer corresponding to the closest priority higher than the priority, and A task control block management method, wherein an initial pointer indicates the new task control block.
【請求項7】 前記全体の端は前記タスク制御ブロック
の待ち行列の先頭要素であり、 前記優先度毎の端は前記タスク制御ブロックの待ち行列
の優先度毎の最後尾であることを特徴とする請求項5記
載のタスク制御ブロック管理方法。
7. The task control block according to claim 1, wherein the whole end is a head element of a queue of the task control block, and the end of each priority is a tail end of a queue of the task control block for each priority. 6. The task control block management method according to claim 5, wherein:
JP33321496A 1996-12-13 1996-12-13 Task control block management mechanism and its managing method Pending JPH10171666A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP33321496A JPH10171666A (en) 1996-12-13 1996-12-13 Task control block management mechanism and its managing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP33321496A JPH10171666A (en) 1996-12-13 1996-12-13 Task control block management mechanism and its managing method

Publications (1)

Publication Number Publication Date
JPH10171666A true JPH10171666A (en) 1998-06-26

Family

ID=18263598

Family Applications (1)

Application Number Title Priority Date Filing Date
JP33321496A Pending JPH10171666A (en) 1996-12-13 1996-12-13 Task control block management mechanism and its managing method

Country Status (1)

Country Link
JP (1) JPH10171666A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1182550A2 (en) * 2000-08-21 2002-02-27 Texas Instruments France Task based priority arbitration

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1182550A2 (en) * 2000-08-21 2002-02-27 Texas Instruments France Task based priority arbitration
EP1182550A3 (en) * 2000-08-21 2006-08-30 Texas Instruments France Task based priority arbitration

Similar Documents

Publication Publication Date Title
US6006247A (en) Method and system for scheduling threads and handling exceptions within a multiprocessor data processing system
US6360219B1 (en) Object queues with concurrent updating
JPH09505191A (en) Method and apparatus for synchronization and scheduling of multiple data streams and real-time tasks
CN110720096B (en) Multi-sensor state estimation method and device and terminal equipment
KR970016979A (en) Queuing system and method of tasks in a multiprocessing system
US20240036921A1 (en) Cascading of Graph Streaming Processors
US20020052726A1 (en) Performance simulation apparatus, performance simulation method, and recording medium containing performance simulation program
JP3245500B2 (en) Event management method in multi-programming
JPH10171666A (en) Task control block management mechanism and its managing method
JP3231101B2 (en) Task queue management method
JP3260632B2 (en) Multiple data format table management method
JP2885631B2 (en) Operating system management device and operating system management method
JPH04101233A (en) Task controlling method by two-hierarchy queue structure
JPH11184716A (en) Queue managing system
JP2828000B2 (en) Job scheduling class management system and management method
JPH10222382A (en) Device driver installation system
JPS6389933A (en) Queue control system
JP2538040B2 (en) Process priority setting method and multi-process management device
GB2236880A (en) Controlling the operation of a computer to handle interrupts
JPH08286950A (en) Information processor and trace information storage method
JPH02187841A (en) Memory buffer managing system
JPH08292906A (en) Update buffer management device
JP2000010803A (en) Information processor
JPH06230944A (en) Object control system
JP2001060154A (en) Similar processing executing device

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 19990615