JPH1063515A - Scheduling method for multitask control - Google Patents

Scheduling method for multitask control

Info

Publication number
JPH1063515A
JPH1063515A JP24266796A JP24266796A JPH1063515A JP H1063515 A JPH1063515 A JP H1063515A JP 24266796 A JP24266796 A JP 24266796A JP 24266796 A JP24266796 A JP 24266796A JP H1063515 A JPH1063515 A JP H1063515A
Authority
JP
Japan
Prior art keywords
task
tasks
cpu resources
priority
cpu
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
JP24266796A
Other languages
Japanese (ja)
Inventor
Hiroe Iwasaki
裕江 岩崎
Jiro Naganuma
次郎 長沼
Makoto Endo
真 遠藤
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.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone 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 Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP24266796A priority Critical patent/JPH1063515A/en
Publication of JPH1063515A publication Critical patent/JPH1063515A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To suppress the process overhead of task switching by allocating CPU resources to only a task which waits for the CPU resources by a timer interruption processing program. SOLUTION: A scheduler SCH1 for multitask control controls a task TE in execution and tasks Tw1 -Twn which are waiting for CPU resources. Here, a means M is used which generates preemption for only the tasks waiting for the CPU resources by the timer interruption processing program. Interruption is initiated at constant intervals to allocate the CPU resources to only the tasks waiting for the CPU resources by the timer interruption processing program. Further, no interruption is accepted while the task with top priority is being executed. Furthermore, the total of the execution times of tasks having top priority in the respective timer interruption intervals is limited to shorter than the timer interruption intervals.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、タスク(所定の一
連のプログラムの1つのまとまり)の優先度が高い順に
CPU資源を割り当てるタスク選択手段と、実行中のタ
スクよりも優先度の高いタスクがCPU資源待ちになっ
たときに、実行中のタスクを中断し、優先度の高いタス
クにCPU資源を割り当てるプリエンプション手段とを
持つマルチタスク制御のスケジューリング方法に関する
ものである。
[0001] The present invention relates to a task selecting means for allocating CPU resources in the order of higher priority of a task (one set of a predetermined series of programs), and a task having a higher priority than a task being executed. The present invention relates to a scheduling method of multitask control having a preemption means for interrupting a task being executed when waiting for CPU resources and allocating CPU resources to tasks with a high priority.

【0002】[0002]

【従来の技術】従来のマルチタスク制御のスケジューリ
ング方法においては、各タスクに優先度を予め付与し、
CPU資源を次に与えるタスクを選択するときに、CP
U資源待ちをしているタスクの中で優先度が最も高いタ
スクにCPU資源を与えるプリエンプション方法が採用
されている。
2. Description of the Related Art In a conventional scheduling method of multitask control, priorities are given to respective tasks in advance,
When selecting the next task to give CPU resources,
A preemption method of giving CPU resources to a task having the highest priority among tasks waiting for U resources is adopted.

【0003】したがって、上記従来例においては、優先
度の高いタスクがCPU資源待ちになっているときには
必ずプリエンプションが発生し、このようにプリエンプ
ションが常時発生可能にすると、プリエンプションが頻
繁に発生し、タスク切り替え回数が多くなり、処理オー
バーヘッドが発生する(余分な処理が発生する)。
Therefore, in the above-mentioned conventional example, preemption always occurs when a task with a high priority is waiting for CPU resources. If preemption can always be performed, preemption occurs frequently and task The number of times of switching increases, and processing overhead occurs (excessive processing occurs).

【0004】また、タスクの優先度が高い順にCPU資
源を割り当てるタスク選択方法とプリエンプション方法
とを持った従来のマルチタスク制御のスケジューリング
方法においては、中断されたタスクを再開するときに矛
盾なく再開できるようにする必要があり、このために
は、プリエンプションが発生したときに、中断するタス
クの動作状態を示すスタックポインタ等の各種ステータ
スレジスタをセーブしておく必要がある。
In a conventional multitask control scheduling method having a task selection method and a preemption method for allocating CPU resources in descending order of task priority, an interrupted task can be resumed without inconsistency. For this purpose, it is necessary to save various status registers such as a stack pointer indicating the operation state of the task to be interrupted when preemption occurs.

【0005】図5は、従来のマルチタスク制御の説明図
である。
FIG. 5 is an explanatory diagram of conventional multitask control.

【0006】図5において、優先度の高低を示す矢印の
先端部分(図5の上方)に近い程、高い優先度を示し、
矢印の先端部分と反対の部分(図5の下方)に近い程、
低い優先度を示す。CPU資源待ちキューQW は、優先
度毎に構成されている。優先度が最も高いタスクT1、
優先度が2番目に高いタスクT2、優先度が最も低いタ
スクTnの順である。図5において、実行中タスクTE
のキューQE と、中断中タスクTS のキューQS とが示
されている。
In FIG. 5, the closer to the tip (upper part in FIG. 5) of the arrow indicating the priority, the higher the priority.
The closer to the part opposite the tip of the arrow (the lower part in FIG. 5),
Indicates low priority. CPU resource wait queue Q W is constructed for each priority. Task T1, which has the highest priority,
The task T2 has the second highest priority, and the task Tn has the lowest priority. In FIG. 5, the running task T E
And queue Q E of are shown and queue Q S of the interruption task T S is.

【0007】ハードウェアからの割り込みによって、割
り込み処理プログラムの中で、現在実行中のタスクより
も優先度の高いタスクを、CPU資源待ち状態にするこ
とがあるので、自ら中断するようなシステムコールを発
行しなくても、中断中タスクTS は同時に複数個存在す
る。したがって、各種ステータスレジスタのセーブエリ
アSAを、全てのタスクについて設ける必要がある。な
お、上記制御を、マルチタスク制御のスケジューラーS
CH3が実行している。
[0007] An interrupt from the hardware may cause a task having a higher priority than the currently executing task in the interrupt processing program to wait for CPU resources. Even if it is not issued, there are a plurality of suspended tasks T S at the same time. Therefore, it is necessary to provide save areas SA for various status registers for all tasks. Note that the above control is performed by a scheduler S of multitask control.
CH3 is running.

【0008】図6は、従来のマルチタスク制御のスケジ
ューリングにおける処理シーケンスの一例を示すフロー
チャートである。
FIG. 6 is a flowchart showing an example of a processing sequence in the conventional scheduling of multitask control.

【0009】優先度2が付与されているタスクT2にC
PU資源が割り当てられているときに、タイマ割り込み
が発生し、タイマ割り込み処理プログラムに制御が移行
され、そこでタスクT2の優先度2よりも優先度が高い
タスクT11 〜T1n をCPU資源待ちにする(S1
1)。この場合、タスクT11 〜T1n の優先度がタス
クT2の優先度よりも高いか否か(プリエンプション発
生か否か)をスケジューラーSCH3が判定する(S1
2)。タスクT2よりも優先度が低いタスクであると判
定された場合には、タスクT2の実行を再開する(S1
3)。
The task T2 to which priority 2 has been assigned
When the PU resources are allocated, the timer interrupt occurs, control the timer interrupt processing program is migrated, where the task T1 1 to T1 n higher priority than the priority 2 of the task T2 to the CPU resource wait Yes (S1
1). In this case, the scheduler SCH3 determines whether the priority of the tasks T1 1 to T1 n is higher than the priority of the task T2 (whether or not preemption has occurred) (S1).
2). If it is determined that the task has a lower priority than the task T2, the execution of the task T2 is resumed (S1).
3).

【0010】ここで、タスクT11 〜T1n は、優先度
1を持ち、優先度1は優先度2よりも優先度が高いの
で、タスクT2についての各種ステータスレジスタをセ
ーブし(S21)、CPU資源待ちをしているタスクの
中で最も優先度が高いタスクにCPU資源を与え(S2
2)、タスクT11 の各種ステータスレジスタをロード
し(S23)、タスクT11 にCPU資源を与える。タ
スクT11 以外に優先度1を持ったタスクT12 〜T1
n も、CPU資源待ちをしているタスクの中で最も優先
度が高いので、CPU資源が与えられ、各タスクについ
ての各種ステータスレジスタをロードし、最後にタスク
T1n にCPU資源が与えられ(S24)、タスクT1
n についての各種ステータスレジスタをロードする(S
25)。
Here, the tasks T1 1 to T1 n have a priority 1 and the priority 1 has a higher priority than the priority 2, so that various status registers for the task T2 are saved (S21). CPU resources are given to the task with the highest priority among the tasks waiting for resources (S2
2), to load the various status registers of the task T1 1 (S23), it gives the CPU resource to the task T1 1. In addition to the task T1 1 task with priority 1 T1 2 ~T1
Since n also has the highest priority among the tasks waiting for CPU resources, CPU resources are given, various status registers for each task are loaded, and finally, CPU resources are given to task T1 n ( S24), task T1
Load various status registers for n (S
25).

【0011】このようにして優先度1のタスクT11
T1n の処理が全て終わった後、スケジューラーSCH
3によって、現在CPU資源待ちしているタスクの中で
最も優先度が高いタスクにCPU資源を与え(S2
6)、タスクT2の各種ステータスレジスタをロードし
(S27)、タスクT2にCPU資源を与え、タスクT
2を実行する。
[0011] In this way, the tasks T11 1 to
After all the processes of T1 n are completed, the scheduler SCH
3, the CPU resource is given to the task having the highest priority among the tasks waiting for the CPU resource (S2).
6) Load various status registers of the task T2 (S27), give CPU resources to the task T2,
Execute Step 2.

【0012】[0012]

【発明が解決しようとする課題】上記従来例において、
タスクは自らを中断するようなシステムコールを発行し
なくても、ハードウェアからの割り込みによって、割り
込み処理プログラムの中で、現在実行中のタスクよりも
優先度の高いタスクを、CPU資源待ち状態にすること
がある。したがって、全てのタスクについて、各種ステ
ータスレジスタをセーブするセーブエリアが必要であ
り、このために、各種ステータスレジスタのサイズ×タ
スク数分のメモリ量が必要であり、多くのメモリ量を消
費するという問題がある。
In the above conventional example,
Even if a task does not issue a system call that interrupts itself, an interrupt from hardware causes a task with a higher priority than the currently executing task to wait for CPU resources in the interrupt processing program. May be. Therefore, a save area for saving various status registers is required for all tasks. For this reason, a memory amount equal to the size of various status registers times the number of tasks is required, and a large amount of memory is consumed. There is.

【0013】本発明は、プリエンプションで発生するタ
スク切り替えの処理オーバヘッドと、中断されるタスク
の各種ステータスレジスタをセーブするメモリとを削減
しつつ、タスクの優先度の高い順にCPU資源を割り当
てるタスク選択手段とプリエンプション手段とを持った
マルチタスク制御のスケジューリング方法を提供するこ
とを目的とするものである。
According to the present invention, there is provided a task selecting means for allocating CPU resources in descending order of task priority while reducing the processing overhead of task switching occurring in preemption and the memory for saving various status registers of a task to be interrupted. It is an object of the present invention to provide a scheduling method for multitask control having a pre-emption means and a pre-emption means.

