JPH04367057A - Real-time processor for plural tasks - Google Patents

Real-time processor for plural tasks

Info

Publication number
JPH04367057A
JPH04367057A JP14361091A JP14361091A JPH04367057A JP H04367057 A JPH04367057 A JP H04367057A JP 14361091 A JP14361091 A JP 14361091A JP 14361091 A JP14361091 A JP 14361091A JP H04367057 A JPH04367057 A JP H04367057A
Authority
JP
Japan
Prior art keywords
task
tasks
priority
real
time
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
JP14361091A
Other languages
Japanese (ja)
Inventor
Naohisa Morimoto
直久 森本
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.)
Panasonic Electric Works Co Ltd
Original Assignee
Matsushita Electric Works 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 Matsushita Electric Works Ltd filed Critical Matsushita Electric Works Ltd
Priority to JP14361091A priority Critical patent/JPH04367057A/en
Publication of JPH04367057A publication Critical patent/JPH04367057A/en
Pending legal-status Critical Current

Links

Landscapes

  • Bus Control (AREA)

Abstract

PURPOSE:To improve the real-time responsivility by changing the priority of a prescribed task when the prescribed conditions are satisfied in a real-time multi-task operating system where plural tasks are processed in real time. CONSTITUTION:The tasks of higher priority are carried out first and then the tasks of lower priority are carried out later among those tasks stored in a task priority storage means 1. For this purpose, the executing tasks are switched to each other by an executing task switch means 2. When a condition deciding means 3 decides that the prescribed conditions are satisfied, the priority of a prescribed task stored in the means 1 is changed by a priority changing means 4. Thus the executing order is changes so that the task to be processed with preference under the prescribed conditions is carried out first. In such a constitution, the real-time responsivility is improved in a real-time multi-task operating system.

Description

【発明の詳細な説明】[Detailed description of the invention]

【0001】0001

【産業上の利用分野】本発明は、複数タスクの実時間処
理装置に関するものであり、さらに詳しくは、コンピュ
ータのリアルタイム・マルチタスクオペレーティングシ
ステムの改良に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to real-time multi-task processing apparatus, and more particularly to improvements in real-time multi-tasking operating systems for computers.

【0002】0002

【従来の技術】従来、コンピュータの運用効率並びに操
作性を向上させるためにオペレーティングシステム(O
S)が広く用いられている。このうち、リアルタイム・
マルチタスクOSは、複数のタスク(マルチタスク)を
実時間(リアルタイム)で処理する機能を備えたOSで
あり、工場のプロセス制御やビル管理システムに利用さ
れている。リアルタイム・マルチタスクOSにおいて、
各タスクの実行順序を決めるアルゴリズムには、優先順
位方式とラウンドロビン方式のいずれか一方、あるいは
両方の組合せが一般的に用いられている。優先順位方式
では、予め設定した優先順位の高いタスクを先に実行し
、優先順位の低いタスクを後に実行する。また、ラウン
ドロビン方式では、並列実行させたいタスクに平等にC
PU時間を割り当てて、その時間内に終わらないタスク
は強制終了して実行待ち状態とし、次のタスクを実行す
る。
[Prior Art] Conventionally, operating systems (O
S) is widely used. Of these, real-time
A multitasking OS is an OS that has a function of processing multiple tasks (multitasking) in real time, and is used in factory process control and building management systems. In real-time multitasking OS,
As an algorithm for determining the execution order of each task, either a priority method or a round robin method, or a combination of both are generally used. In the priority system, tasks with preset higher priorities are executed first, and tasks with lower priorities are executed later. In addition, in the round-robin method, tasks that are to be executed in parallel are given equal C
A PU time is allocated, and any task that does not finish within that time is forcibly terminated and placed in a waiting state for execution, and the next task is executed.

