JPS62271147A - Task control method - Google Patents

Task control method

Info

Publication number
JPS62271147A
JPS62271147A JP11551486A JP11551486A JPS62271147A JP S62271147 A JPS62271147 A JP S62271147A JP 11551486 A JP11551486 A JP 11551486A JP 11551486 A JP11551486 A JP 11551486A JP S62271147 A JPS62271147 A JP S62271147A
Authority
JP
Japan
Prior art keywords
tasks
task
priority
priority tasks
processing
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
JP11551486A
Other languages
Japanese (ja)
Inventor
Yoshihiro 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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP11551486A priority Critical patent/JPS62271147A/en
Publication of JPS62271147A publication Critical patent/JPS62271147A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues

Abstract

PURPOSE:To prevent the overhead of a monitor from being increased even if total number of tasks to be processed by the time division system is increased by dividing tasks into high priority tasks and lower priority tasks and regarding the lower priority tasks as one unified task thereby decreasing the overhead of a monitor for the high priority tasks. CONSTITUTION:Let A21 and B22 be the high priority tasks, C1, 23, C2,24 and C3,25 be lower priority tasks, then all the lower priority tasks are regarded as one task C26 with respect to the high priority tasks, and the priority of the C26 is processed as the 3rd rank. Thus, the tasks requiring the processing by the high priority tasks are three, A21, B22 and C26. Since the lower priority tasks are checked only when no execution standby task exists in the high priority task, the task number of the high priority tasks has only to be decreased to reduce the overhead of the monitor with respect to the high priority tasks.

Description

【発明の詳細な説明】 3、発明の詳細な説明 〔産業上の利用分野〕 この発明は複数のタスクを時分割方式でリアルタイム処
理を行う場合のタスクの制御方法に関するものである。
[Detailed Description of the Invention] 3. Detailed Description of the Invention [Field of Industrial Application] The present invention relates to a task control method when a plurality of tasks are processed in real time in a time-sharing manner.

〔従来の方法〕[Conventional method]