【0014】[0014]

【課題を解決するための手段】本発明は、マルチタスク
制御のスケジューリング方法において、一定周期間隔で
割込するタイマ割込を発生させ、タイマ割込処理プログ
ラムによってCPU資源待ちになったタスクにのみ、C
PU資源を割り当てるものである。
According to the present invention, in a scheduling method for multitask control, a timer interrupt interrupting at a fixed period is generated, and only a task which has been waiting for CPU resources by a timer interrupt processing program is executed. , C
PU resources are allocated.

【0015】また、本発明は、優先度が最も高いタスク
にのみ、プリエンプションの権利を与える手段と、優先
度が最も高いタスクの実行中は、割り込みを受け付けな
い手段と、各タイマ割り込み間隔内における優先度が最
も高いタスクの実行時間の総和を、タイマ割り込み間隔
よりも短くするように制限する手段と、タスクの自主中
断を禁止する手段とを加えたものである。
Further, the present invention provides a means for granting a preemption right only to a task with the highest priority, a means for not accepting an interrupt while the task with the highest priority is being executed, A means for limiting the sum of the execution times of the tasks having the highest priority to be shorter than the timer interrupt interval and a means for prohibiting voluntary interruption of the task are added.

【0016】[0016]

【発明の実施の形態および実施例】図1は、本発明の第
1の実施例であるマルチタスク制御のスケジューリング
方法を示す図である。
DESCRIPTION OF THE PREFERRED EMBODIMENTS FIG. 1 is a diagram showing a scheduling method for multitask control according to a first embodiment of the present invention.

【0017】図1中、マルチタスク制御のスケジューラ
ーSCH1は、実行中タスクTE と、CPU資源待ちタ
スクTW1〜TWnとを制御する。
[0017] In FIG. 1, the scheduler SCH1 multitask control, and executing tasks T E, controls the CPU resource wait task T W1 through T Wn.

【0018】このマルチタスク制御のスケジューリング
方法に、タイマ割り込み手段(第1の手段)ME1と、
タイマ割り込み処理プログラムによってCPU資源待ち
になったタスクにのみ、プリエンプションを発生させる
第2の手段ME2とを用いる。このようにすることによ
って、プリエンプションを発生する頻度を抑制でき、し
たがって、プリエンプション発生頻度が減少し、タスク
切り替えの処理オーバヘッドを削減することができる。
The scheduling method of the multitask control includes a timer interrupt means (first means) ME1,
The second means ME2 for generating the preemption is used only for the task which has been waiting for the CPU resource by the timer interrupt processing program. By doing so, the frequency of occurrence of preemption can be suppressed, so that the frequency of occurrence of preemption can be reduced and the processing overhead of task switching can be reduced.

【0019】図2は、本発明の第2の実施例であるマル
チタスク制御のスケジューリング方法を示す図である。
FIG. 2 is a diagram showing a scheduling method for multitask control according to a second embodiment of the present invention.

【0020】図2において、優先度の高低を示す矢印の
先端部分(図2の上方)に近い程、高い優先度を示し、
矢印の先端部分と反対の部分(図2の下方)に近い程、
低い優先度を示す。CPU資源待ちキューQW は、優先
度毎に構成されている。優先度が最も高いタスクT1、
優先度が2番目に高いタスクT2、優先度が最も低いタ
スクTnの順である。
In FIG. 2, the closer to the tip (upper part in FIG. 2) the arrow indicating the priority, the higher the priority.
The closer to the part opposite the tip of the arrow (the lower part in FIG. 2),
Indicates low priority. CPU resource wait queue Q W is constructed for each priority. Task T1, which has the highest priority,
The task T2 has the second highest priority, and the task Tn has the lowest priority.

【0021】図2に示す実施例では、優先度が最も高い
タスクにのみプリエンプションの権利を与える手段を用
いることによって、プリエンプションの権利を持つタス
クを、タスクT1に限定する。
In the embodiment shown in FIG. 2, the task having the preemption right is limited to the task T1 by using the means for giving the preemption right only to the task having the highest priority.

【0022】また、優先度が最も高いタスクの実行中
は、割り込みを受け付けない第4の手段ME4と、タイ
マ割り込みの第1の手段ME1とを用いて、各タイマ割
り込み間隔内における優先度が最も高いタスクの実行時
間の総和を、タイマ割り込み間隔よりも短くする(具体
的には、アプリケーションがプログラムを作成するとき
に、上記条件を満たすようにプログラムを作成する)第
5の手段ME5とを、実行中タスクTE に与えることに
よって、優先度が最も高いタスクを実行しているときに
は、割り込みを受け付けず、しかも、タイマ割り込み間
隔を一定に保つことができる。
During the execution of the task having the highest priority, the fourth means ME4 which does not accept an interrupt and the first means ME1 for timer interrupts are used to give the highest priority within each timer interrupt interval. Fifth means ME5 for making the sum of the execution times of the high tasks shorter than the timer interrupt interval (specifically, when the application creates the program, creates the program so as to satisfy the above conditions) by giving the running task T E, when the priority is performing the highest task does not accept the interrupt, moreover, it is possible to keep the timer interrupt interval constant.

【0023】自主中断しないという第6の手段ME6を
与えることによって、実行されているタスクは、割り込
み以外によってはタスクが中断されない。QS は、中断
されているタスクのキュー、TS は、中断されているタ
スク、SAは、中断されているタスクの各種ステータス
レジスタのセーブエリアを示す。
By providing the sixth means ME6 for not interrupting the task independently, the task being executed is not interrupted except by interruption. Q S indicates a queue of suspended tasks, T S indicates a suspended task, and SA indicates a save area of various status registers of the suspended task.