【0003】従来の標準的なリアルタイム・マルチタス
クOSにおけるタスク処理順序の決定アルゴリズムを図
5に例示する。今、複数のタスクT1,T2,T3,T
4,T5,T6,…のプライオリティ(優先順位)が、
図5に示す通りであるとする。すなわち、タスクT1,
T2,T3が同一順位で第1順位、タスクT4が第2順
位、タスクT5,T6が同一順位で第3順位とする。第
1順位のタスクT1,T2,T3は、矢印Aに示すよう
に、時分割的に順次実行される。そして、第1順位のタ
スクT1,T2,T3の実行が終了すれば、次に、矢印
Bに示すように、第2順位のタスクT4が実行される。 そして、第2順位のタスクT4の実行が終了すれば、次
に、矢印Cに示すように、第3順位のタスクT5,T6
が時分割的に順次実行される。
FIG. 5 illustrates an algorithm for determining the task processing order in a conventional standard real-time multitasking OS. Now, multiple tasks T1, T2, T3, T
The priorities of 4, T5, T6,...
Assume that it is as shown in FIG. That is, task T1,
Tasks T2 and T3 have the same rank and are ranked first, task T4 has the second rank, and tasks T5 and T6 have the same rank and have the third rank. The tasks T1, T2, and T3 in the first order are sequentially executed in a time-sharing manner as shown by arrow A. Then, when the execution of the tasks T1, T2, and T3 in the first order is completed, the task T4 in the second order is executed next, as shown by arrow B. When the execution of the task T4 in the second order is completed, the tasks T5 and T6 in the third order are then executed as shown by the arrow C.
are executed sequentially in a time-sharing manner.

【0004】このように、従来のリアルタイム・マルチ
タスクOSでは、複数のタスクを実時間処理しようとす
るとき、その実行順序は各タスクに予めジェネレーショ
ン時に割り当てられたプライオリティによって決定され
、そのプライオリティが高いものから順次処理される。 さらに、同一プライオリティのタスク間では、FIFO
(First  In  First  Out)のア
ルゴリズムに従い、先に入力されたタスクが先に実行さ
れるように、順次処理される。なお、タスクの処理待ち
順序は、システムコールあるいは割り込み処理の発生時
に決定される。
[0004] In this way, in a conventional real-time multitasking OS, when attempting to process multiple tasks in real time, the execution order is determined by the priority assigned to each task in advance at the time of generation. Things are processed sequentially. Furthermore, between tasks with the same priority, FIFO
According to the (First In First Out) algorithm, tasks are sequentially processed so that the task input first is executed first. Note that the processing wait order of tasks is determined when a system call or interrupt processing occurs.

【0005】[0005]

【発明が解決しようとする課題】従来のリアルタイム・
マルチタスクOSでは、複数のタスクが同時に動作要求
を出しているとき、その処理は一貫して上述の手順で実
行される。しかし、実際には或る条件が成立したとき、
その次に行われる処理は経験的に予想できる。例えば、
ビル管理のシステムでは、警報が発生したときにユーザ
ーが行う処理としては、まず、その警報の箇所を調べて
、処理対策のマニュアルを見た後、その処理対策を実行
することが予想できる。このような場合、警報の箇所を
調べるための処理タスクや、処理対策のマニュアルを見
るための処理タスク、並びに処理対策の実行タスクが、
通常時よりも高いレベルのプライオリティで待ちの状態
にあることが望ましい。しかるに、従来のOSでは、ジ
ェネレーション時のプライオリティに従ってタスクの実
行順序が決定されるため、見た目の反応が遅いように感
じられることがある。
[Problem to be solved by the invention] Conventional real-time
In a multitasking OS, when a plurality of tasks issue operation requests at the same time, the processing is consistently executed according to the above-described procedure. However, in reality, when certain conditions are met,
The subsequent processing can be predicted empirically. for example,
In a building management system, when an alarm occurs, the user should first investigate the location of the alarm, read a manual for countermeasures, and then take the appropriate countermeasures. In such a case, a processing task to check the location of the alarm, a processing task to view the countermeasure manual, and a processing task to execute the countermeasure are
It is desirable to be in a waiting state with a higher level of priority than normal. However, in the conventional OS, the execution order of tasks is determined according to the priority at the time of generation, so the response may seem slow.

【0006】本発明はこのような点に鑑みてなされたも
のであり、その目的とするところは、複数のタスクを実
時間で処理するリアルタイム・マルチタスクOSにおい
て、所定の条件が満たされる場合には所定のタスクの優
先順位を変更することにより、実時間応答性を高めるこ
とにある。
[0006] The present invention has been made in view of the above points, and its purpose is to provide a real-time multitasking OS that processes multiple tasks in real time, when predetermined conditions are met. The objective is to improve real-time responsiveness by changing the priority of certain tasks.

【0007】[0007]

【課題を解決するための手段】本発明に係る複数タスク
の実時間処理装置にあっては、上記の課題を解決するた
めに、図1に示すように、複数のタスクの各々に割り当
てられた優先順位を記憶するタスク優先順位記憶手段1
と、タスク優先順位記憶手段1の記憶内容を参照して優
先順位の高いタスクを優先順位の低いタスクよりも先に
実行し、同一優先順位のタスクは所定の順序で循環的に
実行する実行タスク切換手段2とを備えるCPU制御装
置において、所定の条件を判定する条件判定手段3と、
条件判定手段3により所定の条件が判定されたときにタ
スク優先順位記憶手段1に記憶された優先順位を変更す
る優先順位変更手段4とを備えることを特徴とするもの
である。
[Means for Solving the Problems] In order to solve the above problems, in the real-time processing device for multiple tasks according to the present invention, as shown in FIG. Task priority storage means 1 for storing priorities
and an execution task that refers to the memory contents of the task priority storage means 1, executes tasks with higher priorities before tasks with lower priorities, and executes tasks with the same priority cyclically in a predetermined order. In a CPU control device comprising a switching means 2, a condition determining means 3 for determining a predetermined condition;
The task priority changing means 4 changes the priority stored in the task priority storing means 1 when a predetermined condition is determined by the condition determining means 3.

【0008】[0008]

【作用】本発明では、複数のタスクを実時間で処理する
に際して、タスク優先順位記憶手段1に記憶された各タ
スクの優先順位に基づいて、優先順位の高いタスクを先
に実行し、優先順位の低いタスクを後に実行するように
、実行タスク切換手段2により実行タスクを切り換える
。この実行タスク切換手段2では、同一優先順位のタス
クについては、所定の順序で循環的に各タスクを実行す
るように、実行タスクを切り換えて行く。
[Operation] In the present invention, when processing a plurality of tasks in real time, based on the priority of each task stored in the task priority storage means 1, a task with a high priority is executed first, and The execution task is switched by the execution task switching means 2 so that the task with a lower value is executed later. The execution task switching means 2 switches execution tasks so that tasks with the same priority are executed cyclically in a predetermined order.

【0009】条件判定手段3では、所定の条件が満たさ
れるか否かを判定する。そして、所定の条件が満たされ
る場合には、タスク優先順位記憶手段1に記憶された所
定のタスクの優先順位を優先順位変更手段4により変更
する。このようにすれば、所定の条件の下で優先的に処
理されるべきタスクが先に実行されるように実行順序が
変更され、実時間応答性を高めることができる。
The condition determining means 3 determines whether a predetermined condition is satisfied. If a predetermined condition is satisfied, the priority order of the predetermined task stored in the task priority order storage means 1 is changed by the priority order change means 4. In this way, the execution order is changed so that tasks that should be processed preferentially under predetermined conditions are executed first, and real-time responsiveness can be improved.

【0010】0010

【実施例】図2は本発明の一実施例のハードウェア構成
を示すブロック図である。図中、10はバスラインであ
り、アドレスバスとデータバス及び制御バスを含んでい
る。11はCPUであり、いわゆるノイマン型のプログ
ラム実行機能を備えている。12は外部I/O装置であ
り、外部からデータを入力したり、外部にデータを出力
する機能を有する。13はキーボード、14はCRTデ
ィスプレイであり、オペレータ(操作者)とコンピュー
タとの間のマン−マシン・インターフェイスとして利用
される。15はROMであり、オペレーティングシステ
ム(OS)や必要なプログラムが格納されている。16
はRAMであり、各種の変数やフラグ、テーブル等が格
納されている。なお、本実施例では、CPU11は内蔵
タイマ20を備えているものとする。内蔵タイマ20は
一定時間又はプログラムされた時間毎に割り込みを発生
させて、タスクの切り換えを行うために利用される。
Embodiment FIG. 2 is a block diagram showing the hardware configuration of an embodiment of the present invention. In the figure, 10 is a bus line, which includes an address bus, a data bus, and a control bus. Reference numeral 11 denotes a CPU, which has a so-called Neumann type program execution function. Reference numeral 12 denotes an external I/O device, which has a function of inputting data from the outside and outputting data to the outside. A keyboard 13 and a CRT display 14 are used as a man-machine interface between an operator and a computer. 15 is a ROM, which stores an operating system (OS) and necessary programs. 16
is a RAM in which various variables, flags, tables, etc. are stored. In this embodiment, it is assumed that the CPU 11 includes a built-in timer 20. The built-in timer 20 is used to generate an interrupt at fixed or programmed intervals to switch tasks.

【0011】図3は本実施例のリアルタイムOSにおけ
るタスクの処理順序決定の原理を概念的に示している。 このOSでは、タスクの処理順序を決定する際に、従来
のタスク単位のプライオリティだけでなく、メモリープ
ールの使用状況、各キューの待ち状況、実メモリー内及
び実メモリー外のタスクの状況、実行中タスク、停止中
タスク、割り込みの状況、さらに、警報等に応じた参照
ルールに応じて、動的にプライオリティを変化させなが
ら、最適なタスクの処理順序を決定するものである。
FIG. 3 conceptually shows the principle of determining the processing order of tasks in the real-time OS of this embodiment. When determining the processing order of tasks, this OS uses not only the conventional priority of each task, but also the usage status of the memory pool, the waiting status of each queue, the status of tasks inside and outside real memory, and the status of tasks currently being executed. The optimal processing order of tasks is determined while dynamically changing priorities according to reference rules corresponding to tasks, stopped tasks, interrupt situations, and alarms.

【0012】図4は本実施例のリアルタイムOSの構成
を更に具体的に示すブロック図である。図中、#1はデ
ィスパッチャであり、本システムの特徴となる部分であ
る。これは以下に述べる各管理ブロック#2〜#5から
の情報と#7の参照ルールから、#6のタスク処理順序
を決定するブロックである。#2は現在発生中の割り込
みの種類とその処理状況を管理する割り込み管理ブロッ
クである。#3は各メモリプールの使用状況を管理する
プール使用状況管理ブロックである。メモリプールの使
用状況としては、各メモリプールの空きとフリーブロッ
クの所有タスクが管理対象となる。#4は各キューの待
ち状況を管理するキュー管理ブロックである。#5は現
在の各レベルでの処理待ちの対象となっているタスクの
状況を管理するタスク状況管理ブロックである。
FIG. 4 is a block diagram showing more specifically the configuration of the real-time OS of this embodiment. In the figure, #1 is a dispatcher, which is a feature of this system. This is a block that determines the task processing order of #6 from the information from each management block #2 to #5 described below and the reference rule of #7. #2 is an interrupt management block that manages the type of interrupt currently occurring and its processing status. #3 is a pool usage status management block that manages the usage status of each memory pool. The usage status of memory pools is managed based on the free space in each memory pool and the tasks owning free blocks. #4 is a queue management block that manages the waiting status of each queue. #5 is a task status management block that manages the status of tasks that are currently waiting for processing at each level.

【0013】次に、#7の参照ルールについて詳述する
。これは、ターゲットシステムの作成時にユーザーが作
成する動的なタスクプライオリティの変更のためのルー
ルである。ここで、このルールの表記法はC言語に準拠
するものとするが、使用可能な関数は以下に定義された
ものだけとする。以下、#7の参照ルールで使用する関
数について説明する。
Next, reference rule #7 will be explained in detail. This is a rule for dynamic task priority changes created by the user when creating the target system. Here, it is assumed that the notation of this rule conforms to the C language, but the only functions that can be used are those defined below. The functions used in reference rule #7 will be explained below.

【0014】(1)PriGet これは、タスクの現在のプライオリティ値を得るための
関数であり、その書式は次の通りとする。 ret=PriGet(taskname);ここで、
tasknameはタスク名であり、返却値は、指定の
タスクが存在しなかった場合には、ret=−1となり
、指定のタスクが存在する場合には、そのタスクの現在
のプライオリティ値Priを得ることができ、ret=
Priとなる。
(1) PriGet This is a function for obtaining the current priority value of a task, and its format is as follows. ret=PriGet(taskname); where,
taskname is the task name, and the return value is ret = -1 if the specified task does not exist, and obtains the current priority value Pri of the task if the specified task exists. is done, ret=
Becomes Pri.

【0015】(2)PriSet これは、タスクのプライオリティ値をセットするための
関数であり、その書式は次の通りとする。 ret=PriSet(taskname,num{,
−u,−d,−s}〔,−t〕); ここで、tasknameはタスク名であり、numは
0〜255の数値である。返却値は、正常終了時には、
ret=0となり、指定のタスクが存在しなかった場合
には、ret=−1となる。オプション−uは、num
で示された値だけタスクのプライオリティを上げる。た
だし、上限を越える値が指定されたときは上限値で切り
捨てる。オプション−dは、numで示された値だけタ
スクのプライオリティを下げる。ただし、下限を下回る
値が指定されたときは下限値で切り上げる。オプション
−sは、numで示した値をタスクのプライオリティと
して新たに設定する。ただし、上下限を越える値が指定
されたときは上下限値で切り捨てる。オプション−tは
、そのタスクが停止すると同時に元のプライオリティに
戻す。なお、〔〕は省略可能である。
(2) PriSet This is a function for setting the priority value of a task, and its format is as follows. ret=PriSet(taskname, num{,
-u, -d, -s} [, -t]); Here, taskname is the task name, and num is a numerical value from 0 to 255. The return value is, upon successful completion,
ret=0, and if the specified task does not exist, ret=-1. option -u is num
Increase the priority of the task by the value indicated by . However, if a value exceeding the upper limit is specified, it will be rounded down to the upper limit. Option-d lowers the priority of the task by the value indicated by num. However, if a value below the lower limit is specified, round up to the lower limit. Option -s newly sets the value indicated by num as the task priority. However, if a value exceeding the upper and lower limits is specified, it will be rounded down to the upper and lower limits. Option -t restores the original priority as soon as the task is stopped. Note that [ ] can be omitted.

【0016】また、第2の書式として、次の書式も使用
可能とする。 ret=PriSet(taskname,DEFPR
I); ここで、tasknameはタスク名であり、DEFP
RIはジェネレーション時に決められた値である。この
書式を使用した場合には、指定のタスクのプラオリティ
をジェネレーション時に決められた値に戻すことができ
る。
[0016] Furthermore, the following format can also be used as the second format. ret=PriSet(taskname, DEFPR
I); Here, taskname is the task name and DEFP
RI is a value determined at the time of generation. When this format is used, the priority of the specified task can be returned to the value determined at generation time.

【0017】(3)WakeUp これは、タスクを立ち上げるための関数であり、その書
式は次の通りとする。 ret=WakeUp(taskname);ここで、
tasknameはタスク名であり、返却値は、指定の
タスクが存在しなかった場合には、ret=−1となり
、指定のタスクが既に動作中である場合には、ret=
1となり、正常終了時には、ret=0となる。
(3) WakeUp This is a function to wake up a task, and its format is as follows. ret=WakeUp(taskname); where,
taskname is the task name, and the return value is ret=-1 if the specified task does not exist, and ret=-1 if the specified task is already running.
1, and upon normal termination, ret=0.

【0018】(4)Sleep これは、タスクを停止させるための関数であり、その書
式は次の通りとする。 ret=Sleep(taskname);ここで、t
asknameはタスク名であり、返却値は、指定のタ
スクが存在しなかった場合には、ret=−1となり、
指定のタスクが既に停止中である場合には、ret=1
となり、正常終了時には、ret=0となる。
(4) Sleep This is a function for stopping a task, and its format is as follows. ret=Sleep(taskname); where t
askname is the task name, and the return value is ret=-1 if the specified task does not exist.
If the specified task is already stopped, ret=1
Therefore, upon normal termination, ret=0.

【0019】(5)I/O これは、登録外部I/Oからのアクセス情報を得るため
の関数であり、その書式は次の通りとする。 ret=I/O(IOname); ここで、IOnameは外部I/O(ポート)名であり
、返却値は、指定の外部I/Oが存在しなかった場合に
は、ret=−1となり、指定の外部I/Oからのアク
セスがあった場合には、ret=0となる。
(5) I/O This is a function for obtaining access information from a registered external I/O, and its format is as follows. ret=I/O(IOname); Here, IOname is the external I/O (port) name, and the return value is ret=-1 if the specified external I/O does not exist. If there is an access from the specified external I/O, ret=0.

【0020】(6)PoolFree これは指定されたプールのフリーブロックサイズを得る
ための関数であり、その書式は次の通りとする。 ret=PoolFree(Poolname);ここ
で、Poolnameはプール名であり、返却値は、指
定のプールが存在しなかった場合には、ret=−1と
なり、指定のプールが存在する場合には、そのプールの
フリーブロックバイト数Freeを得ることができ、r
et=Freeとなる。
(6) PoolFree This is a function for obtaining the free block size of a specified pool, and its format is as follows. ret=PoolFree(Poolname); Here, Poolname is the pool name, and the return value is ret=-1 if the specified pool does not exist, and if the specified pool exists, its You can get the number of free block bytes of the pool, Free, and r
et=Free.

【0021】(7)PoolBlockこれは指定され
たプール内のメモリーブロックの使用状況を得るための
関数であり、その書式は次の通りとする。 ret=PoolBlock(Poolname);こ
こで、Poolnameはプール名であり、返却値は、
指定のプールが存在しなかった場合には、ret=−1
となり、指定のプールが存在する場合には、そのプール
内のメモリーブロックの使用状況を格納した構造体変数
Blockを得ることができ、ret=Blockとな
る。
(7) PoolBlock This is a function for obtaining the usage status of memory blocks in a specified pool, and its format is as follows. ret=PoolBlock(Poolname); Here, Poolname is the pool name, and the return value is
If the specified pool does not exist, ret=-1
Then, if the specified pool exists, the structure variable Block storing the usage status of the memory block in the pool can be obtained, and ret=Block.

【0022】ここで、構造体変数Blockは、C言語
のstruct文を用いて、次のように定義される。 struct  Block{unsigned  i
nt  Count;unsigned  char 
 *Whos〔_BMAX,1〕;}; ここで、変数Countは、符号を持たない整数値(0
〜65535)のデータ型を有しており、使用中のブロ
ックの総数を示す。また、*Whos〔_BMAX,1
〕はポインター配列であり、ポインター演算子(*)が
付いている文字型の配列変数である。_BMAXはシス
テム変数であり、1プール内の最大ブロック数を表す。 第2添字=0の場合、各ブロックの所有タスク名が格納
されており、第2添字=1の場合、各ブロックの先頭ア
ドレスが格納されている。
[0022] Here, the structure variable Block is defined as follows using a C language struct statement. struct Block{unsigned i
nt Count; unsigned char
*Whos[_BMAX,1];}; Here, the variable Count is an unsigned integer value (0
~65535) and indicates the total number of blocks in use. Also, *Whos[_BMAX, 1
] is a pointer array, which is a character type array variable with the pointer operator (*) attached. _BMAX is a system variable and represents the maximum number of blocks within one pool. When the second subscript = 0, the name of the owning task of each block is stored, and when the second subscript = 1, the start address of each block is stored.

【0023】(8)Que これは指定されたキューの待ちフリーブロックの状況を
得るための関数であり、その書式は次の通りとする。 ret=Que(Quename); ここで、Quenameはキュー名であり、返却値は、
指定のキューが存在しなかった場合には、ret=−1
となり、指定のキューが存在する場合には、そのキュー
の待ちフリーブロックの使用状況を格納した構造体変数
Queを得ることができ、ret=Queとなる。
(8) Que This is a function for obtaining the status of waiting free blocks in a specified queue, and its format is as follows. ret=Que(Quename); Here, Quename is the queue name, and the return value is
If the specified queue does not exist, ret=-1
If the specified queue exists, a structure variable Que that stores the usage status of the waiting free blocks of the queue can be obtained, and ret=Que.

【0024】ここで、構造体変数Queは、C言語のs
truct文を用いて、次のように定義される。 struct  Que{unsigned  int
  Count;unsigned  char  *
Whos〔_QMAX,1〕;}; ここで、変数Countは、符号を持たない整数値(0
〜65535)のデータ型を有しており、待ちになって
いるキューの総数を示す。また、*Whos〔_QMA
X〕はポインター配列であり、ポインター演算子(*)
が付いている文字型の配列変数である。_QMAXはシ
ステム変数であり、1キューに入る最大フリーブロック
数を表す。
[0024] Here, the structure variable Que is s of the C language.
It is defined as follows using the truct statement. struct Que {unsigned int
Count; unsigned char *
Whos[_QMAX,1];}; Here, the variable Count is an unsigned integer value (0
~65535) and indicates the total number of waiting queues. Also, *Whos[_QMA
X] is a pointer array, and the pointer operator (*)
It is a character type array variable with . _QMAX is a system variable and represents the maximum number of free blocks that can enter one queue.

【0025】以上のような関数を用いて表記された#7
の参照ルールを、#1のディスパッチャはシステム起動
直後に内部テーブルに登録し、実行時に参照しながら#
6の動的プライオリティを最適な状態で生み出して行く
ものである。
#7 expressed using the above functions
The #1 dispatcher registers the reference rule in the internal table immediately after system startup, and references it during execution.
6 dynamic priorities are created in an optimal state.

【0026】[0026]

【発明の効果】本発明では、優先順位の高いタスクを優
先順位の低いタスクよりも先に実行し、同一優先順位の
タスクは所定の順序で循環的に実行する複数タスクの実
時間処理装置において、所定の条件を判定する条件判定
手段と、条件判定手段により所定の条件が判定されたと
きにタスク優先順位記憶手段に記憶された優先順位を変
更する優先順位変更手段とを設けたものであるから、所
定の条件が満たされる場合には所定のタスクの優先順位
を変更することができ、これにより、実時間応答性を高
めることができ、自由度の高い最適制御が可能となると
いう効果がある。
Effects of the Invention The present invention provides a real-time processing device for multiple tasks in which a task with a higher priority is executed before a task with a lower priority, and tasks with the same priority are executed cyclically in a predetermined order. , a condition determining means for determining a predetermined condition, and a priority changing means for changing the priority stored in the task priority storage means when the predetermined condition is determined by the condition determining means. Therefore, if a predetermined condition is met, the priority of a predetermined task can be changed, which has the effect of increasing real-time responsiveness and enabling optimal control with a high degree of freedom. be.

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

【図1】本発明の基本構成を示すクレーム対応ブロック
図である。
FIG. 1 is a claim-compatible block diagram showing the basic configuration of the present invention.

【図2】本発明の一実施例のハードウェア構成を示すブ
ロック図である。
FIG. 2 is a block diagram showing the hardware configuration of an embodiment of the present invention.

【図3】本発明におけるタスクの処理順序決定の原理を
概念的に示す図である。
FIG. 3 is a diagram conceptually illustrating the principle of determining the processing order of tasks in the present invention.

【図4】本発明のシステム構成を示すブロック図である
FIG. 4 is a block diagram showing the system configuration of the present invention.

【図5】従来例の動作説明図である。FIG. 5 is an explanatory diagram of the operation of a conventional example.

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