従来のタスク制御方法は大きく分けるとげ)固定優先度
方式、(ロ)ラウントロピン方式、(ハ)固定優先度方
式とラウントロピン方式の組合せ方式、 (二分けることができる。
Conventional task control methods can be broadly divided into two types: (1) Fixed priority method, (2) Round-tropin method, (3) Combination method of fixed-priority method and Round-tropin method.

固定優先度方式では処理すべき複数のタスクの全タスク
に対し、その処理の重要性(=従って優先度の1@1位
を定め、タスクの起動はその優先度の須位に従って行な
う。
In the fixed priority method, the importance of processing (=therefore, priority 1@1) is determined for all tasks among a plurality of tasks to be processed, and tasks are activated according to their priority.

ラウントロピン方式ではタスクの優先度は固定されてお
らず、起動要求があった順にタスクの起動を行なう。
In the round-tropin method, the priority of tasks is not fixed, and tasks are activated in the order in which activation requests are received.

固定優先度方式とラウントロピン方式の組合せ方式が最
も広く用いられているので以下この方式について説明す
る。
Since the combination of the fixed priority method and the round-tropin method is most widely used, this method will be described below.

第3図は従来の方法における複数のタスクとこれらタス
クの制御を行うモニタの関係を示すブロック図で、図に
おいてA1−A4 、 Bl〜B4. C1〜C4、D
i〜D4  は各タスク群を表し、タスク群ごとに優先
度の順位が定められており、Al−A4のタスク群が順
位第1位、B1−84のタスク群が順位第2位、C1−
C4のタスク群が順位第3位、D1〜D4 のタスク群
が順位第4位であり、かつ同一タスク群中の各タスクの
優先順位は同一であるとする。(20)はこれらタスク
の制御を行うモニタである。
FIG. 3 is a block diagram showing the relationship between a plurality of tasks and monitors that control these tasks in a conventional method. C1-C4, D
i to D4 represent each task group, and a priority order is determined for each task group, with the Al-A4 task group in first place, the B1-84 task group in second place, and C1-
It is assumed that the task group C4 is ranked third, the task groups D1 to D4 are ranked fourth, and the priorities of the tasks in the same task group are the same. (20) is a monitor that controls these tasks.

何らかのイベントにより、制御がモニタ(20)内のデ
ィスパッチャ(タスクを選択して起動させるプログラム
)に移るとディスパッチャは優先度順位に従って各タス
ク群中に実行中断中のタスク又は起動待ちをしているタ
スクがあるか否かを調べる。実行中断中のタスクを検出
したときはそのタスクに制御を戻し、そのタスク群の中
に実行中断中のタスクは無いが、起動待ちのタスクがあ
った場合には、その起動待ちのタスクのうち最も早く(
=起動要求のあったタスクを起動する。
When some event causes control to be transferred to the dispatcher (a program that selects and starts tasks) in the monitor (20), the dispatcher selects tasks that are suspended in execution or tasks that are waiting to be started in each task group according to the priority order. Find out if there is. When a task whose execution is suspended is detected, control is returned to that task, and if there is no task whose execution is suspended in the task group, but there is a task waiting to be started, one of the tasks waiting to be started is returned. The earliest (
=Start the task that was requested to be started.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

従来の方法は以上のように行われるので、タスク群の数
及び同一タスク群内のタスクの数が多い場合はモニタ(
20)が次(=制御を移すべきタスクを決定する為に必
要な処理の量が多くなり、したがってモニタ(20)の
オーバヘッドが大きくなりすぎて、プログラムのスルー
プットが低下するために、迅速な処理が必要なタスクに
対しリアルタイム処理ができなくなるという問題点があ
った。
The conventional method is performed as described above, so if the number of task groups and the number of tasks in the same task group is large, monitor (
20) becomes the next task (= the amount of processing required to determine the task to which control should be transferred increases, and therefore the overhead of the monitor (20) becomes too large, reducing the throughput of the program. There was a problem in that real-time processing was not possible for tasks that required

この発明は上記のような問題点を解決するためになされ
たもので、時分割方式で処理すべきタスクの総数が多く
なっても、モニタのオーバヘッドが大きくならないタス
ク制御方法を得ることを目的とする。
This invention was made to solve the above-mentioned problems, and its purpose is to provide a task control method that does not increase monitor overhead even if the total number of tasks to be processed in a time-sharing manner increases. do.

〔問題点を解決するための手段〕[Means for solving problems]

この発明では優先度の順位が第1位から第m位までの上
位優先タスクと、第(rn+1)位取下の下位優先タス
クとに分け、下位優先タスクは総てのタスクを合せたも
のを一つのタスクと見做すことC:よって、上位優先タ
スクから見た見掛は上のタスクの総数を減少して、上位
優先タスクにとってのモニタのオーバヘッドを減少した
In this invention, the priority tasks are divided into high-priority tasks from 1st to mth priority, and lower-priority tasks with the (rn+1)th priority, and the lower-priority tasks are the sum of all tasks. Regarding it as one task C: Therefore, the total number of tasks above from the perspective of the higher priority task has been reduced, and the monitoring overhead for the higher priority task has been reduced.

〔作用〕[Effect]

この発明では上位優先タスク中に実行待ちのタスクが存
在しない場合だけ下位優先タスクを調べるので、上位優
先タスクのタスク数を小さくしておけば、上位優先タス
クに対するモニタのオーバヘッドを小さくすることがで
きる。
In this invention, lower priority tasks are checked only when there are no tasks waiting to be executed among the higher priority tasks, so if the number of higher priority tasks is kept small, the overhead of monitoring the higher priority tasks can be reduced. .

〔実施例〕〔Example〕

以下この発明の実施例を図面について説明する。 Embodiments of the present invention will be described below with reference to the drawings.

第1図はこの発明の一実施例を示すフローチャート図で
、図において(1)〜(11)は各ステップである。第
2図はこの発明における優先度の順位を示すブロック図
で、8g2図において(20)はモニタ、(21)は優
先度の順位第1位のタスクA、(22)は優先度の順位
第2位のタスクB、(23)は優先度の順位第3位のタ
スクCI、(24)は優先度の順位第4位のタスクC2
、(25)は優先度の順位第5位のタスクC3を表す。
FIG. 1 is a flowchart showing an embodiment of the present invention, and in the figure (1) to (11) are each step. FIG. 2 is a block diagram showing the priority order in this invention. In the 8g2 diagram, (20) is the monitor, (21) is the task A with the first priority, and (22) is the task A with the first priority. Task B is in second place, (23) is task CI in third place in priority order, and task C2 is in fourth place in priority order (24).
, (25) represents task C3, which is ranked fifth in priority.

 (26)ハc1(23) 、 C2(24)。(26) c1 (23), C2 (24).

C3(25)を1個のタスクと見做したタスクCである
This is task C, which considers C3 (25) as one task.

この発明ではA(21)、B(22)を上位優先タスク
とし、CI (23) 、 C2(24) 、 C3(
25)  を下位優先タスクとし、すべての下位優先タ
スクCI C23) 、C2(24) 、C3(25)
は上位優先タスク(二対しては1個のタスクC(26)
と見做しタスクC(26)の優先度の順位は第3位とし
て処理する。
In this invention, A(21) and B(22) are set as high priority tasks, and CI(23), C2(24), C3(
25) as a lower priority task, and all lower priority tasks CI C23) , C2(24) , C3(25)
is the higher priority task (one task C for two (26)
Therefore, task C (26) is processed as having the third priority.

従って上位優先タスクから見れば処理を必要とするタス
クはA (21) 、 B (22) 、 C(、26
)の3個となる。
Therefore, from the perspective of higher priority tasks, the tasks that require processing are A (21), B (22), C (, 26
).

次に第1図について説明する。タスクの起動は何らかの
イベントにより行なわれるが、イベントがタスクの起動
を要求する際に上位優先タスクと下位優先タスクとは区
分して要求するようにする。
Next, FIG. 1 will be explained. Activation of a task is performed by some event, but when an event requests activation of a task, the request is made separately for a higher priority task and a lower priority task.

ステップ+11 、 +21でタスクA(21)、B(
22)の実行待ちであるか否かを調べ、いずれにも実行
待ちがない場合はステップ(3)にうつり、この場合下
位優先タスクの起動要求があればその起動要求::対す
る処理が行われる。
At steps +11 and +21, tasks A(21) and B(
22) is waiting for execution, and if none is waiting for execution, the process moves to step (3). In this case, if there is a start request for a lower priority task, the process for that start request:: is performed. .

ステップ(1)の判定がYであれば、ステップ(4)に
うつり実行中タスクを調べるが、それがAであればタス
ク起動は既に終っていることを意味する。
If the determination in step (1) is Y, the process moves to step (4) to check the task being executed, but if it is A, it means that the task activation has already been completed.

実行中のタスクがB (22)又はC(26)であれば
、ステップ(5)又は(6)によって実行中のタスクが
使っていたレジスタの内容を退避させ、次(:これらの
タスクを再開するときに利用できるようにした上で、ス
テップ(7)にうつりタスク人を起動する。
If the task being executed is B (22) or C (26), the contents of the registers used by the task being executed are saved in step (5) or (6), and the next (: these tasks are restarted. After making it available for use when doing so, proceed to step (7) to start the transfer task person.

ステップ(1)の判定がNでステップ(2)の判定がY
のときはステップ(8)にうつり、実行中タスクを調べ
、これがAであればタスクA (21)の方がタスクB
 (22)より優先順位が上位であるため、ステップ(
9)にうつりタスクBが待機となる。ステップ(8)で
実行中タスクがBであればタスク起動は終っていること
を意味する。実行中のタスクがCであれば、ステップ(
10)、(11)が行なわれる。また、ステップ(3)
の処理では従来の技術において説明したイ)、(ロ)、
i/場のどの方式を用いてもよい。
The judgment in step (1) is N and the judgment in step (2) is Y.
If , go to step (8), check the running task, and if this is A, task A (21) is better than task B.
Since the priority is higher than (22), step (
9) Task B is placed on standby. If the executing task is B in step (8), it means that the task activation has been completed. If the task being executed is C, step (
10) and (11) are performed. Also, step (3)
In the processing of (a), (b), and (b) explained in the conventional technology,
Any method of i/field may be used.

以上のような処理によると、下位優先タスクC1(23
) 、C2(24) 、C3(25)は2重にチェック
動作が入るため、その処理かや\遅れるが、上位優先タ
スクから見るとタスクの総数が減少したこと(=なり、
モニタのオーバヘッドは小さくなる。
According to the above processing, the lower priority task C1 (23
), C2 (24), and C3 (25) are double-checked, so their processing is slightly delayed, but from the perspective of the higher priority tasks, the total number of tasks has decreased (=,
Monitor overhead is small.

なお上記実施例では上位優先タスク数2、下位優先タス
ク数3としたが、この発明では上位優先タスク数を比較
的小数に制限するだけでよく、その他にはこれらタスク
数には限定されない。一般的には優先度の順位第1位乃
至第m位のタスクを上位優先タスクとし、第(m+1)
位取下のすべてのタスクを下位優先タスクとする。
In the above embodiment, the number of high priority tasks is 2 and the number of low priority tasks is 3, but in the present invention, it is only necessary to limit the number of high priority tasks to a relatively small number, and there is no other limitation to these numbers of tasks. In general, tasks with priority rankings 1 to m are considered high priority tasks, and the (m+1)
All tasks that have been demoted are made lower priority tasks.

〔発明の効果〕〔Effect of the invention〕

以上のよう(:この発明(:よれば、迅速(=処理する
必要のある上位優先タスクの選択を高速化したので、上
位優先タスクに対するモニタのオーバヘッドを小さくす
ることができる。
As described above, according to this invention (:), the selection of higher priority tasks that need to be processed is made faster, so the overhead of monitoring the higher priority tasks can be reduced.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図はこの発明の一実施例を示すフローチャート、第
2図はこの発明における優先度の順位を示すブロック図
、 第3図は従来の方法における複数のタスクとこれらタス
クの制御を行うモニタの関係を示すブロック図。 (20)モニタ、(21)は優先度順位第1のタスクA
、(22)は優先度順位第2のタスクB、(26)は下
位優先タスクc0 尚、各図中同一符号は同−又は相当部分を示す。
FIG. 1 is a flowchart showing an embodiment of the present invention, FIG. 2 is a block diagram showing priority order in this invention, and FIG. 3 is a diagram showing a plurality of tasks and a monitor for controlling these tasks in a conventional method. Block diagram showing relationships. (20) Monitor, (21) is task A with the first priority
, (22) is the second priority task B, and (26) is the lower priority task c0. In each figure, the same reference numerals indicate the same or corresponding parts.

Claims (1)

【特許請求の範囲】 複数のタスクを時分割方式でリアルタイム処理を行う場
合のタスク制御方法において、 上記複数のタスクの各タスクに対し処理優先順位を定め
、この処理優先順位の第1位から第m位(mは任意の正
の整数で、比較的小さな値に選ぶ)までのタスクを上位
優先タスクとし、処理優先順位第(m+1)位以下のす
べてのタスクを下位優先タスクとする段階、 すべての下位優先タスクを処理優先順位が第(m+1)
位の一つのタスクと見なし、この一つのタスクとすべて
の上位優先タスクとによって構成したタスク群中で処理
優先順位に従ってタスク制御を行う段階、 上位優先タスク中に実行中のタスクも実行待ちのタスク
も存在しない状態において、すべての下位優先タスク中
で処理優先順位に従ってタスク制御を行う段階、 を備えたことを特徴とするタスク制御方法。
[Claims] In a task control method for performing real-time processing of a plurality of tasks in a time-sharing manner, a processing priority is determined for each task of the plurality of tasks, and a processing priority is determined from the first to the first in the processing priority. A step in which tasks up to the mth rank (m is an arbitrary positive integer and is selected to be a relatively small value) are set as high priority tasks, and all tasks below the (m+1)th rank of processing priority are set as low priority tasks. The processing priority of the lower priority task is (m+1)
A stage in which tasks are controlled according to the processing priority within a task group composed of this one task and all higher priority tasks, and tasks currently being executed among the higher priority tasks are also tasks waiting to be executed. A task control method characterized by comprising the step of performing task control according to processing priority among all lower priority tasks in a state where no lower priority tasks exist.
JP11551486A 1986-05-20 1986-05-20 Task control method Pending JPS62271147A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11551486A JPS62271147A (en) 1986-05-20 1986-05-20 Task control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11551486A JPS62271147A (en) 1986-05-20 1986-05-20 Task control method

Publications (1)

Publication Number Publication Date
JPS62271147A true JPS62271147A (en) 1987-11-25

Family

ID=14664404

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11551486A Pending JPS62271147A (en) 1986-05-20 1986-05-20 Task control method

Country Status (1)

Country Link
JP (1) JPS62271147A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01154236A (en) * 1987-12-10 1989-06-16 Matsushita Electric Ind Co Ltd Executing device for time-division task
JPH0944160A (en) * 1995-05-19 1997-02-14 Yamaha Corp Musical tone generating method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01154236A (en) * 1987-12-10 1989-06-16 Matsushita Electric Ind Co Ltd Executing device for time-division task
JPH0944160A (en) * 1995-05-19 1997-02-14 Yamaha Corp Musical tone generating method

Similar Documents

Publication Publication Date Title
US7441240B2 (en) Process scheduling apparatus, process scheduling method, program for process scheduling, and storage medium recording a program for process scheduling
US4855899A (en) Multiple I/O bus virtual broadcast of programmed I/O instructions
JPS62271147A (en) Task control method
JPH05108380A (en) Data processing system
US8694999B2 (en) Cooperative scheduling of multiple partitions in a single time window
JPS63300326A (en) Transaction execution schedule system
JPH01258135A (en) Transaction execution control system
JPH05204667A (en) Task execution control device in computer system
JPH0512173A (en) Information processor
JPS6125249A (en) Exclusive control system
JPS62165244A (en) Task dispatch system
JPH0769845B2 (en) Job multiplicity management method for multi-host system
JPS6265137A (en) Control system for priority of user task
JPS59111563A (en) Controlling system of multi-processor
JPS6010381A (en) System for deciding input and output interruption reception processor in multi-processor system
JPS63124138A (en) Occupation conflict control method for shared resources
JPH04245547A (en) Processing abnormality detection system for processor
JPH08329022A (en) Input/output process load decentralization control system for multiprocessor system
JPH01217636A (en) Task control system
JPH03257634A (en) Method and device for parallelly processing program
JPH02187841A (en) Memory buffer managing system
JPH08212085A (en) Information processor and communication processor
JPS6027950A (en) Preferential dispatch control system
JPS60147845A (en) System for controlling load of circulating pipeline type data flow computer
JPH0782444B2 (en) Task schedule method