【0024】タイマ割り込み処理プログラムでCPU資
源待ちになったタスクにのみ、CPU資源を割り当てる
(割り込みによって中断されているタスクに対するプリ
エンプションを発生させる)第2の手段ME2を用いる
ことによって、プリエンプションの発生を、タイマ割り
込み後に限定することと、各タイマ割り込み間隔内に、
優先度が最も高いタスクを実行する時間の総和を、タイ
マ割り込み間隔よりも短くする第5の手段ME5とによ
って、中断されるタスクを1つに限定することができ
る。
The use of the second means ME2 for allocating CPU resources only to tasks that have been waiting for CPU resources in the timer interrupt processing program (to generate preemption for tasks interrupted by an interrupt) makes it possible to prevent the occurrence of preemption. , After the timer interrupt, and within each timer interrupt interval,
The fifth means ME5 for making the total time for executing the task having the highest priority shorter than the timer interrupt interval can limit the interrupted task to one.

【0025】なお、第3の手段ME3は、上記タイマ割
込によってCPU資源待ちになっている複数のタスクの
うちで、優先度が最も高いタスクにのみ、上記CPU資
源を割り当てる手段である。
The third means ME3 is means for allocating the CPU resource only to the task having the highest priority among the plurality of tasks waiting for the CPU resource due to the timer interruption.

【0026】上記第2の実施例によれば、中断されてい
るタスクの各種ステータスレジスタにおける状態をセー
ブするメモリエリアを削減することができる。
According to the second embodiment, it is possible to reduce the memory area for saving the status of the interrupted task in the various status registers.

【0027】図3は、上記第2の実施例における処理シ
ーケンスの一例を示すフローチャートである。
FIG. 3 is a flowchart showing an example of the processing sequence in the second embodiment.

【0028】優先度2が付与されているタスクT2にC
PU資源が割り当てられている途中で、タイマ割り込み
が発生し、タイマ割り込み処理プログラムに制御が移行
され、この制御において、タスクT2の優先度2よりも
優先度の高いタスクT11 〜T1n をCPU資源待ちに
し(S1)、このCPU資源待ちのタスクの優先度が最
も高い優先度であるか否かを、最も高い優先度のタスク
にのみプリエンプションの権利を与える第2の手段ME
2が判定する(S2)。タスクT2よりも優先度の低い
タスクであると判定された場合には、タスクT2の実行
を再開する(S5)。
The task T2 to which priority 2 has been assigned
In the middle of PU resources are allocated, the timer interrupt occurs, control the timer interrupt processing program is migrated, in this control, the task T1 1 to T1 n higher priority than the priority 2 of the task T2 CPU The task waits for resources (S1), and determines whether or not the priority of the task waiting for the CPU resource is the highest priority. The second means ME that gives the right of preemption only to the task with the highest priority.
2 is determined (S2). If it is determined that the task has a lower priority than the task T2, the execution of the task T2 is restarted (S5).

【0029】CPU資源待ちをしているタスクの中で優
先度が最も高いタスクにCPU資源を与える処理を行い
(S3、S4)、つまり、CPU資源待ちになったタス
クT11 〜T1n は、最も高い優先度1を持つので、タ
スクT11 〜T1n にCPU資源を与える。
[0029] performs the processing priority of the task that the CPU resource wait gives CPU resources to the highest task (S3, S4), that is, the task T1 1 to T1 n became CPU resource waiting, because it has the highest priority 1, giving the CPU resource to the task T1 1 to T1 n.

【0030】優先度1であるタスクT1の処理が全て終
わった後、スケジューラーSCH2によって、タスクT
2の処理を再開する(S5)。このようにすれば、複数
のタスクのそれぞれについて、各種ステータスレジスタ
をセーブする必要がなくなるので、メモリエリアを削減
しつつ、タスクの優先度の高い順にCPU資源を割り当
てるタスク選択手段とプリエンプション手段とを持った
マルチタスク制御のスケジューリングを実現することが
できる。
After all the processes of the task T1 having the priority 1 are completed, the task T1 is executed by the scheduler SCH2.
The process 2 is restarted (S5). This eliminates the need to save various status registers for each of the plurality of tasks, so that the task selection means and the preemption means for allocating CPU resources in order of task priority while reducing the memory area are used. Multitask control scheduling can be realized.

【0031】図4は、上記実施例を具体的に説明する図
であり、MPEG2システムが規定する映像/音声/ユ
ーザストリームの多重(Multiplexer:MUXと呼ぶ)に
適用した場合の概念図である。
FIG. 4 is a diagram for specifically explaining the above embodiment, and is a conceptual diagram when applied to multiplexing of a video / audio / user stream defined by the MPEG2 system (referred to as a multiplexer: MUX).

【0032】ハードウェアは、Core CPU21と
MUX LSI22とで構成される。ファームウェア3
0は、タスク管理31、割り込み管理32、HWインタ
フェース(ハードウェアとのインタフェース)の基本O
S機能33と、Video処理34、Audio処理3
5、User処理36、PCR(システムの時刻管理を
行うタイムスタンプ)処理37、PSI(環境情報)処
理38のアプリケーション機能に階層化できる。
The hardware includes a Core CPU 21 and a MUX LSI 22. Firmware 3
0 indicates basic O of task management 31, interrupt management 32, and HW interface (interface with hardware).
S function 33, Video processing 34, Audio processing 3
5, application processing functions such as User processing 36, PCR (time stamp for performing system time management) processing 37, and PSI (environment information) processing 38.

