JP2522388B2 - How to control tasks - Google Patents

How to control tasks

Info

Publication number
JP2522388B2
JP2522388B2 JP1103008A JP10300889A JP2522388B2 JP 2522388 B2 JP2522388 B2 JP 2522388B2 JP 1103008 A JP1103008 A JP 1103008A JP 10300889 A JP10300889 A JP 10300889A JP 2522388 B2 JP2522388 B2 JP 2522388B2
Authority
JP
Japan
Prior art keywords
task
running
travel
level
priority
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP1103008A
Other languages
Japanese (ja)
Other versions
JPH02281338A (en
Inventor
伸吾 高田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
Nippon Electric 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 Nippon Electric Co Ltd filed Critical Nippon Electric Co Ltd
Priority to JP1103008A priority Critical patent/JP2522388B2/en
Publication of JPH02281338A publication Critical patent/JPH02281338A/en
Application granted granted Critical
Publication of JP2522388B2 publication Critical patent/JP2522388B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】 (産業上の利用分野) 本発明はオペレーティングシステム内の各タスクへCP
Uを割り当てる制御であるタスクの制御方法に係り、特
に割り当てる優先度を動的に変更して行うタスクの制御
方法に関する。
DETAILED DESCRIPTION OF THE INVENTION (Industrial field of application) The present invention provides CP to each task in an operating system.
The present invention relates to a method of controlling a task that is a control of allocating U, and particularly to a method of controlling a task that dynamically changes the priority of allocation.

(従来の技術) 周知のように、オペレーティングシステムでは、仕事
の単位としてジョブが定義され、さらにジョブ実行の基
本構成単位としてタスクが定義される。タスクは、中央
処理装置(CPU)の使用権を与えられる基本単位であ
り、プログラムを実行する実体である。即ち、処理プロ
グラム及び多くの制御プログラムは、システム内ではタ
スクという単位を利用して実行される。
(Prior Art) As is well known, in an operating system, a job is defined as a unit of work, and a task is defined as a basic structural unit of job execution. A task is a basic unit that is given the right to use a central processing unit (CPU) and is an entity that executes a program. That is, the processing program and many control programs are executed in the system using a unit called a task.

ところで、システム内の各タスクへCPUを割り当てる
制御方式(スケジューリング方式)には、タスクに予め
与えられた優先度に従う優先度スケジューリング方式、
割当時間を区切って行うラウンドロビンスケジューリン
グ方式の他、割り当てる優先度を動的に変更する動的優
先度方式が知られている。
By the way, a control method (scheduling method) for allocating a CPU to each task in the system includes a priority scheduling method according to a priority given to the task in advance,
In addition to the round-robin scheduling method that divides the allocation time, a dynamic priority method that dynamically changes the allocation priority is known.

ここに、従来の動的優先度方式は、例えば、文献「オ
ペレーティングシステム−設計から実装へ−」(齋藤忠
夫監訳 丸善株式会社発行)の第266頁から同267頁に紹
介されている通り、各種の基準(例えば、装置の利用
度、資源共用の度合い等)に基づいてタスクの優先度を
調整する方式である。
Here, the conventional dynamic priority method is, for example, as described on pages 266 to 267 of the document “Operating system-from design to implementation-” (published by Tadao Saito and published by Maruzen Co., Ltd.). This is a method of adjusting the priority of the task based on the standard (for example, the utilization of the device, the degree of resource sharing, etc.).

(発明が解決しようとする課題) しかし、上述した従来の動的優先度方式にあっては、
装置の利用度や資源共用の度合い等を基準とするので、
タスクの走行要求待ちが多量に発生すること、及び片寄
って発生することがある。また、優先度は装置の利用度
や資源共用の度合い等をオンラインで統計分析して設定
するので、統計分析を行うための処理が複雑であるとと
もに、CPUのオーバーヘッド時間が長くなる、等種々の
問題がある。
(Problems to be Solved by the Invention) However, in the above-mentioned conventional dynamic priority method,
Since it is based on the degree of device utilization and the degree of resource sharing,
There may be a large number of waiting requests for tasks to run, or there may be deviations. In addition, since the priority is set by statistically analyzing the device utilization and the degree of resource sharing online, the processing for performing the statistical analysis is complicated, and the overhead time of the CPU becomes long. There's a problem.

本発明は、このような問題に鑑みなされたもので、そ
の目的は、タスクの優先度の動的な変更制御を簡単な処
理で効率良くなし得るタスクの制御方法を提供すること
にある。
The present invention has been made in view of such a problem, and an object thereof is to provide a task control method capable of efficiently performing dynamic change control of task priority with simple processing.

(課題を解決するための手段) 前記目的を達成するために、本発明のタスク制御方法
は次の如き構成を有する。
(Means for Solving the Problem) In order to achieve the above object, the task control method of the present invention has the following configuration.

即ち、本発明のタスク制御方法は、装置の利用度およ
び資源共用の度合いを含む判定基準に基づいてタスクに
CPUを割り当てる優先度を動的に変更する動的優先度方
式によりタスクの走行を制御するタスクの制御方法であ
って、タスクの走行における実行優先度を指定する走行
レベルに対して排他的に優先走行を指定する特権走行レ
ベルを設定し、タスク走行管理テーブルにタスクの前記
特権走行レベルを含む走行レベルごとに設けられる要求
待アドレス部に登録されている走行要求待タスクの待行
列の長さをチェックし;その長さが所定値以上である該
当要求待アドレス部に登録されている走行要求待タスク
を前記特権走行レベルに割り当てて所定値を超えるタス
クの待行列ぶんを優先して走行させる;ことを特徴とす
るものである。
That is, the task control method of the present invention allows a task to be executed based on a criterion including the degree of device utilization and the degree of resource sharing.
This is a task control method that controls the running of tasks by the dynamic priority method that dynamically changes the priority to which CPUs are assigned, and has exclusive priority over the running level that specifies the execution priority of running tasks. A privileged travel level that specifies travel is set, and the queue length of the travel request waiting task registered in the request waiting address section provided for each travel level including the privileged travel level of the task in the task travel management table is set. A check is performed; a run request waiting task registered in a corresponding request waiting address portion whose length is equal to or greater than a predetermined value is assigned to the privileged run level, and a queue of tasks exceeding the predetermined value is preferentially run; It is characterized by that.

(作 用) 次に、前記の如く構成される本発明のタスクの制御方
法の作用を説明する。
(Operation) Next, the operation of the task control method of the present invention configured as described above will be described.

本発明方法では、タスク走行管理テーブルの要求待ア
ドレス部に登録されている走行要求待タスクの待行列の
長さをチェックし、その長さが所定値以上であるか否か
によってタスクの走行順序を変更制御する。
According to the method of the present invention, the length of the queue of the running request waiting task registered in the request waiting address part of the task running management table is checked, and the running order of the tasks is checked depending on whether the length is a predetermined value or more. Change control.

その結果、タスクの走行要求待ちが多量に発生するこ
とや片寄って発生することを有効に防止しつつ、オンラ
インリアルタイムにて動的にタスクの走行順序の変更制
御をなし得る。また、制御のための処理も簡素なもので
済むので、CPUのオーバーヘッド時間も少なくて良く、
効率の良いタスク制御方法を提供できる。
As a result, it is possible to dynamically change the running order of tasks online in real time while effectively preventing a large amount of waiting requests for running tasks from occurring and the occurrence of waiting for them to deviate. Also, since the control process is simple, the CPU overhead time can be small,
It is possible to provide an efficient task control method.

(実 施 例) 以下、本発明の実施例を図面を参照して説明する。(Examples) Examples of the present invention will be described below with reference to the drawings.

第1図は本発明の一実施例に係るタスクの制御方法を
実施する際に用いるタスク走行管理テーブルの構成例及
び走行要求待行列の発生態様例を示す。
FIG. 1 shows a configuration example of a task travel management table and a travel request queue generation example used when a task control method according to an embodiment of the present invention is implemented.

周知のように、オペレーティングシステム内の各タス
クには走行レベルが付されるが、内容の異なる複数のタ
スクに同一の走行レベルが割り付けられるようになって
いる。そこで、本実施例では、タスクの走行レベルがレ
ベル1から同7までの7種あるとすれば、タスク走行管
理テーブルとしてアドレスA1から同A8までの8個のアド
レスを用意し、アドレスA2から同A8までの各アドレスを
タスクの走行レベルに順次割り当て、アドレスA1は全て
の走行レベルに優先する特権レベルとしてレベル0を割
り当てる。そして、タスク走行管理テーブルの構成とし
て、各アドレスに要求待アドレス部1の他に、要求待数
部2を設けてある。
As is well known, a running level is assigned to each task in the operating system, but the same running level is assigned to a plurality of tasks having different contents. Therefore, in the present embodiment, if there are seven types of task running levels from level 1 to level 7, then eight addresses A 1 to A 8 are prepared as the task running management table, and address A Each address from 2 to A 8 is sequentially assigned to the running level of the task, and address A 1 is assigned level 0 as a privilege level having priority over all running levels. As the configuration of the task running management table, in addition to the request waiting address section 1, each request has a request waiting number section 2.

このタスク走行管理テーブルには、第2図(a)に示
す手順で走行要求待ちのタスクが登録される。そして、
その登録された走行要求待ちタスクは、第2図(b)に
示す手順でその走行順序制御がなされる。以下、第2図
を参照して本実施例に係るタスクの制御方法を説明す
る。
Tasks waiting for a running request are registered in the task running management table in the procedure shown in FIG. And
The registered traveling request waiting task is subjected to traveling sequence control in the procedure shown in FIG. 2 (b). The task control method according to this embodiment will be described below with reference to FIG.

第2図(a)において、システム内の各タスクは、走
行要求を受けると、走行要求タスクのレベルを判定し
(ステップ21)、そのタスクの走行レベルに対応したタ
スク走行管理テーブルのアドレスの要求待アドレス部1
に、当該タスクのタスク制御テーブルのアドレスをセッ
ト、または、チェインする(ステップ22)とともに、要
求待数部2に「1」を加算する(ステップ23)。
In FIG. 2 (a), when each task in the system receives a running request, it determines the level of the running request task (step 21), and requests the address of the task running management table corresponding to the running level of the task. Wait address part 1
Then, the address of the task control table of the task is set or chained (step 22), and "1" is added to the request waiting number portion 2 (step 23).

第1図のアドレスA3におけるタスクaのタスク制御テ
ーブルa′、アドレスA6におけるタスクb〜同gのタス
ク制御テーブルb′〜同g′はこのようにして登録され
たものである。つまり、タスクaは走行レベルがレベル
2であり、現時点ではレベル2のタスクの走行要求待数
は「1」である。また、タスクb〜同gは走行レベルが
レベル5であり、このレベル5のタスクの走行要求待数
は「6」であることが示されている。
The task control table a ′ of the task a at the address A 3 and the task control tables b ′ to g ′ of the tasks b to g at the address A 6 in FIG. 1 are registered in this way. That is, the task a has a traveling level of level 2, and the number of waits for traveling request of the task of level 2 is “1” at the present moment. Further, it is shown that the running levels of tasks b to g are level 5, and the number of waiting requests for running of the task of level 5 is “6”.

次いで、ステップ24では、前記加算処理した要求待数
部2の値が規定値Q0以上か否かを判定する。例えば、規
定値Q0が値「5」に設定してあるとすれば、アドレスA6
の要求待数部2は値「6」であるから、判定結果は肯定
(YES)となり、次のステップ25へ進む。一方、アドレ
スA3の要求待数部2での判定結果は否定(NO)となり、
本受付処理を終了する。
Next, at step 24, it is judged whether or not the value of the request waiting number portion 2 which has been subjected to the addition processing is equal to or more than a specified value Q 0 . For example, if the specified value Q 0 is set to the value “5”, the address A 6
Since the request waiting number section 2 of is a value "6", the determination result is affirmative (YES), and the process proceeds to the next step 25. On the other hand, the determination result of the request waiting number unit 2 of the address A 3 is negative (NO),
This reception process ends.

最後のステップ25では、特権レベルとして定めたレベ
ル0の要求待アドレス部1にアドレスA6をセットし、本
受付処理を終了する。
In the last step 25, the address A 6 is set in the request waiting address section 1 of level 0 defined as the privilege level, and this acceptance processing ends.

次に、第2図(b)において、タスクの走行順序制御
は、通常の手順に従ってタスク走行管理テーブルの先頭
アドレスたるアドレスA1からサーチを開始する。即ち、
最初のステップ31では、レベル0に対応するアドレスA1
の要求待アドレス部1にアドレスがセットされているか
否かが判定される。判定結果が否定(NO)であればステ
ップ32へ進み、アドレスA2以降の各要求待アドレス部1
が順次サーチされることになる。
Next, in FIG. 2 (b), the task traveling order control starts the search from the address A 1 which is the head address of the task traveling management table according to a normal procedure. That is,
In the first step 31, the address A 1 corresponding to level 0
It is determined whether or not an address is set in the request waiting address section 1. If the determination result is negative (NO), the process proceeds to step 32, and each request waiting address part 1 after the address A 2
Will be sequentially searched.

前記したように、アドレスA1の要求街アドレス部1に
はアドレスがセットされているので、ステップ31の判定
結果は肯定(YES)となりステップ33へ進む。
As described above, since the address is set in the requested town address section 1 of the address A 1 , the determination result in step 31 is affirmative (YES), and the process proceeds to step 33.

ステップ33では、アドレスA6にチェイン化してセット
されている6個のタスクのうち、まず先頭のタスクbを
走行させ、そのタスクbのタスク制御テーブルb′のチ
ェインを外すとともに、要求待数部の値を「5」にし、
次のステップ34でその要求待数5が規定値Q1以下か否か
を判定する。例えば、規定値Q1が値4であるとすれば、
ステップ35の判定結果は否定(NO)となり、先のステッ
プ33へ戻り、次のタスクcを走行させ、そのタスクcの
タスク制御テーブルのチェインを外し、要求待数を−1
し、ステップ34で判定する。このように、要求待数が規
定値Q1以下となるまで、ステップ33→同34→同33のルー
プを繰り返し実行し、ステップ34の判定結果が肯定(YE
S)となると、ステップ35へ進む。
In step 33, of the 6 tasks chained to the address A 6 , the first task b is run, the task control table b ′ of the task b is unchained, and the request waiting count Set the value of to "5",
At the next step 34, it is determined whether the requested waiting number 5 is less than or equal to the specified value Q 1 . For example, if the prescribed value Q 1 is the value 4,
The determination result in step 35 is negative (NO), the process returns to the previous step 33, the next task c is run, the chain of the task control table of the task c is removed, and the number of waiting requests is -1.
Then, the determination is made in step 34. In this way, the loop of steps 33 → 34 → 33 is repeatedly executed until the request waiting number becomes equal to or less than the specified value Q 1, and the determination result of step 34 is affirmative (YE
S), go to step 35.

ステップ35では、レベル0に対応するタスク走行管理
テーブルのアドレスA1の要求待アドレス部1に前述した
ようにセットされていたアドレスA6を消去し、ステップ
32へ進む。
In step 35, the address A 6 set in the request waiting address portion 1 of the address A 1 of the task running management table corresponding to level 0 is erased,
Continue to 32.

ステップ32では、アドレスA2以降の各要求待アドレス
1を順次サーチし、最初にアドレスA3の要求待アドレス
部1にアドレスが入っていることが検出されるので、ま
ずタスクaを走行させる。次いで、アドレスA6の要求待
アドレス部1にアドレスが入っていることが検出され、
タスクe〜同gを順次走行させる。このステップ32の走
行制御は通常行われているものである。
In step 32, the request waiting addresses 1 after the address A 2 are sequentially searched, and it is detected that the address is first included in the request waiting address portion 1 of the address A 3 , so that the task a is run first. Next, it is detected that an address is contained in the request waiting address section 1 of the address A 6 ,
The tasks e to g are sequentially run. The traveling control in step 32 is normally performed.

なお、以上説明した実施例方法では、走行要求待タス
クの待行列の長さをチェックするために、タスク走行管
理テーブルに要求待数部2を設けたが、待行列の長さチ
ェックの方法はこれに限定されることなく任意の方法が
採用可能である。また、優先走行を実現するために全て
の走行レベルに優先する特権レベルとしてレベル0を設
定したが、優先走行を実現できれば良いから、本実施例
に限定されないことは勿論である。
In the embodiment method described above, the request wait number unit 2 is provided in the task running management table in order to check the length of the queue of the run request waiting task. However, the method of checking the queue length is Any method can be adopted without being limited to this. Further, level 0 is set as a privilege level that gives priority to all traveling levels in order to realize priority traveling, but it is needless to say that the present invention is not limited to this embodiment as long as priority traveling can be realized.

(発明の効果) 以上説明したように、本発明のタスクの制御方法によ
れば、タスクの走行要求待行列の長さによってタスクの
走行順序を制御するようにしたので、タスクの走行要求
待ちが多量に発生することや片寄って発生することを有
効に防止しつつ、オンラインリアルタイムにて動的にタ
スクの走行順序の変更制御をなし得る。また、制御のた
めの処理も簡素なもので済むので、CPUのオーバーヘッ
ド時間も少なくて良く、効率の良いタスク制御方法を提
供できる効果がある。
(Effects of the Invention) As described above, according to the task control method of the present invention, the running order of the tasks is controlled by the length of the running request queue of the tasks. It is possible to control the running order of tasks dynamically in real time online while effectively preventing the occurrence of a large amount or deviation. Further, since the control process is simple, the CPU overhead time is small, and an efficient task control method can be provided.

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

第1図は本発明の一実施例に係るタスクの制御方法を実
施する際に用いるタスク走行管理テーブルの構成例と走
行要求待行列の発生態様を示す図、第2図は実施例方法
の動作を説明するフローチャートである。 1……要求待アドレス部、2……要求待数部、a′〜
g′……タスクa〜同gに対応するタスク制御テーブ
ル。
FIG. 1 is a diagram showing a configuration example of a task travel management table used when implementing a task control method according to an embodiment of the present invention and a generation mode of a travel request queue, and FIG. 2 is an operation of the embodiment method. It is a flowchart explaining. 1 ... request waiting address part, 2 ... request waiting number part, a '~
g '... task control table corresponding to tasks a to g.

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】装置の利用度および資源共用の度合いを含
む判定基準に基づいてタスクにCPUを割り当てる優先度
を動的に変更する動的優先度方式によりタスクの走行を
制御するタスクの制御方法であって、タスクの走行にお
ける実行優先度を指定する走行レベルに対して排他的に
優先走行を指定する特権走行レベルを設定し、タスク走
行管理テーブルにタスクの前記特権走行レベルを含む走
行レベルごとに設けられる要求待アドレス部に登録され
ている走行要求待タスクの待行列の長さをチェックし;
その長さが所定値以上である該当要求待アドレス部に登
録されている走行要求待タスクを前記特権走行レベルに
割り当てて所定値を超えるタスクの待行列ぶんを優先し
て走行させる;ことを特徴とするタスクの制御方法。
1. A task control method for controlling the running of a task by a dynamic priority method that dynamically changes the priority of assigning a CPU to a task based on a criterion including a device utilization rate and a resource sharing degree. In addition, a privileged travel level that exclusively specifies priority travel is set for a travel level that specifies execution priority in the travel of a task, and each of the travel levels including the privileged travel level of the task in the task travel management table. Check the queue length of the running request waiting task registered in the request waiting address section provided in
A task waiting for running, which is registered in a corresponding request waiting address portion whose length is equal to or greater than a predetermined value, is assigned to the privileged running level and priority is given to running of a queue of tasks exceeding the predetermined value. And how to control the task.
JP1103008A 1989-04-21 1989-04-21 How to control tasks Expired - Fee Related JP2522388B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1103008A JP2522388B2 (en) 1989-04-21 1989-04-21 How to control tasks

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1103008A JP2522388B2 (en) 1989-04-21 1989-04-21 How to control tasks

Publications (2)

Publication Number Publication Date
JPH02281338A JPH02281338A (en) 1990-11-19
JP2522388B2 true JP2522388B2 (en) 1996-08-07

Family

ID=14342628

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1103008A Expired - Fee Related JP2522388B2 (en) 1989-04-21 1989-04-21 How to control tasks

Country Status (1)

Country Link
JP (1) JP2522388B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04264927A (en) * 1991-02-20 1992-09-21 Matsushita Electric Ind Co Ltd Scheduling device
EP0586768A1 (en) * 1992-09-11 1994-03-16 International Business Machines Corporation Efficient multi-users timer
CN108009006B (en) * 2016-11-02 2022-02-18 华为技术有限公司 Scheduling method and device of I/O (input/output) request

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63300326A (en) * 1987-05-30 1988-12-07 Nec Corp Transaction execution schedule system

Also Published As

Publication number Publication date
JPH02281338A (en) 1990-11-19

Similar Documents

Publication Publication Date Title
US7689996B2 (en) Method to distribute programs using remote Java objects
JP3887353B2 (en) Apparatus and method for integrating workload manager with system task scheduler
US5745778A (en) Apparatus and method for improved CPU affinity in a multiprocessor system
US5522070A (en) Computer resource distributing method and system for distributing a multiplicity of processes to a plurality of computers connected in a network
US7926062B2 (en) Interrupt and exception handling for multi-streaming digital processors
CA1296432C (en) Controlled dynamic load balancing for a multiprocessor system
JP2005062927A (en) Load control method and device, and processing program therefor
US6473780B1 (en) Scheduling of direct memory access
JP2522388B2 (en) How to control tasks
JPH0628323A (en) Process execution control method
JP4150853B2 (en) Resource competition control system, control method, and program
CN109656716A (en) A kind of Slurm job scheduling method and system
JP2003084989A (en) Priority dynamic control system, priority dynamic control method, and priority dynamic control program
EP0838757B1 (en) Process scheduler
Takada et al. Inter-and intra-processor synchronizations in multiprocessor real-time kernel
JPH11249917A (en) Parallel computers, their batch processing method, and storage medium
JP2004234643A (en) Process scheduling device, process scheduling method, program for process scheduling, and storage medium recorded with program for process scheduling
JPH08272739A (en) Method for improving on-line response
JPH0528120A (en) Processing system by multiprocessor
JPS62184543A (en) Job scheduling system
JP2566002B2 (en) Task dispatching method
CN113900824A (en) Cloud platform virtual resource high-speed scheduling method
JP2003337711A (en) Information processor and method
JPH06202884A (en) Multiprogram execution managment method
CN113918346A (en) Cloud platform virtual resource high-speed scheduling method

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees