JP3231101B2 - Task queue management method - Google Patents
Task queue management methodInfo
- Publication number
- JP3231101B2 JP3231101B2 JP28998792A JP28998792A JP3231101B2 JP 3231101 B2 JP3231101 B2 JP 3231101B2 JP 28998792 A JP28998792 A JP 28998792A JP 28998792 A JP28998792 A JP 28998792A JP 3231101 B2 JP3231101 B2 JP 3231101B2
- Authority
- JP
- Japan
- Prior art keywords
- task
- queue
- execution priority
- pointer
- tasks
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Description
【0001】[0001]
【産業上の利用分野】本発明は、計算機システムにおけ
る処理待ちのタスクキュー管理方法に関し、特に長大キ
ューに対し、追加あるいは削除等のキュー操作のオーバ
ヘッドを削減するのに好適なタスクキュー管理方法に関
する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method of managing task queues waiting to be processed in a computer system, and more particularly to a method of managing task queues suitable for reducing the overhead of queue operations such as addition or deletion of long queues. .
【0002】[0002]
【従来の技術】従来、計算機システムにおいては、一般
に実行待ちのタスクを実行優先順に1本のキューにつな
いで、その1つ1つを検索して実行可否の判定を行う方
式が採られていた。この方式では、タスクの実行優先順
位に従った、キューへの追加、キューからの削除のため
の、キュー検索のオーバヘッドが大きく、システム性能
が劣化する問題が解決されない。2. Description of the Related Art Conventionally, a computer system has generally adopted a system in which tasks waiting for execution are generally connected to one queue in the order of execution priority, and each of them is searched to determine whether or not execution is possible. . This method does not solve the problem that the overhead of queue search for adding to and deleting from the queue according to the task execution priority is large and the system performance is degraded.
【0003】この問題を解決するために、例えば特開平
2−281338号公報では、タスクの実行優先度ごと
にそれぞれ個別に実行待行列(キュー)を設け、該タス
クの実行待行列の長さをチェックし、その長さに応じて
タスクの実行順序を変更することにより、検索効率をあ
げる方法を提案している。また、特開平3−24629
号公報では、タスク管理ブロックを、先着順のキュー
と、実行優先順位に従ったキューとの2重キューに形成
して、タスク検索の高速化と追加、削除操作のオーバヘ
ッド削減を実現する方法を提案している。To solve this problem, for example, in Japanese Patent Laid-Open No. 2-281338, an execution queue (queue) is separately provided for each task execution priority, and the length of the execution queue of the task is reduced. It proposes a method to improve search efficiency by checking and changing the task execution order according to the length. Also, JP-A-3-24629
In Japanese Patent Application Laid-Open Publication No. H10-209, a method of forming a task management block as a double queue of a queue in a first-come-first-served order and a queue according to an execution priority order to realize a high-speed task search and a reduction in overhead of addition and deletion operations is realized. is suggesting.
【0004】[0004]
【発明が解決しようとする課題】計算機システムの規模
によっては、そのタスク数が大きくなるために、タスク
キューのメンテナンスに要する時間がプロセスそのもの
の実行時間に比べ、無視できないほどに大きくなり、シ
ステムの性能が低下してしまう。Depending on the scale of the computer system, the number of tasks increases, so that the time required for maintenance of the task queue becomes so large that it cannot be ignored compared to the execution time of the process itself. Performance will be reduced.
【0005】特開平2−281338号公報に記載の方
法は、タスクの検索効率は向上するが、実行優先順位を
無視したタスクの実行を行うため、優先実行制御を必須
とするタスクの制御には適さない。また、全体のタスク
数が少ないときには、1本のキュー構造を採った方がキ
ューへの追加、削除のための検索オーバヘッドは小さい
ものであるが、それができない。The method described in Japanese Patent Application Laid-Open No. 2-281338 improves the task search efficiency, but executes a task ignoring the execution priority. Not suitable. When the total number of tasks is small, a single queue structure has a small search overhead for adding to and deleting from the queue, but cannot do so.
【0006】特開平3−24629号公報に記載の方法
では、検索するタスク数は、実行優先順位の数分は最低
限必要で、追加処理では、さらに当該優先順位のタスク
数分は必要となるため、優先順位ごとにタスク数のバラ
ツキがある場合には、オーバヘッドが大きくなる。これ
は、場合によっては、1本だけのキューのオーバヘッド
に相当する。In the method described in JP-A-3-24629, the number of tasks to be searched must be at least as many as the number of execution priorities, and additional processing requires the number of tasks having the priorities. Therefore, when there is a variation in the number of tasks for each priority, the overhead increases. This corresponds in some cases to the overhead of only one queue.
【0007】本発明の目的は、このような問題点を解決
し、タスクキューへの追加処理時間を大幅に短縮するタ
スクキュー管理方法を提供することにある。An object of the present invention is to provide a task queue management method which solves such problems and greatly reduces the time required for additional processing to a task queue.
【0008】[0008]
【課題を解決するための手段】上記目的を達成するため
に、請求項1の発明は、処理待ちのタスクを、等しい実
行優先順位のタスクごとにグループ化し、実行優先順に
キューイングしてタスクキューイングを構成し管理する
タスクキュー管理方法において、前記タスクキューに含
まれるタスク数と処理切り分けのためのしきい値を保持
し、前記タスクキューにタスクを追加するときに、前記
タスクキューに含まれるタスク数としきい値を比較し、
比較結果に応じて、前記タスクキューへ追加するタスク
の追加位置を求める処理を決定することを特徴とする。 [MEANS FOR SOLVING THE PROBLEMS] To achieve the above object
In addition, according to the invention of claim 1, the tasks waiting to be processed are
Grouped by task with row priority and execution priority
Queuing to configure and manage task queuing
In the task queue management method, the task queue includes
Holds the number of tasks to be included and the threshold for processing separation
When adding a task to the task queue,
Compare the number of tasks in the task queue with the threshold,
Task to be added to the task queue according to the comparison result
Is characterized in that a process for obtaining an additional position is determined.
【0009】また、請求項2の発明は、実行優先順位ご
とに、タスクキューにおける該当実行優先順位のタスク
のキューの先頭および末尾のポインタを管理するキュー
ポインタリストと、前記キューポインタリストの各エン
トリに対応して、前記タスクキューにキューイングされ
ているタスクの実行優先順位を管理するインデックスリ
ストを設け、前記タスクキューに含まれるタスク数がし
きい値より大であった場合、前記キューポインタリスト
あるいは前記インデックスリストとキューポインタリス
トを使用して、前記追加するタスクの実行優先順位に応
じた追加位置を求めることを特徴とする。 Further , the invention according to claim 2 is a program for each execution priority.
And the task with the corresponding execution priority in the task queue
Queue that manages the start and end pointers of the queue
A pointer list and each entry of the queue pointer list.
Queued in the task queue corresponding to the bird
Index list that manages the execution priority of tasks
List, and the number of tasks included in the task queue is low.
If greater than the threshold, the queue pointer list
Alternatively, the index list and the queue pointer list
Use the task to match the execution priority of the task to be added.
It is characterized in that the calculated additional position is obtained.
【0010】また、請求項3の発明は、タスクキューに
含まれるタスク数がしきい値より小であった場合、前記
タスクキューを先頭あるいは末尾から検索することで、
前記 追加するタスクの実行優先順位に応じた追加位置を
求めることを特徴とする。 [0010] Further, according to the invention of claim 3, the task queue
If the number of included tasks is smaller than the threshold,
By searching the task queue from the beginning or end,
The addition position according to the execution priority of the task to be added is
It is characterized by seeking.
【0011】[0011]
【作用】キューポインタリストやインデックスリストの
検索と、タスクキューそのものの検索などとを、タスク
キュー上のタスク数を元に、処理ステップの少ない方を
動的に選択することで、追加位置決定における処理オー
バヘッドを最小とすることができる。[Operation] The search of the queue pointer list or the index list and the search of the task queue itself are dynamically selected based on the number of tasks in the task queue based on the number of tasks in the task queue, thereby determining an additional position . Processing overhead can be minimized.
【0012】例えば、タスクキューに含まれるタスク数
がしきい値より大きい場合、タスクキュー上に、該追加
対象タスクと実行優先順位が等しいタスクが既に存在す
るときに、該タスクのキュー末尾ポインタをキューポイ
ンタリストから得ることにより、追加位置をタスクキュ
ーの検索無しで高速に決定することが可能となる。ま
た、タスクキュー上に該追加対象タスクと実行優先順位
が等しいタスクが存在しないときにも、インデックスリ
ストを参照することで、タスクキュー上に存在するタス
クのうち、該追加対象タスクの実行優先順位に最も近い
上位実行優先順位のタスクのキューの末尾ポインタを、
同様なキューポインタリストから得て、タスクキューの
検索無しで追加位置を高速に決定することが可能とな
る。 For example, the number of tasks included in a task queue
Is larger than the threshold, if there is already a task having the same execution priority as the task to be added in the task queue, the end position of the queue of the task is obtained from the queue pointer list, and the addition position is determined. The determination can be made at high speed without searching the queue. Further , even when there is no task having the same execution priority as the addition target task in the task queue, by referring to the index list, the execution priority of the addition target task among the tasks existing in the task queue is determined. The end pointer of the queue of the task with the highest execution priority closest to
By obtaining the same queue pointer list, it is possible to determine the additional position at high speed without searching the task queue.
【0013】なお、タスクキューからタスクを削除する
場合は、該タスクのキューの先頭ポインタをキューポイ
ンタリストから得れば、それが即ち該削除対象タスクの
ポインタであり、タスクの検索無しで削除位置を高速に
決定することができる。When a task is deleted from the task queue, if the head pointer of the task queue is obtained from the queue pointer list, it is the pointer of the task to be deleted. Can be determined quickly.
【0014】[0014]
【実施例】以下、本発明の一実施例について図面により
説明する。An embodiment of the present invention will be described below with reference to the drawings.
【0015】図1は本発明にかかるタスクキュー管理方
法の一実施例を示す構成図で、10はタスクキュー、2
0はオペレーティングシステム(OS)、30はキュー
ポインタリスト、40はインデックスリストである。FIG. 1 is a block diagram showing one embodiment of a task queue management method according to the present invention.
0 is an operating system (OS), 30 is a queue pointer list, and 40 is an index list.
【0016】タスクキュー10は、処理待ちのタスクの
制御ブロック10a〜10fを実行優先順に、且つ同一
実行優先順位の中では発生順にキューイングする構成と
なっている。各タスクの制御ブロックは、次制御ブロッ
クポインタ11、前制御ブロックポインタ12、当該タ
スクの実行優先順位(レベル)13を保有している。ポ
インタ11、12により、タスクキュー10の各制御ブ
ロック10a〜10fを双方向にたどることができる。
このタスクキュー10それ自体の構成は従来と同様であ
る。The task queue 10 has a configuration in which the control blocks 10a to 10f of the tasks waiting to be processed are queued in the execution priority order and, in the same execution priority order, in the order of occurrence. The control block of each task has a next control block pointer 11, a previous control block pointer 12, and an execution priority (level) 13 of the task. With the pointers 11 and 12, the control blocks 10a to 10f of the task queue 10 can be traced in both directions.
The configuration of the task queue 10 itself is the same as the conventional one.
【0017】オペレーティングシステム20は、タスク
キュー10の先頭ポインタ21、同末尾ポインタ22、
キューポインタリスト30へのポインタ23、インデッ
クスリスト40へのポインタ24に加えて、後述の処理
を切り分けるためのしきい値25およびタスクキュー1
0の現タスク数26を持っている。The operating system 20 includes a head pointer 21, a tail pointer 22,
In addition to the pointer 23 to the queue pointer list 30 and the pointer 24 to the index list 40, a threshold value 25 for separating processing to be described later and a task queue 1
It has a current task number of 0.
【0018】キューポインタリスト30は、システムに
定義されているタスクの実行優先順位(実施例では01
〜FF)と1対1に対応すエントリを持ち、各エントリ
はタスクキュー10における同一の実行優先順位を持つ
タスクの制御ブロックの先頭と末尾の制御ブロックをポ
イントしている。なお、該当する実行優先順位のタスク
の制御ブロックが存在しない場合には、当該エントリに
「0」が設定される。例えばエントリ301は実行優先
順位「01」に対応し、タスクキュー10で該実行優先
位のタスクの制御ブロックは10aだけであるため、先
頭ポインタ301aおよび末尾ポインタ301bとも制
御ブロック10aをポイントしている。エントリ302
は実行優先順位「02」に対応するが、タスクキュー1
0には該当するタスクが存在しないため、先頭および末
尾ポインタ302a、302bに「0」が設定される。
エントリ303は実行優先順位「03」に対応し、タス
クキュー10で該実行優先順位のタスクの制御ブロック
は発生順に10b、10c、10dであり、先頭ポイン
タ303aは制御ブロック10bを、末尾ポインタ30
3bは制御ブロック10dをポイントしている。同様
に、エントリ3FFは実行優先順位「FF」に対応し、
先頭ポインタ3FFaはタスクキュー10における制御
ブロック10eを、末尾ポインタ3FFbは制御ブロッ
ク10fをポイントしている。The queue pointer list 30 stores the execution priority of tasks defined in the system (01 in this embodiment).
FF), and each entry points to the first and last control blocks of the control blocks of the tasks having the same execution priority in the task queue 10. If there is no control block for the task with the corresponding execution priority, “0” is set in the entry. For example, the entry 301 corresponds to the execution priority "01", and since the control block of the task having the execution priority in the task queue 10 is only 10a, both the start pointer 301a and the end pointer 301b point to the control block 10a. . Entry 302
Corresponds to the execution priority "02", but the task queue 1
Since there is no corresponding task at 0, “0” is set to the start and end pointers 302a and 302b.
The entry 303 corresponds to the execution priority "03", and the control blocks of the task having the execution priority in the task queue 10 are 10b, 10c, and 10d in the order of occurrence, the head pointer 303a indicates the control block 10b, and the end pointer 30
3b points to the control block 10d. Similarly, entry 3FF corresponds to execution priority “FF”,
The start pointer 3FFa points to the control block 10e in the task queue 10, and the end pointer 3FFb points to the control block 10f.
【0019】インデックスリスト40も、システムに定
義されているタスクの実行優先順位と1対1に対応する
エントリを持ち、各エントリは当該実行優先順位のタス
クがタスクキュー10内に存在するかどうかを示すもの
で、存在する場合には、その実行優先順位の値が設定さ
れ、存在しない場合には「0」が設定される。即ち、イ
ンデックスリスト40のエントリ401〜4FFは、キ
ューポインタリスト30のエントリ301〜3FFと1
対1に対応し、タスクキュー10の構成から、エントリ
401には「01」、エントリ402には「00」、エ
ントリ403には「03」、エントリ404には「0
0」、エントリ4FFには「FF」が設定される。The index list 40 also has entries corresponding one-to-one with the execution priorities of the tasks defined in the system. Each entry indicates whether or not the task of the execution priority exists in the task queue 10. This indicates that the value of the execution priority is set if it exists, and "0" is set if it does not exist. That is, the entries 401 to 4FF of the index list 40 are the same as the entries 301 to 3FF of the queue pointer list 30.
From the configuration of the task queue 10, the entry 401 is "01", the entry 402 is "00", the entry 403 is "03", and the entry 404 is "0".
"0" and "FF" are set in the entry 4FF.
【0020】図1の構成において、新規に処理要求の発
生したタスクの制御ブロックをタスクキュー10へ追加
する場合の処理手順を図2に示す。FIG. 2 shows a processing procedure for adding a control block of a task for which a processing request has newly occurred to the task queue 10 in the configuration of FIG.
【0021】新規に処理要求の発生したタスクの制御ブ
ロックをタスクキュー10へ追加(キューイング)する
場合、まず、キューポインタリスト30における当該追
加対象タスクの実行優先順位に対応するエントリを求
め、該エントリの内容を読み出す(ステップ101)。
キューポインタリスト30内の該当エントリは、オペレ
ーションシステム20に設定されているキューポインタ
リストポインタ23によりキューポインタリスト30の
先頭アドレスを得、これと当該追加対象タスクの実行優
先順位の値から、次のようなアドレス計算、即ち、(キ
ューポインタリストの先頭アドレス)+(ポインタリス
トの1エントリの長さ)×(タスクの実行優先順位値−
1)によって求める。例えば、図1で追加対象タスクの
実行優先順位が「03」であった場合、上記アドレス計
算により、キューポインタリスト30のエントリ303
が求まる。When adding (queuing) a control block of a task for which a processing request has newly occurred to the task queue 10, first, an entry corresponding to the execution priority of the task to be added in the queue pointer list 30 is obtained. The contents of the entry are read (step 101).
The corresponding entry in the queue pointer list 30 obtains the head address of the queue pointer list 30 by the queue pointer list pointer 23 set in the operation system 20, and determines the next address from the value of the execution priority of the task to be added. Such address calculation, that is, (start address of queue pointer list) + (length of one entry of pointer list) × (task execution priority value−
Determined by 1). For example, if the execution priority of the task to be added is “03” in FIG.
Is found.
【0022】次に、このキューポインタリスト30にお
ける当該追加対象タスクの実行優先順位に対応するエン
トリの内容が「0」かどうか調べる(ステップ10
2)。「0」でない場合、即ち、当該追加対象タスクと
同一の実行優先順位のタスクの制御ブロックが既にタス
クキュー10内に存在する場合は、当該エントリに設定
されているキュー末尾ポインタを参照して、直ちに追加
処理(キューイング)を実行する(ステップ106)。
例えば、上記の追加対象タスクの実行優先順位が「0
3」の場合、キューポインタリスト30のエントリ30
3に設定されているキュー末尾ポインタ303bの示す
制御ブロック10dの直後に該当タスクの制御ブロック
を追加し、それに伴って制御ブロック10d、10eの
ポインタ11、12を更新する。この追加処理それ自体
は従来と同様である。その後、オペレーションシステム
20内のタスク数26を+1し、キューポインタリスト
30の該当エントリのキュー末尾ポインタを該追加した
タスクの制御ブロックへのポインタ値に更新する(ステ
ップ107)。なお、このキューポインタリスト30の
該当エントリの内容が「0」でない場合には、インデッ
クスリスト40の対応するエントリに既に実行優先順位
が設定されているため、インデックスリスト40に対す
る更新処理は行われない。Next, it is checked whether the contents of the entry corresponding to the execution priority of the task to be added in the queue pointer list 30 is "0" (step 10).
2). If it is not “0”, that is, if a control block of a task having the same execution priority as the task to be added already exists in the task queue 10, refer to the queue end pointer set in the entry, Immediately, additional processing (queuing) is executed (step 106).
For example, when the execution priority of the task to be added is “0”
3 ”, the entry 30 in the queue pointer list 30
The control block of the task is added immediately after the control block 10d indicated by the queue end pointer 303b set to 3, and the pointers 11 and 12 of the control blocks 10d and 10e are updated accordingly. This additional processing itself is the same as in the related art. Thereafter, the number of tasks 26 in the operation system 20 is incremented by 1, and the queue end pointer of the corresponding entry in the queue pointer list 30 is updated to the pointer value to the control block of the added task (step 107). If the content of the entry in the queue pointer list 30 is not “0”, the execution priority is already set for the corresponding entry in the index list 40, so that the update process for the index list 40 is not performed. .
【0023】図3に、図1の例であらたに追加するタス
クの実行優先順位が「03」であった場合の、キューイ
ング後のタスクキュー10とキューポインタリスト30
の構成を示す。図3において、10gがあらたに追加さ
れたタスクの制御ブロックである。FIG. 3 shows the post-queuing task queue 10 and queue pointer list 30 when the execution priority of the task to be newly added is “03” in the example of FIG.
Is shown. In FIG. 3, 10 g is a control block of the newly added task.
【0024】図2に戻り、ステップ102でキューポイ
ンタリスト30内の該当エントリの内容が「0」と判定
された場合、即ち、当該追加対象タスクと同一の実行優
先順位のタスクの制御ブロックがタスクキュー10内に
存在しない場合は、タスクキュー10上の追加位置(キ
ューイング位置)を新規に求める必要がある。この場
合、本実施例では、オペレーションシステム20に設定
されているタスクキュー10の現タスク数26をしきい
値25と比較し、その結果にもとづいて処理を切り分け
る(ステップ103)。以下、各々の処理を説明する。Returning to FIG. 2, if the content of the entry in the queue pointer list 30 is determined to be "0" in step 102, that is, if the control block of the task having the same execution priority as the task to be added is a task block, If not present in the queue 10, an additional position (queuing position) on the task queue 10 needs to be newly obtained. In this case, in this embodiment, the current task number 26 of the task queue 10 set in the operation system 20 is compared with the threshold value 25, and the processing is separated based on the result (step 103). Hereinafter, each process will be described.
【0025】タスク数≦しきい値の場合、即ち、キュー
内のタスク数が少ない場合には、オペレーションシステ
ム20に設定されているタスクキュー10の先頭ポイン
タ21あるいは末尾ポインタ22を参照して、タスクキ
ュー10を先頭あるいは末尾から検索して追加位置を決
定する(ステップ104)。これは、キュー内のタスク
数が少ない場合には、仮にタスクキュー10を先頭から
末尾まで順に検索しても、それに要する時間はわずかで
すむためである。なお、処理切分けのためのしきい値
は、インデックスリスト40やキューポインタリスト5
0のサーチに要するステップ数などを考慮して決める。If the number of tasks ≦ the threshold value, that is, if the number of tasks in the queue is small, the task pointer 10 or the end pointer 22 of the task queue 10 set in the operation system 20 is referred to, The addition position is determined by searching the queue 10 from the beginning or end (step 104). This is because when the number of tasks in the queue is small, even if the task queue 10 is searched in order from the beginning to the end, the time required for the search is short. It should be noted that the threshold for processing separation is determined by the index list 40 or the queue pointer list 5.
The number is determined in consideration of the number of steps required for a search of zero.
【0026】このタスクキュー10を先頭あるいは末尾
から順に検索して追加位置を求める処理は従来と同じで
ある。例えば、図1で追加対象タスクの実行優先順位が
「02」であった場合、タスクキュー10を先頭の制御
ブロック10aから順番に検索し、その実行優先順位1
3を追加対象タスクの実行優先順位「02」と比較する
ことで、追加位置は制御ブロック10aと10bの間に
すべきであることが分かる。The process of searching the task queue 10 in order from the beginning or end to find an additional position is the same as the conventional process. For example, if the execution priority of the task to be added is “02” in FIG. 1, the task queue 10 is searched in order from the first control block 10a, and the execution priority 1
By comparing No. 3 with the execution priority “02” of the task to be added, it is found that the additional position should be between the control blocks 10a and 10b.
【0027】一方、タスク数>しきい値の場合、即ち、
キュー内のタスク数が多い場合には、インデックスリス
ト40およびキューポインタリスト30から追加位置を
決定する(ステップ105)。これは、次のようにして
行う。まず、オペレーションシステム20に設定されて
いるインデックスリストポインタ24を参照して、イン
デックスリスト40をサーチし、当該追加対象タスクの
実行優先順位より高い実行優先順位のうちで、最も低い
実行優先順位が設定されているエントリを求める。例え
ば、追加対象タスクの実行優先順位が「02」であった
場合、インデックスリスト40で「01」の実行優先順
位の設定されているエントリ401がこれに該当する。
次に、オペレーションシステム20に設定されているポ
インタリストポインタ23とインデックスリスト40の
上記エントリに設定されている実行優先順位とから、ス
テップ101の場合と同様のアドレス計算により、キュ
ーポインタリスト30内の該当エントリを求め、該エン
トリに設定されているタスクキュー末尾ポインタから追
加位置を決定する。例えば、上記追加対象タスクの実行
優先順位が「02」の場合、インデックスリスト40を
サーチして得られた実行優先順位「01」に対応するキ
ューポインタリスト30内のエントリは、アドレス計算
で301と求まり、該エントリ301のタスクキュー末
尾ポインタ301bの値より、追加位置は制御ブロック
10aの直後となる。On the other hand, when the number of tasks> the threshold value, that is,
If the number of tasks in the queue is large, an addition position is determined from the index list 40 and the queue pointer list 30 (step 105). This is performed as follows. First, the index list 40 is searched by referring to the index list pointer 24 set in the operation system 20, and the lowest execution priority among the execution priorities higher than the execution priority of the task to be added is set. Ask for the entry that has been. For example, when the execution priority of the task to be added is “02”, the entry 401 in the index list 40 in which the execution priority of “01” is set corresponds to this.
Next, based on the pointer list pointer 23 set in the operation system 20 and the execution priority set in the above entry of the index list 40, the same address calculation as in the case of step 101 is performed, so that the queue pointer list 30 The corresponding entry is obtained, and the addition position is determined from the task queue end pointer set in the entry. For example, when the execution priority of the task to be added is “02”, the entry in the queue pointer list 30 corresponding to the execution priority “01” obtained by searching the index list 40 becomes 301 in the address calculation. From the value of the task queue end pointer 301b of the entry 301, the addition position is immediately after the control block 10a.
【0028】このように、インデックスリスト40、キ
ューポインタリスト30を利用することで、タスクキュ
ー10のサーチを行うことなく、追加位置を高速に求め
ることができる。これは、キュー内のタスク数が多くな
ればなるほど、タスクキュー10を先頭あるいは末尾よ
り逐次サーチするのに比べて有利になる。As described above, by using the index list 40 and the queue pointer list 30, an additional position can be obtained at high speed without searching the task queue 10. This is more advantageous than searching the task queue 10 sequentially from the beginning or end as the number of tasks in the queue increases.
【0029】上記ステップ104あるいは105で追加
位置が決まったなら、タスクキュー10内の該追加位置
に当該追加対象タスクの制御ブロックを追加する(ステ
ップ106)。その後、オペレーションシステム20内
のタスク数26を+1し、キューポインタリスト30の
該追加したタスクの実行優先順位に対応するエントリの
キュー先頭/末尾ポインタに、該追加したタスクの制御
ブロックへのポインタを登録し、さらにインデックスリ
スト40の同じく対応するエントリに該追加したタスク
の実行優先順位を登録する(ステップ107)。When the addition position is determined in step 104 or 105, the control block of the task to be added is added to the addition position in the task queue 10 (step 106). Thereafter, the number of tasks 26 in the operation system 20 is incremented by 1, and the pointer to the control block of the added task is set in the queue head / end pointer of the entry corresponding to the execution priority of the added task in the queue pointer list 30. Then, the execution priority of the added task is registered in the corresponding entry of the index list 40 (step 107).
【0030】図4に、図1の例であらたに追加するタス
クの実行優先順位が「02」であった場合の、キューイ
ング後のタスクキュー10及びキューポインタリスト3
0とインデックスリスト40の構成を示す。図4におい
て、10hがあらたに追加されたタスクの制御ブロック
である。FIG. 4 shows the task queue 10 and the queue pointer list 3 after queuing when the execution priority of the task to be newly added is “02” in the example of FIG.
0 shows the structure of the index list 40. In FIG. 4, 10h is a control block of the newly added task.
【0031】次に、タスクを実行し、その制御ブロック
をタスクキュー10から削除する場合について簡単に説
明する。Next, a case where a task is executed and its control block is deleted from the task queue 10 will be briefly described.
【0032】オペレーションシステム20に設定されて
いるキューポインタリストポインタ23と当該削除対象
タスクの実行優先順位の値からアドレス計算して、キュ
ーポインタリスト30における当該削除対象タスクの実
行優先順位に対応するエントリを求めることは、追加処
理の場合と同様である。このキューポインタリスト30
の該当エントリに設定されているタスクキュー先頭ポイ
ンタのさす制御ブロックが、即ち、削除対象タスクの制
御ブロックである。従って、アドレス計算で求めたキュ
ーポインタリスト30の該当エントリのタスクキュー先
頭ポインタを参照して、直ちに削除処理を実行すること
ができる。その後、オペレーションシステム20内のタ
スク数26を−1し、キューポインタリスト30を更新
し、場合によってはインデックスリスト40も更新す
る。キューポインタリスト30の該当エントリの更新で
は、削除したタスクと同一の実行優先順位のタスクが残
っていれば、該削除したタスクの次のタスクと制御ブロ
ックポインタをタスク先頭ポインタとし、残っていなけ
れば、タスクキュー先頭ポインタ及び末尾ポインタを
“0”とする。同様に、この残っていない場合、インデ
ックスリスト40の対応するエントリを“0”とする。An address is calculated from the queue pointer list pointer 23 set in the operation system 20 and the execution priority value of the task to be deleted, and an entry corresponding to the execution priority of the task to be deleted in the queue pointer list 30 is calculated. Is the same as in the case of the additional processing. This queue pointer list 30
The control block pointed to by the task queue head pointer set in the corresponding entry is the control block of the task to be deleted. Therefore, the deletion process can be immediately executed by referring to the task queue head pointer of the corresponding entry of the queue pointer list 30 obtained by the address calculation. Thereafter, the number of tasks 26 in the operation system 20 is decremented by one, the queue pointer list 30 is updated, and in some cases, the index list 40 is also updated. In updating the corresponding entry of the queue pointer list 30, if a task having the same execution priority as the deleted task remains, the task next to the deleted task and the control block pointer are set as the task head pointer. , The task queue start pointer and the end pointer are set to “0”. Similarly, when there is no remaining entry, the corresponding entry of the index list 40 is set to “0”.
【0033】[0033]
【発明の効果】以上の説明から明らかな如く、本発明に
よれば、タスクキューに新規にタスクを追加する場合、
タスクキュー上の現タスク数を元に処理を動的に切り替
えることで、システムの状況に応じた最適な処理を行う
ことが可能となり、タスクの追加位置決定における処理
オーバーヘッドを最小とすることができる。 As is clear from the above description, the present invention
According to this, when adding a new task to the task queue,
Processing is dynamically switched based on the current number of tasks in the task queue
To perform optimal processing according to the system status
It is possible to process the additional position of the task
Overhead can be minimized.
【図1】本発明のタスクキュー、オペレーションシステ
ム、キューポインタリストおよびインデックスリストの
構成例を示す図である。FIG. 1 is a diagram showing a configuration example of a task queue, an operation system, a queue pointer list, and an index list of the present invention.
【図2】本発明によるタスクキューへの追加処理の手順
例を示す図である。FIG. 2 is a diagram showing an example of a procedure of a process of adding to a task queue according to the present invention.
【図3】図1について、同一実行優先順位のタスクが存
在する場合の、追加処理後のタスクキューとキューポイ
ンタリストの構成例を示す図である。FIG. 3 is a diagram showing a configuration example of a task queue and a queue pointer list after an addition process when tasks having the same execution priority exist in FIG. 1;
【図4】図1について、同一実行優先順位のタスクが存
在しない場合の、追加処理後のタスクキュー、キューポ
インタリスト、インデックスリストの構成例を示す図で
ある。FIG. 4 is a diagram illustrating a configuration example of a task queue, a queue pointer list, and an index list after addition processing when there is no task having the same execution priority in FIG. 1;
10 タスクキュー 10a〜10f タスクの制御ブロック 20 オペレーションシステム 26 タスクキューのタスク数 30 キューポインタリスト 301a〜3FFa キュー先頭ポインタ 301b〜3FFb キュー末尾ポインタ 40 インデックスリスト Reference Signs List 10 task queue 10a to 10f task control block 20 operation system 26 number of tasks in task queue 30 queue pointer list 301a to 3FFa queue head pointer 301b to 3FFb queue end pointer 40 index list
───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 平4−101233(JP,A) 特開 平4−199431(JP,A) 特開 平2−281338(JP,A) 特開 平3−157733(JP,A) 特開 昭63−276653(JP,A) (58)調査した分野(Int.Cl.7,DB名) G06F 9/46 G06F 17/30 ──────────────────────────────────────────────────続 き Continuation of the front page (56) References JP-A-4-101233 (JP, A) JP-A-4-199431 (JP, A) JP-A-2-281338 (JP, A) JP-A-3-301 157733 (JP, A) JP-A-62-276653 (JP, A) (58) Fields investigated (Int. Cl. 7 , DB name) G06F 9/46 G06F 17/30
Claims (3)
位のタスクごとにグループ化し、実行優先順にキューイ
ングしてタスクキューを構成し管理するタスクキュー管
理方法であって、 前記タスクキューに含まれるタスク数と処理切り分けの
ためのしきい値を保持し、 前記タスクキューにタスクを追加するときに、前記タス
クキューに含まれるタスク数としきい値を比較し、比較
結果に応じて、前記タスクキューへ追加するタスクの追
加位置を求める処理を決定することを特徴とするタスク
キュー管理方法。 A task waiting to be processed is assigned an equal execution priority.
Grouped by priority task and queued in execution priority order
Task queue management to configure and manage task queues
A physical method, the number of the processing segmentation tasks included in the task queue
For adding tasks to the task queue.
Compare the number of tasks included in the queue with the threshold and compare
Depending on the result, add a task to be added to the task queue.
A task characterized by determining a process for obtaining an additional position
Queue management method.
おいて、 実行優先順位ごとに、前記タスクキューにおける該当実
行優先順位のタスクのキューの先頭および末尾のポイン
タを管理するキューポインタリストと、前記キューポイ
ンタリストの各エントリに対応して、前記タスクキュー
にキューイングされているタスクの実行優先順位を管理
するインデックスリストを設け、 前記タスクキューに含まれるタスク数がしきい値より大
であった場合、前記キューポインタリストあるいは前記
インデックスリストとキューポインタリストを使用し
て、前記追加するタスクの実行優先順位に応じた追加位
置を求めることを特徴とするタスクキュー管理方法。 2. The task queue management method according to claim 1, wherein
For each execution priority , the corresponding
Point at top and bottom of queue for row-priority tasks
A queue pointer list for managing data, and the queue pointer
Task queue corresponding to each entry of the
Manages the execution priority of tasks queued in
An index list is set up, and the number of tasks included in the task queue is larger than a threshold.
, The queue pointer list or the
Use index list and queue pointer list
The additional task according to the execution priority of the task to be added.
A task queue management method, wherein
法において、 前記タスクキューに含まれるタスク数がしきい値より小
であった場合、前記タスクキューを先頭あるいは末尾か
ら検索することで、前記追加するタスクの実行優先順位
に応じた追加位置を求めることを特徴とするタスクキュ
ー管理方法。 3. The task queue management method according to claim 1,
The number of tasks included in the task queue is smaller than a threshold value.
If the task queue is at the beginning or end
From the execution priority of the task to be added
Task queue characterized by finding an additional position according to
-Management method.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP28998792A JP3231101B2 (en) | 1992-10-28 | 1992-10-28 | Task queue management method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP28998792A JP3231101B2 (en) | 1992-10-28 | 1992-10-28 | Task queue management method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH06139082A JPH06139082A (en) | 1994-05-20 |
| JP3231101B2 true JP3231101B2 (en) | 2001-11-19 |
Family
ID=17750315
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP28998792A Expired - Fee Related JP3231101B2 (en) | 1992-10-28 | 1992-10-28 | Task queue management method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3231101B2 (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR102062945B1 (en) | 2015-11-02 | 2020-01-06 | 캐논 가부시끼가이샤 | Information processing apparatus and method of controlling the same, and program |
Families Citing this family (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7210146B2 (en) * | 2001-06-18 | 2007-04-24 | Microsoft Corporation | Sleep queue management |
| CN100422893C (en) * | 2004-12-01 | 2008-10-01 | 上海宝信软件股份有限公司 | Control Method Based on Task Queue |
| WO2015103048A1 (en) | 2014-01-03 | 2015-07-09 | Mcafee, Inc. | Mechanisms for conserving resources of wearable devices |
| CN107222555B (en) * | 2017-06-27 | 2020-08-25 | 聚好看科技股份有限公司 | Message processing method and device |
-
1992
- 1992-10-28 JP JP28998792A patent/JP3231101B2/en not_active Expired - Fee Related
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR102062945B1 (en) | 2015-11-02 | 2020-01-06 | 캐논 가부시끼가이샤 | Information processing apparatus and method of controlling the same, and program |
Also Published As
| Publication number | Publication date |
|---|---|
| JPH06139082A (en) | 1994-05-20 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US7647595B2 (en) | Efficient event notification in clustered computing environments | |
| US6230220B1 (en) | Method for allocating either private or shared buffer memory for storing data from sort operations in accordance with an assigned value or threshold value | |
| JPH09293006A (en) | Parallel database partitioning method and management system thereof | |
| JP2003044295A (en) | Sleep queue management | |
| US20090070560A1 (en) | Method and Apparatus for Accelerating the Access of a Multi-Core System to Critical Resources | |
| CA2281856A1 (en) | Information processing system and recording medium to facilitate reading data from a large-capacity storage unit through a data buffer | |
| JP2978519B2 (en) | Document data display method and system | |
| JP3231101B2 (en) | Task queue management method | |
| CN115858175A (en) | Asynchronous I/O request priority scheduling method, device, medium and control equipment | |
| CN111581440A (en) | Hardware acceleration B + tree operation device and method thereof | |
| US5430874A (en) | Control method and system for managing memory control blocks of programmed tasks in a multi-processing system | |
| US10379899B2 (en) | Systems and methods for frame presentation and modification in a networking environment | |
| CN113051244A (en) | Data access method and device, and data acquisition method and device | |
| EP4647932A1 (en) | Data query method and system, device cluster, medium and program product | |
| US5062046A (en) | Multiple processor system having a correspondence table for transferring processing control between instruction processors | |
| JP2843748B2 (en) | Exclusive control method | |
| JP3076303B2 (en) | Information processing device | |
| JP3093714B2 (en) | Multitasking execution priority determination system | |
| CN118646723B (en) | A flow table unloading method, system, device and medium suitable for smart network card | |
| CN117938956B (en) | Optimization method, device, equipment and storage medium for cloud computing data caching strategy | |
| JP3252517B2 (en) | Input/Output Control Method and Input/Output Control System | |
| JPH10171666A (en) | Task control block management mechanism and its managing method | |
| JP2828000B2 (en) | Job scheduling class management system and management method | |
| CN112671653A (en) | CAM table operation method based on multi-core heterogeneous platform | |
| GB2236880A (en) | Controlling the operation of a computer to handle interrupts |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20070914 Year of fee payment: 6 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20080914 Year of fee payment: 7 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20080914 Year of fee payment: 7 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090914 Year of fee payment: 8 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090914 Year of fee payment: 8 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100914 Year of fee payment: 9 |
|
| LAPS | Cancellation because of no payment of annual fees |