【0033】なお、上記アプリケーションとして構成さ
れるタスクは、次のような構成になる。優先度が最も高
いタスクにのみプリエンプションの権利を与える第3の
手段ME3を用いて、時間条件が厳しくプリエンプショ
ンの権利が必要な処理であるPCR(システムの時刻管
理を行うタイムスタンプ)タスクに、最も高い優先度1
を与える。また、優先度が最も高いタスクの実行中は、
割り込みを受け付けない第4の手段ME4は、PCRタ
スクの処理時間によって割り込みが遅延するが、MUX
では許容できる。さらに、PCRタスクは、タイマ割り
込みから、50msec〜100msecの間隔で生成
され、その処理時間は数十μsecのオーダーであるの
で、タイマ割り込みの手段と、タイマ割り込み処理プロ
グラムでCPU資源待ちになったタスクにのみに、プリ
エンプションを発生させる第2の手段ME2と、各タイ
マ割込間隔内における優先度が最も高いタスクの実行時
間の総和をタイマ割込間隔よりも短くする第5の手段M
E5とを持っている。
The task configured as the application has the following configuration. By using the third means ME3 for giving the right of preemption only to the task with the highest priority, the PCR (time stamp for performing time management of the system) task, which is a process in which time conditions are strict and the right of preemption is required, is given High priority 1
give. Also, while the highest priority task is running,
The fourth means ME4, which does not accept the interrupt, delays the interrupt due to the processing time of the PCR task.
Is acceptable. Furthermore, since the PCR task is generated at intervals of 50 msec to 100 msec from the timer interrupt, and its processing time is on the order of several tens of microseconds, the timer interrupt means and the task waiting for CPU resources in the timer interrupt processing program And a fifth means M for making the sum of the execution times of the tasks having the highest priority within each timer interrupt interval shorter than the timer interrupt interval.
E5.

【0034】図4に示す実施例において、タスクの自主
中断を行わないようにタスクを分割することが可能であ
るので、図4に示す実施例は、タスクの自主中断を禁止
する手段を持っている。したがって、MPEG2システ
ムのようにメモリ制約が厳しいシステムにおいても、マ
ルチタスク制御のスケジューリング方法を導入すること
ができる。
In the embodiment shown in FIG. 4, it is possible to divide a task so that the task is not voluntarily interrupted. Therefore, the embodiment shown in FIG. 4 has means for inhibiting the voluntary interruption of a task. I have. Therefore, even in a system having strict memory restrictions such as the MPEG2 system, a scheduling method of multitask control can be introduced.

【0035】すなわち、上記実施例によれば、タスクの
優先度の高い順にCPU資源を割り当てるタスク選択手
段とプリエンプション手段を持ったマルチタスク制御の
スケジューリング方法を実現する場合、プリエンプショ
ン発生の頻度を抑止でき、タスク切り替えの処理オーバ
ヘッドを減少させることができる。また、中断したタス
クを矛盾なく再開するために必要であった各種ステータ
スレジスタをセーブするメモリエリアを削減できる。さ
らに、メモリ制約の厳しいシステムにおいてマルチタス
ク制御のスケジューリング方法を導入することによっ
て、ソフトウェアを階層化でき、アプリケーションのプ
ログラミングの修正が容易になる。
That is, according to the above embodiment, when the scheduling method of the multitask control having the task selecting means and the preemption means for allocating the CPU resources in the order of the task priority is realized, the frequency of the occurrence of the preemption can be suppressed. In addition, the processing overhead of task switching can be reduced. Further, it is possible to reduce a memory area for saving various status registers necessary for restarting the interrupted task without inconsistency. Furthermore, by introducing a scheduling method of multitask control in a system with severe memory constraints, software can be hierarchized and application programming can be easily modified.

【0036】つまり、上記実施例によれば、一定周期間
隔で割込するタイマ割込を発生させ、タイマ割込処理プ
ログラムによってCPU資源待ちになったタスクにの
み、CPU資源を割り当てるので、プリエンプションの
頻度を、タイマ割込処理プログラム契機に限定でき、こ
のようにすることによって、プリエンプションによるタ
スク切り替え回数を削減することができ、したがって、
タスクの優先度の高い順にCPU資源を割り当てるタス
ク選択手段とプリエンプション手段とを持ったマルチタ
スク制御のスケジューリング方法において、タスク切り
替えの処理オーバヘッドを抑えることができる。
That is, according to the above-described embodiment, the timer interrupt for interrupting at a constant period is generated, and the CPU resource is allocated only to the task waiting for the CPU resource by the timer interrupt processing program. The frequency can be limited to the timing of the timer interrupt processing program, and by doing so, the number of task switching due to preemption can be reduced, and therefore,
In the scheduling method of the multitask control having the task selection means and the preemption means for allocating the CPU resources in the order of the task priority, the processing overhead of the task switching can be suppressed.

【0037】また、上記実施例によれば、優先度が最も
高いタスクにのみ、プリエンプションの権利を与える手
段と、優先度が最も高いタスクの実行中は、割り込みを
受け付けない手段と、各タイマ割り込み間隔内における
優先度が最も高いタスクの実行時間の総和を、タイマ割
り込み間隔よりも短くするように制限する手段と、タス
クの自主中断を禁止する手段とを加えたので、実行中の
タスクよりも優先度が高いタスクがCPU資源待ち状態
になったときに、実行中のタスクを中断するときの各種
ステータスレジスタのセーブを削除することができ、し
たがって、タスクの優先度の高い順にCPU資源を割り
当てるタスク選択手段とプリエンプション手段とを持っ
たマルチタスク制御のスケジューリング方法において、
メモリ量を削減することができる。
According to the above embodiment, means for granting the right of preemption only to the task with the highest priority, means for not accepting an interrupt while the task with the highest priority is being executed, A means has been added to limit the sum of the execution times of the tasks with the highest priority within the interval so as to be shorter than the timer interrupt interval, and a means to prohibit voluntary suspension of the task. When a task with a higher priority enters the waiting state for CPU resources, saving of various status registers when interrupting the task being executed can be deleted, and therefore, CPU resources are allocated in order of task priority. In a scheduling method of multitask control having task selection means and preemption means,
The amount of memory can be reduced.