1    タスク優先順位記憶手段 2    実行タスク切換手段 3    条件判定手段 4    優先順位変更手段 1. Task priority storage means 2 Execution task switching means 3 Condition determination means 4. Priority change means

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】    複数のタスクの各々に割り当てら
れた優先順位を記憶するタスク優先順位記憶手段と、タ
スク優先順位記憶手段の記憶内容を参照して優先順位の
高いタスクを優先順位の低いタスクよりも先に実行し、
同一優先順位のタスクは所定の順序で循環的に実行する
実行タスク切換手段とを備えるCPU制御装置において
、所定の条件を判定する条件判定手段と、条件判定手段
により所定の条件が判定されたときにタスク優先順位記
憶手段に記憶された優先順位を変更する優先順位変更手
段とを備えることを特徴とする複数タスクの実時間処理
装置。
1. Task priority storage means for storing priorities assigned to each of a plurality of tasks, and tasks with higher priority than tasks with lower priority by referring to the stored contents of the task priority storage means. Also run first,
In a CPU control device comprising an execution task switching means for cyclically executing tasks of the same priority in a predetermined order, a condition determining means for determining a predetermined condition; and when the predetermined condition is determined by the condition determining means. 1. A real-time processing device for a plurality of tasks, comprising: priority order changing means for changing the priority order stored in the task priority order storage means.
JP14361091A 1991-06-14 1991-06-14 Real-time processor for plural tasks Pending JPH04367057A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP14361091A JPH04367057A (en) 1991-06-14 1991-06-14 Real-time processor for plural tasks

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP14361091A JPH04367057A (en) 1991-06-14 1991-06-14 Real-time processor for plural tasks

Publications (1)

Publication Number Publication Date
JPH04367057A true JPH04367057A (en) 1992-12-18

Family

ID=15342739

Family Applications (1)

Application Number Title Priority Date Filing Date
JP14361091A Pending JPH04367057A (en) 1991-06-14 1991-06-14 Real-time processor for plural tasks

Country Status (1)

Country Link
JP (1) JPH04367057A (en)

Similar Documents

Publication Publication Date Title
US7810096B2 (en) Computer executing multiple operating systems
US8612986B2 (en) Computer program product for scheduling ready threads in a multiprocessor computer based on an interrupt mask flag value associated with a thread and a current processor priority register value
US5390329A (en) Responding to service requests using minimal system-side context in a multiprocessor environment
US5469571A (en) Operating system architecture using multiple priority light weight kernel task based interrupt handling
US6360243B1 (en) Method, device and article of manufacture for implementing a real-time task scheduling accelerator
US5333319A (en) Virtual storage data processor with enhanced dispatching priority allocation of CPU resources
US5666523A (en) Method and system for distributing asynchronous input from a system input queue to reduce context switches
US8135894B1 (en) Methods and systems for reducing interrupt latency by using a dedicated bit
CN111597044A (en) Task scheduling method and device, storage medium and electronic equipment
Manner Hardware task/processor scheduling in a polyprocessor environment
Gupta et al. MAKING EFFECTIVE USE OF SHARED-MEMORY MULTIPROCESSORS: THE PROCESS CONTROL APPROACH (REV.
JP2001249808A (en) Information processor
JPH04367057A (en) Real-time processor for plural tasks
JPH04367035A (en) Real time processor for plural tasks
JP3349547B2 (en) Scheduling system
KR100506254B1 (en) Apparatus and method for handling interrupt in non-privileged of embedded system
Labrosse Operating systems
WO1992003783A1 (en) Method of implementing kernel functions
JPH08314740A (en) Process dispatch method
JP2001229038A (en) Multi-operating computer system
Papadimitriou et al. A Comparative Evaluation of Core Kernel Features of the Recent Linux, FreeBSD, Solaris, and Windows Operating Systems
Wang et al. Interrupt Processing and Process Scheduling
JPH03253965A (en) Multi-task processing system by controller
JPH03257634A (en) Method and device for parallelly processing program
CN115951987A (en) Method, device and medium for executing multi-thread task in storage system