【0038】なお、上記実施例を装置の発明として把握
することもでき、つまり、マルチタスク制御のスケジュ
ーリング装置として把握することもできる。すなわち、
上記実施例は、自主中断を禁止した複数のタスクを1つ
のCPU上で処理するマルチタスク制御において上記タ
スクに優先度を付与し、CPU資源を次に与えるタスク
を選択するときに、CPU資源待ちしているタスクの中
で最も優先度の高いタスクにCPU資源を与えるタスク
選択方法と、実行中のタスクよりも優先度の高いタスク
がCPU資源待ちになったときに、上記実行中のタスク
を中断し、上記CPU資源待ちになった優先度の高いタ
スクにCPU資源を割り当てるプリエンプション方法と
を持つマルチタスク制御のスケジューリング装置におい
て、一定周期間隔で割込を行うタイマ割込を発生させる
第1の手段と、上記タイマ割込によってCPU資源待ち
になっているタスクにのみ、CPU資源を割り当てる第
2の手段とを有することによって上記プリエンプション
の発生頻度を抑制したことを特徴とするマルチタスク制
御のスケジューリング装置である。
The above embodiment can be understood as an invention of a device, that is, a scheduling device for multitask control. That is,
In the above-described embodiment, in multitask control in which a plurality of tasks for which self-suspension is prohibited is processed on one CPU, priorities are given to the tasks, and when a task to which CPU resources are to be given next is selected, waiting for CPU resources is performed. A task selection method for giving CPU resources to the task with the highest priority among the tasks being executed, and a task having a higher priority than the task being executed waits for the CPU resource, and In a multitask control scheduling apparatus having a preemption method of allocating CPU resources to high-priority tasks that have been interrupted and waited for the CPU resources, a timer interrupt for performing interrupts at regular intervals is generated. Means and second means for allocating CPU resources only to tasks that are waiting for CPU resources due to the timer interruption. A scheduling apparatus of a multi-task control, characterized in that inhibited the frequency of the preemption by.

【0039】また、上記マルチタスク制御のスケジュー
リング装置に、上記タイマ割込によってCPU資源待ち
になっている複数のタスクのうちで、優先度が最も高い
タスクにのみ、上記CPU資源を割り当てる第3の手段
と、上記優先度が最も高いタスクの実行中は、ハード割
り込み(タイマ割込を含むハードウェアからの全ての割
り込み)の受け付けを阻止する第4の手段と、上記各タ
イマ割り込み間隔内において、優先度が最も高いタスク
を実行する時間の総和を、タイマ割り込み間隔よりも短
くなるように制限する第5の手段とを付加した装置とし
て把握することができる。
Further, a third task of allocating the CPU resource to only the task having the highest priority among a plurality of tasks waiting for the CPU resource due to the timer interruption to the scheduling device of the multitask control. Means, a fourth means for preventing acceptance of a hardware interrupt (all interrupts from hardware including a timer interrupt) during execution of the task having the highest priority, and It can be understood as a device to which the fifth means for limiting the total time for executing the task with the highest priority to be shorter than the timer interrupt interval is added.

【0040】[0040]

【発明の効果】本発明によれば、プリエンプションで発
生するタスク切り替えの処理オーバヘッドと、中断され
るタスクの各種ステータスレジスタをセーブするメモリ
とを削減しつつ、タスクの優先度の高い順にCPU資源
を割り当てるタスク選択手段とプリエンプション手段と
を持ったマルチタスク制御のスケジューリング方法を実
現することができるという効果を奏する。
According to the present invention, while reducing the processing overhead of task switching that occurs in preemption and the memory for saving various status registers of tasks to be interrupted, CPU resources are allocated in the order of task priority. This has the effect of realizing a scheduling method of multitask control having a task selecting means to be assigned and a preemption means.

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

【図1】本発明の第1の実施例であるマルチタスク制御
のスケジューリング方法を示す図である。
FIG. 1 is a diagram showing a scheduling method for multitask control according to a first embodiment of the present invention.

【図2】本発明の第2の実施例であるマルチタスク制御
のスケジューリング方法を示す図である。
FIG. 2 is a diagram illustrating a scheduling method for multitask control according to a second embodiment of the present invention.

【図3】上記第2の実施例における処理シーケンスを示
すフローチャートである。
FIG. 3 is a flowchart showing a processing sequence in the second embodiment.

【図4】上記実施例を具体的に説明する図である。FIG. 4 is a diagram specifically illustrating the above embodiment.

【図5】従来のマルチタスク制御の説明図である。FIG. 5 is an explanatory diagram of conventional multitask control.

【図6】従来のマルチタスク制御のスケジューリングに
おける処理シーケンスを示すフローチャートである。
FIG. 6 is a flowchart showing a processing sequence in scheduling of conventional multitask control.

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

E …実行中のタスク、 TW …CPU資源待ちのタスク、 TS …中断中のタスク、 SCH1、SCH2…マルチタスク制御のスケジューラ
ー、 ME1…タイマ割り込み手段(第1の手段)、 ME2…タイマ割り込み処理プログラムによってCPU
資源待ちになったタスクにのみ、プリエンプションを発
生させる手段(第2の手段)、 ME3…タイマ割込によってCPU資源待ちになってい
る複数のタスクのうちで、優先度が最も高いタスクにの
み、CPU資源を割り当てる手段(第3の手段)、 ME4…優先度が最も高いタスクの実行中は、割り込み
を受け付けない手段(第4の手段)、 ME5…タイマ割り込み間隔内における優先度が最も高
いタスクの実行時間の総和をタイマ割り込み間隔よりも
短くする手段(第5の手段)、 ME6…自主中断しない手段(第6の手段)。
T E : task being executed, T W : task waiting for CPU resources, T S : task being suspended, SCH1, SCH2 ... scheduler for multitask control, ME1 ... timer interrupt means (first means), ME2 ... timer CPU by interrupt processing program
Means (second means) for generating preemption only for tasks waiting for resources; ME3... Among a plurality of tasks waiting for CPU resources due to timer interruption, only for tasks having the highest priority; Means for allocating CPU resources (third means); ME4 means for not accepting an interrupt while the task having the highest priority is being executed (fourth means); ME5 means the task having the highest priority within the timer interrupt interval. Means (fifth means) for making the sum of the execution times of the timers smaller than the timer interrupt interval (ME6) means for not interrupting independently (sixth means).

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 自主中断を禁止した複数のタスクを1つ
のCPU上で処理するマルチタスク制御において上記タ
スクに優先度を付与し、CPU資源を次に与えるタスク
を選択するときに、CPU資源待ちしているタスクの中
で最も優先度の高いタスクにCPU資源を与えるタスク
選択方法と、実行中のタスクよりも優先度の高いタスク
がCPU資源待ちになったときに、上記実行中のタスク
を中断し、上記CPU資源待ちになった優先度の高いタ
スクにCPU資源を割り当てるプリエンプション方法と
を持つマルチタスク制御のスケジューリング方法におい
て、 一定周期間隔で割込を行うタイマ割込を発生させる第1
の手段と;上記タイマ割込によってCPU資源待ちにな
っているタスクにのみ、CPU資源を割り当てる第2の
手段と;を有することによって上記プリエンプションの
発生頻度を抑制したことを特徴とするマルチタスク制御
のスケジューリング方法。
In a multitask control in which a plurality of tasks for which voluntary interruption is prohibited are processed on a single CPU, priorities are assigned to the tasks, and when a task to which CPU resources are to be given next is selected, waiting for CPU resources is performed. A task selection method for giving CPU resources to the task with the highest priority among the tasks being executed, and a task having a higher priority than the task being executed waits for the CPU resource, and A multi-task control scheduling method having a preemption method of allocating CPU resources to high-priority tasks that have been interrupted and waited for CPU resources, wherein a first timer interrupt that generates an interrupt at regular intervals is generated.
Means for allocating CPU resources only to tasks waiting for CPU resources due to the timer interruption; and suppressing the frequency of occurrence of the preemption by multitask control. Scheduling method.
【請求項2】 自主中断を禁止した複数のタスクを1つ
のCPU上で処理するマルチタスク制御において上記タ
スクに優先度を付与し、CPU資源を次に与えるタスク
を選択するときに、CPU資源待ちしているタスクの中
で最も優先度の高いタスクにCPU資源を与えるタスク
選択方法と、実行中のタスクよりも優先度の高いタスク
がCPU資源待ちになったときに、上記実行中のタスク
を中断し、上記CPU資源待ちになった優先度の高いタ
スクにCPU資源を割り当てるプリエンプション方法と
を持つマルチタスク制御のスケジューリング方法におい
て、 一定周期間隔で割込を行うタイマ割込を発生させる第1
の手段と;上記タイマ割込によってCPU資源待ちにな
っているタスクにのみ、CPU資源を割り当てる第2の
手段と;上記タイマ割込によってCPU資源待ちになっ
ている複数のタスクのうちで、優先度が最も高いタスク
にのみ、上記CPU資源を割り当てる第3の手段と;上
記優先度が最も高いタスクの実行中は、上記タイマ割込
を含むハードウェアからの全ての割り込みの受け付けを
阻止する第4の手段と;上記各タイマ割り込み間隔内に
おいて、上記優先度が最も高いタスクを実行する時間の
総和を、上記タイマ割り込みの間隔よりも短くなるよう
に制限する第5の手段と;を有することを特徴とするマ
ルチタスク制御のスケジューリング方法。
2. A multi-task control system in which a plurality of tasks for which self-suspendion is prohibited is processed on a single CPU. A task selection method for giving CPU resources to the task with the highest priority among the tasks being executed, and a task having a higher priority than the task being executed waits for the CPU resource, and A multi-task control scheduling method having a preemption method of allocating CPU resources to high-priority tasks that have been interrupted and waited for CPU resources, wherein a first timer interrupt that generates an interrupt at regular intervals is generated.
Means for allocating CPU resources only to tasks that are waiting for CPU resources due to the timer interrupt; and priority among a plurality of tasks waiting for CPU resources due to the timer interrupt. A third means for allocating the CPU resource only to the task having the highest priority; and a third means for preventing acceptance of all interrupts from hardware including the timer interrupt during execution of the task having the highest priority. A fourth means; and a fifth means for limiting a total time for executing the task having the highest priority within each of the timer interrupt intervals so as to be shorter than the timer interrupt interval. A scheduling method for multitask control, characterized by:
JP24266796A 1996-08-26 1996-08-26 Scheduling method for multitask control Pending JPH1063515A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP24266796A JPH1063515A (en) 1996-08-26 1996-08-26 Scheduling method for multitask control

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP24266796A JPH1063515A (en) 1996-08-26 1996-08-26 Scheduling method for multitask control

Publications (1)

Publication Number Publication Date
JPH1063515A true JPH1063515A (en) 1998-03-06

Family

ID=17092457

Family Applications (1)

Application Number Title Priority Date Filing Date
JP24266796A Pending JPH1063515A (en) 1996-08-26 1996-08-26 Scheduling method for multitask control

Country Status (1)

Country Link
JP (1) JPH1063515A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003030251A (en) * 2001-07-19 2003-01-31 Fujitsu Ltd Simulation system, method, program and recording medium
KR20040036993A (en) * 2002-10-25 2004-05-04 주식회사 디지털앤디지털 Apparatus and method for scheduling using system timer
KR100594187B1 (en) * 1998-12-26 2006-10-25 삼성전자주식회사 Timer driving method in intelligent network switching system under Unix system environment with thread call processing structure
CN111580952A (en) * 2019-02-18 2020-08-25 北京京东尚科信息技术有限公司 Method and apparatus for assigning a multi-tasking set to cache ways
US10949634B2 (en) 2005-06-03 2021-03-16 Hand Held Products, Inc. Apparatus having hybrid monochrome and color image sensor array
US11317050B2 (en) 2005-03-11 2022-04-26 Hand Held Products, Inc. Image reader comprising CMOS based image sensor array

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100594187B1 (en) * 1998-12-26 2006-10-25 삼성전자주식회사 Timer driving method in intelligent network switching system under Unix system environment with thread call processing structure
JP2003030251A (en) * 2001-07-19 2003-01-31 Fujitsu Ltd Simulation system, method, program and recording medium
KR20040036993A (en) * 2002-10-25 2004-05-04 주식회사 디지털앤디지털 Apparatus and method for scheduling using system timer
US11863897B2 (en) 2005-03-11 2024-01-02 Hand Held Products, Inc. Image reader comprising CMOS based image sensor array
US11968464B2 (en) 2005-03-11 2024-04-23 Hand Held Products, Inc. Image reader comprising CMOS based image sensor array
US11323650B2 (en) 2005-03-11 2022-05-03 Hand Held Products, Inc. Image reader comprising CMOS based image sensor array
US11323649B2 (en) 2005-03-11 2022-05-03 Hand Held Products, Inc. Image reader comprising CMOS based image sensor array
US11317050B2 (en) 2005-03-11 2022-04-26 Hand Held Products, Inc. Image reader comprising CMOS based image sensor array
US11238252B2 (en) 2005-06-03 2022-02-01 Hand Held Products, Inc. Apparatus having hybrid monochrome and color image sensor array
US11238251B2 (en) 2005-06-03 2022-02-01 Hand Held Products, Inc. Apparatus having hybrid monochrome and color image sensor array
US11604933B2 (en) 2005-06-03 2023-03-14 Hand Held Products, Inc. Apparatus having hybrid monochrome and color image sensor array
US11625550B2 (en) 2005-06-03 2023-04-11 Hand Held Products, Inc. Apparatus having hybrid monochrome and color image sensor array
US10949634B2 (en) 2005-06-03 2021-03-16 Hand Held Products, Inc. Apparatus having hybrid monochrome and color image sensor array
US12001913B2 (en) 2005-06-03 2024-06-04 Hand Held Products, Inc. Apparatus having hybrid monochrome and color image sensor array
US12001914B2 (en) 2005-06-03 2024-06-04 Hand Held Products, Inc. Apparatus having hybrid monochrome and color image sensor array
US12020111B2 (en) 2005-06-03 2024-06-25 Hand Held Products, Inc. Apparatus having hybrid monochrome and color image sensor array
US12026580B2 (en) 2005-06-03 2024-07-02 Hand Held Products, Inc. Apparatus having hybrid monochrome and color image sensor array
CN111580952A (en) * 2019-02-18 2020-08-25 北京京东尚科信息技术有限公司 Method and apparatus for assigning a multi-tasking set to cache ways

Similar Documents

Publication Publication Date Title
US8793695B2 (en) Information processing device and information processing method
US7467385B2 (en) Interrupt and exception handling for multi-streaming digital processors
US20010034751A1 (en) Real-time OS simulator
JP2008506187A (en) Method and system for parallel execution of multiple kernels
JP2000056992A (en) Task scheduling system, its method and recording medium
WO2008017489A1 (en) Fine grain os scheduling
JPH1063515A (en) Scheduling method for multitask control
JP6311330B2 (en) Information processing apparatus, information processing method, and program
US8423681B2 (en) Control apparatus for process input-output device
KR100848323B1 (en) Method for enhancing real time response in embedded OS kernel
JP3840045B2 (en) Data processing method and data processing apparatus
JPH10177489A (en) Task scheduling method
WO2000070482A1 (en) Interrupt and exception handling for multi-streaming digital processors
WO2001035209A2 (en) Modified move to rear list system and methods for thread scheduling
JP3169316B2 (en) Task scheduling method
JP2667575B2 (en) Task scheduling method
JPH0644234B2 (en) Task management device
CN110109743B (en) Real-time process scheduling method
JPH09106358A (en) Scheduling method of virtual computer system and device therefor
JPH10161890A (en) Scheduler
JP2006172229A (en) Operation control method for task, operation control system for task and program
JPH0778091A (en) Multitask managing method
JPH0512038A (en) Cpu queuing time control dispatching system
JPS63159941A (en) Task control system for real time os
JPH01177638A (en) System for scheduling job