[go: up one dir, main page]

JPH08190491A - Task switching method - Google Patents

Task switching method

Info

Publication number
JPH08190491A
JPH08190491A JP1555295A JP1555295A JPH08190491A JP H08190491 A JPH08190491 A JP H08190491A JP 1555295 A JP1555295 A JP 1555295A JP 1555295 A JP1555295 A JP 1555295A JP H08190491 A JPH08190491 A JP H08190491A
Authority
JP
Japan
Prior art keywords
task
data
execution
executed
tasks
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP1555295A
Other languages
Japanese (ja)
Inventor
Katsumi Kumagai
克己 熊谷
Yoshiaki Jinme
良明 甚目
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.)
Koki Holdings Co Ltd
Original Assignee
Hitachi Koki 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 Hitachi Koki Co Ltd filed Critical Hitachi Koki Co Ltd
Priority to JP1555295A priority Critical patent/JPH08190491A/en
Publication of JPH08190491A publication Critical patent/JPH08190491A/en
Pending legal-status Critical Current

Links

Abstract

(57)【要約】 【目的】 本発明の目的は、複数のタスクを時分割によ
り順次実行するリアルタイム処理において、タスクの実
行要求、実行するタスクの決定に要する時間を短縮する
とともに実行優先順位が同等レベル以下のタスクの実行
も可能にすることである。 【構成】 複数個のタスクデータ21が予め作成登録す
るとともにタスクの実行順序が予め登録された実行順序
テーブル25とを備え、実行順序テーブル25に登録さ
れているタスクの実行順序に従い実行するタスクを決定
する際に、順番の回ってきたタスクのタスクデータ21
中のタスクステータス20を検査し、実行可能であれば
該タスクの実行を行うようにしたタスク切り換え方法。
(57) [Summary] [Object] An object of the present invention is to reduce the time required to determine a task execution request and a task to be executed in real-time processing in which a plurality of tasks are sequentially executed in a time-division manner. It is also possible to execute tasks at the same level or lower. An execution order table 25 in which a plurality of pieces of task data 21 are created and registered in advance and the execution order of the tasks is registered in advance, and a task to be executed in accordance with the execution order of the tasks registered in the execution order table 25 is executed. When determining, the task data 21 of the task that has come around in order
A task switching method in which the inside task status 20 is inspected and the task is executed if the task status is executable.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、工作機械等に組み込ん
で機械を制御するプログラムを細かいタスクに分割し、
分割した複数のタスクを時分割方法により順次実行して
いく場合のタスク切り換え方法に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention divides a program for controlling a machine incorporated into a machine tool into fine tasks,
The present invention relates to a task switching method when a plurality of divided tasks are sequentially executed by a time division method.

【0002】[0002]

【従来の技術】従来の時分割によるタスクの切り換え方
法について一例を挙げて説明する。図5に示すタスクデ
ータ35は、タスクの情報を示すデータであり、あるタ
スクの実行要求が発生すると、タスクデータ35を記憶
する領域を確保し、該タスクの実行終了時に記憶領域を
解放する。タスクデータ35は、タスクの実行中、中断
中、待機中を示す状態フラグ31、タスクの実行優先順
位を示す優先順位データ32、タスクを起動する際のレ
ジスタ値、アドレス値等を示す再開データ33、タスク
の次に実行要求が発生したタスクのタスクデータの先頭
アドレスを示す次タスクデータ先頭アドレス34等から
構成されている。
2. Description of the Related Art A conventional method of switching tasks by time division will be described with an example. The task data 35 shown in FIG. 5 is data indicating task information, and when an execution request for a certain task occurs, an area for storing the task data 35 is secured, and the storage area is released at the end of execution of the task. The task data 35 includes a status flag 31 indicating that the task is being executed, suspended, or waiting, priority data 32 that indicates the task execution priority, and restart data 33 that indicates a register value when starting the task, an address value, or the like. , And the next task data start address 34 indicating the start address of the task data of the task for which the execution request is issued after the task.

【0003】図6は前記タスクデータ35をコントロー
ルするための起動待ちタスクコントロールブロック38
とタスクデータ35a〜35dの関係を示した図であ
る。起動待ちタスクコントロールブロック38は、各タ
スクデータ35を管理するためのデータバッファであ
り、タスクの実行要求により発生したタスクデータ35
の中で一番早く発生したタスクデータ35の先頭アドレ
スを記憶する先頭タスクデータアドレス36、タスクの
実行要求により発生したタスクデータ35の中で一番遅
く発生したタスクデータ35の先頭アドレスを記憶する
最終タスクデータアドレス37から構成されている。
FIG. 6 shows a task control block 38 waiting for activation for controlling the task data 35.
It is a figure showing the relation between and task data 35a-35d. The activation waiting task control block 38 is a data buffer for managing each task data 35, and the task data 35 generated by a task execution request is generated.
The first task data address 36 that stores the first address of the task data 35 that occurs earliest in the table, and the first address of the task data 35 that occurs the latest in the task data 35 that is generated by the task execution request are stored. It is composed of the final task data address 37.

【0004】あるタスクの実行が要求されると、該タス
クのタスクデータ35を記憶する領域を確保し、該タス
クのタスクデータ35を初期化する。そして確保したタ
スクデータ35の先頭アドレスを最終タスクデータアド
レス37に記憶するとともに該タスクの前に実行要求の
発生したタスクのタスクデータ35の次タスクデータ先
頭アドレスにも記憶する。これにより、実行要求の発生
したタスクのタスクデータ35は繋げられ、実行要求が
発生しているタスクのタスクデータ35を管理すること
が可能となる。
When a task is requested to be executed, an area for storing the task data 35 of the task is secured and the task data 35 of the task is initialized. Then, the head address of the secured task data 35 is stored in the final task data address 37, and is also stored in the head address of the next task data of the task data 35 of the task for which the execution request is issued before the task. As a result, the task data 35 of the task for which the execution request has been generated is linked, and the task data 35 for the task for which the execution request has been generated can be managed.

【0005】図6の場合は、各タスクの実行要求によ
り、タスクデータ35a〜35dが発生し、タスクデー
タ35a〜35dのうち、一番早く発生したタスクデー
タは35aであり、タスクデータ35aの先頭アドレス
が先頭タスクデータアドレス36に記憶されている。同
様に、一番遅く発生したタスクデータは35dであり、
タスクデータ35dの先頭アドレスが最終タスクデータ
アドレス37に記憶されている。タスクデータ35aの
次に発生したタスクデータは35bであり、タスクデー
タ35aの次タスクデータ先頭アドレス34aにタスク
データ35bの先頭アドレスが記憶されている。次タス
クデータ先頭アドレス34bには、タスクデータ35c
の先頭アドレスが記憶されている。
In the case of FIG. 6, task data 35a to 35d are generated in response to the execution request of each task, and the task data which has occurred earliest among the task data 35a to 35d is 35a. The address is stored in the head task data address 36. Similarly, the latest task data that occurred is 35d,
The start address of the task data 35d is stored in the final task data address 37. The task data generated next to the task data 35a is 35b, and the start address of the task data 35b is stored in the next task data start address 34a of the task data 35a. The task data 35c is stored in the next task data start address 34b.
The start address of is stored.

【0006】図6の状態において、あるタスクの実行要
求が発生すると、起動待ちタスクコントロールブロック
38及び各タスクデータ35a〜35eの関係は図7の
ようになる。図7において、35eは新たなタスクの実
行要求によって発生したタスクデータである。図6の状
態において、新たにタスクの実行要求が発生すると、そ
のタスクデータ35eを記憶する領域を確保し、タスク
データ35eを初期化する。そして最終タスクデータア
ドレス37にタスクデータ35eの先頭アドレスを記憶
する。さらに、該タスクの前に実行要求の発生したタス
クのタスクデータ35dの次タスクデータ先頭アドレス
34dにタスクデータ35eの先頭アドレスを記憶す
る。
In the state of FIG. 6, when an execution request for a certain task is generated, the relationship between the activation waiting task control block 38 and each task data 35a to 35e is as shown in FIG. In FIG. 7, 35e is task data generated by a new task execution request. In the state of FIG. 6, when a new task execution request is generated, an area for storing the task data 35e is secured and the task data 35e is initialized. Then, the start address of the task data 35e is stored in the final task data address 37. Further, the head address of the task data 35e is stored in the next task data head address 34d of the task data 35d of the task for which the execution request is issued before the task.

【0007】従来の時分割によるリアルタイム処理で
は、上記した各データを用いて、次のようにタスクの切
り換えが行われる。
In the conventional time-division real-time processing, tasks are switched as follows using each of the above-mentioned data.

【0008】図4は実行するタスクの切り換え時の処理
手順の一例を示したフローチャートであり、タイマ割り
込み等によるタスクの切り換え処理では、タスク中断処
理27、起動タスク決定処理29、タスク起動処理30
が順番に行われる。また、タスクの実行終了によるタス
ク切り換え処理では、タスク実行終了処理28、起動タ
スク決定処理29、タスク起動処理30が順番に行われ
ることを示している。
FIG. 4 is a flow chart showing an example of a processing procedure at the time of switching the task to be executed. In the task switching processing by a timer interrupt or the like, the task interruption processing 27, the activation task determination processing 29, and the task activation processing 30.
Are performed in order. Further, in the task switching process upon completion of task execution, the task execution end process 28, the activation task determination process 29, and the task activation process 30 are performed in order.

【0009】仮に、図7の状態においてタスクデータ3
5aのタスク実行中に、タイマ割り込み等により、タス
クの切り換え要求が発生すると、最初にタスク中断処理
27が行われる。タスク中断処理27では、切り換った
時点のレジスタ値、アドレス値等を再開データ33aに
退避し、状態フラグ31aを中断中にセットし、起動タ
スク決定処理29を行う。起動タスク決定処理29で
は、各タスクデータ35の優先順位データ32a〜32
eを比較し、最も優先順位の高いタスクを次に起動する
タスクに決定し、タスク起動処理30を行う。
Assuming that the task data 3 is in the state shown in FIG.
When a task switching request is generated by a timer interrupt or the like during execution of the task 5a, the task suspension processing 27 is first performed. In the task suspension processing 27, the register value, the address value, etc. at the time of switching are saved in the restart data 33a, the status flag 31a is set to the suspension, and the activation task determination processing 29 is performed. In the activation task determination processing 29, the priority order data 32a to 32 of each task data 35
e is compared, the task with the highest priority is determined as the task to be activated next, and the task activation processing 30 is performed.

【0010】仮に、起動タスク決定処理29の結果、タ
スクデータ35bの優先順位が最も高かった場合、タス
ク起動処理30では、決定したタスクの再開データ33
b等を復帰し、さらに、状態フラグ31bを実行中に変
更して、決定したタスクの起動を行う。
If, as a result of the activation task determination process 29, the task data 35b has the highest priority, the task activation process 30 determines the restart data 33 of the determined task.
b and the like are restored, and the state flag 31b is changed to “during execution” to activate the determined task.

【0011】また、タスクの実行終了により、タスク切
り換え要求が発生すると、最初にタスク実行終了処理2
8が行われる。タスク実行終了処理28では、実行が終
了したタスクのタスクデータ35の記憶領域を解放し、
それに伴うタスクデータ35の変更、起動待ちタスクコ
ントロールブロック38の変更等を行う。仮に、図7の
状態において、タスクデータ35bの実行終了により、
タスク切り換え要求が発生すると、タスク実行終了処理
28では、タスクデータ35bの記憶領域を解放し、次
タスクデータ先頭アドレス34aにタスクデータ35c
の先頭アドレスを記憶する(図8)。そして上記と同様
に起動タスク決定処理29、タスク起動処理30を順番
に行う。
When a task switching request is generated due to the completion of task execution, first, task execution end processing 2
8 is performed. In the task execution end processing 28, the storage area of the task data 35 of the task whose execution has ended is released,
Along with that, the task data 35 is changed, and the activation waiting task control block 38 is changed. If the task data 35b is completed in the state of FIG. 7,
When a task switching request is issued, in the task execution end processing 28, the storage area of the task data 35b is released and the task data 35c is set to the next task data start address 34a.
The top address of the is stored (FIG. 8). Then, similarly to the above, the activation task determination processing 29 and the task activation processing 30 are sequentially performed.

【0012】[0012]

【発明が解決しようとする課題】上記したように従来の
リアルタイム処理では、起動待ちタスクコントロールブ
ロック38の制御、タスクデータ35を記憶する領域の
確保及び解放、タスクの実行要求時の処理、再開データ
33の退避及び復帰、起動タスク決定処理29は実行す
るタスクを切り換える際に必ず行われる。
As described above, in the conventional real-time processing, the control of the activation waiting task control block 38, the securing and releasing of the area for storing the task data 35, the processing at the time of requesting the execution of the task, and the restart data are performed. The saving / restoring 33 and the activation task determination processing 29 are always performed when switching the task to be executed.

【0013】しかし、上記処理に要する時間は、システ
ム全体から見た場合、無駄な時間である。また、上記し
たタスク切り換え方法では、優先順位が高く処理の長い
タスクが実行されると、優先順位が同等レベル以下のタ
スクが長時間実行されない恐れがある。
However, the time required for the above processing is a wasteful time from the viewpoint of the entire system. Further, in the task switching method described above, when a task having a high priority and a long processing is executed, a task having a priority equal to or lower than the equivalent level may not be executed for a long time.

【0014】本発明の目的は、上記した従来技術の欠点
をなくし、実行要求タスクの登録、決定に要する時間を
短縮するとともにタスクの制御を容易に行えるようにす
ることである。
An object of the present invention is to eliminate the above-mentioned drawbacks of the prior art, shorten the time required for registration and determination of an execution request task, and facilitate task control.

【0015】[0015]

【課題を解決するための手段】工作機械等に組み込んで
機械を制御するプログラムは、パソコン等を用いてアプ
リケーションプログラムを起動するプログラムと違っ
て、システム作成時に予め実行するタスクは決まってい
る。また、システム作成時に予め実行するタスクは決ま
っているため、タスクの基本的な実行順序も予め決定す
ることができる。従って、全タスクのタスクデータを予
め設けておくことにより、起動待ちタスクコントロール
ブロックの制御、タスクデータ記憶領域の確保及び解放
の処理を省くことができる。さらに、タスクの基本的な
実行順序を示す実行順序テーブルの内容を予め設定して
おき、実行順序テーブルに従ってタスクの実行順序を決
定することにより、タスク切り換え時に毎回必ず行って
いた優先順位の比較、起動タスク決定処理に要する時間
を削減することが可能になるとともに特定タスクの長時
間連続処理をなくすことが可能になる。
Unlike a program for starting an application program using a personal computer or the like, a program to be incorporated in a machine tool or the like to control the machine has predetermined tasks to be executed at the time of system creation. Moreover, since the tasks to be executed at the time of creating the system are determined in advance, the basic execution order of the tasks can also be determined in advance. Therefore, by providing the task data of all the tasks in advance, it is possible to omit the control of the activation waiting task control block and the processing of securing and releasing the task data storage area. Furthermore, the contents of the execution order table indicating the basic execution order of tasks are set in advance, and the execution order of the tasks is determined according to the execution order table, so that the priority order is always compared at each task switching, It is possible to reduce the time required for the activation task determination processing and to eliminate the long-time continuous processing of a specific task.

【0016】タスクの実行要求の有無を示すタスクステ
ータスを各タスクに設け、タスクステータスを実行要求
有りにすることにより、タスクの実行要求が発生したこ
とにし、実行順序テーブルに従って順番が回ってきたと
きに、タスクステータスを検査し、タスクの起動を行う
か否かを決定することによりタスクの実行要求に要する
時間も減少させることができる。
When a task status indicating whether or not there is a task execution request is provided for each task and the task status is set to "execute request", it is determined that the task execution request has occurred, and when the turn comes according to the execution order table. Moreover, by checking the task status and deciding whether or not to activate the task, the time required for the task execution request can be reduced.

【0017】また、各タスク間の排他、2つ以上のタス
クを同時に実行する等タスク間の関係もシステム作成時
には決定している。従って、各タスク間の関係を示す関
係マトリックステーブルを設け、タスクの実行要求時に
関係マトリックステーブルに基づいて、各タスクのタス
クステータスを変更することにより、タスク間の制御も
容易になる。
Further, the relation between tasks such as exclusion between tasks and execution of two or more tasks at the same time is also determined when the system is created. Therefore, by providing a relationship matrix table indicating the relationship between the tasks and changing the task status of each task based on the relationship matrix table when the task execution request is made, control between the tasks becomes easy.

【0018】[0018]

【作用】この方法では、タスクの実行要求、実行するタ
スクの決定に要する時間を短縮することができるととも
に優先順位が同等レベル以下のタスクの実行が可能にな
る。
According to this method, it is possible to reduce the time required for requesting execution of a task and determining the task to be executed, and it is possible to execute the tasks having the same priority level or lower.

【0019】[0019]

【実施例】以下実施例図面を参照して本発明タスク切り
換え方法を用いたリアルタイム処理を説明する。図1は
本発明タスク切り換え方法の処理手順の一実施例を示す
フローチャートである。図2及び図9、図10は本発明
タスク切り換え方法で使用されるタスクデータ21及び
実行順序テーブル25、関係マトリックステーブル26
を示す。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Real-time processing using the task switching method of the present invention will be described below with reference to the drawings of the embodiments. FIG. 1 is a flow chart showing an embodiment of the processing procedure of the task switching method of the present invention. 2 and 9 and 10 show task data 21, an execution order table 25, and a relationship matrix table 26 used in the task switching method of the present invention.
Indicates.

【0019】図9の実行順序テーブル25には、カウン
タ値1,2,3・・・Cnに対応して実行するタスク名
を予め登録している。タスクカウンタには、カウンタ値
1〜Cnのいずれかを記憶しており、タスクカウンタに
記憶されているカウンタ値に対応したタスクが次に実行
するタスクの最優先候補となる。
Task names to be executed are registered in advance in the execution order table 25 of FIG. 9 in correspondence with the counter values 1, 2, 3 ... Cn. The task counter stores any of the counter values 1 to Cn, and the task corresponding to the counter value stored in the task counter becomes the highest priority candidate for the task to be executed next.

【0020】図2はタスクデータ21であり、予め各タ
スクに必ず1個設けられている。タスクデータ21はタ
スクの情報を示すデータであり、タスクの実行中、中断
中、待機中を示す状態フラグ17、タスクの実行を再開
するときの優先順位を示す再開優先順位データ18、タ
スクを起動する際のレジスタ値、アドレス値等を示す再
開データ19及びタスクの実行要求の有無を示すタスク
ステータス20から構成されている。
FIG. 2 shows task data 21, which is provided in advance for each task. The task data 21 is data indicating task information, and includes a status flag 17 indicating that the task is being executed, suspended, or waiting, restart priority data 18 that indicates the priority when restarting the execution of the task, and the task is activated. It is composed of resuming data 19 indicating register values, address values, etc., and a task status 20 indicating the presence or absence of a task execution request.

【0021】図10の関係マトリックステーブル26に
は、実行要求を発生するタスクに対応して、制御を行う
タスクの処理がタスクごとに予め登録されている。例え
ばタスク1の実行を要求する場合には、図10の関係マ
トリックステーブル26に従ってタスク2〜タスクnの
タスクデータにS12〜S1nの処理を行う。該処理と
は、相手タスクのタスクステータス20、再開データ1
9等を変更することを指し、これらのデータを変更する
ことにより、相手タスクの実行要求を行ったり、実行要
求を取り消したりする。
In the relationship matrix table 26 of FIG. 10, the processing of the task for controlling is registered in advance for each task in correspondence with the task that issues the execution request. For example, when the execution of task 1 is requested, the processing of S12 to S1n is performed on the task data of task 2 to task n according to the relationship matrix table 26 of FIG. The processing is the task status 20 of the partner task, the restart data 1
9 and the like are changed, and by changing these data, the execution request of the partner task is issued or the execution request is canceled.

【0022】最初にタスクの実行要求を発行する方法に
ついて述べる。図3はタスクの実行要求処理を示すフロ
ーチャートである。あるタスクの実行を要求する場合、
タスクのタスクステータス20を実行要求有りにセット
し、図10に示す関係マトリックステーブル26に基づ
いて、他のタスクのタスクデータ21を変更する。
First, a method of issuing a task execution request will be described. FIG. 3 is a flowchart showing task execution request processing. When requesting the execution of a task,
The task status 20 of the task is set to “execution requested”, and the task data 21 of other tasks are changed based on the relationship matrix table 26 shown in FIG.

【0023】次に、タスクの切り換え方法について図1
のフローチャートを参照して述べる。タイマ等によりタ
スクの切り換え要求が発生すると、タスク中断処理1、
起動タスク決定処理3、タスク起動処理4の順に各処理
を行いタスクの切り換えを行う。また、タスクの実行終
了により、タスクの切り換え要求が発生すると、タスク
実行終了処理2、起動タスク決定処理3、タスク起動処
理4の順に各処理を行いタスクの切り換えを行う。
Next, the task switching method will be described with reference to FIG.
This will be described with reference to the flowchart of. When a task switching request is generated by a timer or the like, task interruption processing 1,
Each task is switched in order of the activation task determination processing 3 and the task activation processing 4 to switch the tasks. Further, when a task switching request is generated due to the completion of task execution, the task switching processing is performed by sequentially executing the task execution termination processing 2, the activation task determination processing 3, and the task activation processing 4.

【0024】タイマ割り込み等により実行タスクの切り
換え要求が発生すると、タスク中断処理1を行う。タス
ク中断処理1では、実行していたタスクの状態フラグ1
7を中断中にセットし、再開データ19を待避する。こ
れにより、再びこのタスクを実行するときに退避中の再
開データ19を復帰させることにより、該タスクを中断
した状態から引き続いて実行させることができる。
When an execution task switching request is generated by a timer interrupt or the like, task interruption processing 1 is performed. In task suspension processing 1, status flag 1 of the task that was being executed
7 is set during interruption, and the restart data 19 is saved. As a result, when the task is executed again, the saved resume data 19 is restored, so that the task can be continuously executed from the suspended state.

【0025】タスク中断処理1終了後、起動タスク決定
処理3を行う。起動タスク決定処理3ではタスクカウン
タを更新し、実行順序テーブル25に示すカウンタ値に
対応したタスクを選択する。そして選択したタスクのタ
スクステータス20が実行要求有りであれば、該タスク
を次に実行するタスクに決定する。該タスクが実行要求
無しであれば、各タスクの状態フラグ17をチェックし
て実行中断中のタスクを検索する。実行中断中のタスク
があれば、その再開優先順位データ18を検査し、一番
優先順位の高いタスクを次に実行するタスクに決定す
る。中断中のタスクが無かった場合、予め決めておいた
補助タスクを次に実行するタスクに決定する。なお、補
助タスクとは実行要求を発生しているタスクが無い場合
に実行するタスクを指す。
After the task interruption processing 1 is completed, the activation task determination processing 3 is performed. In the activation task determination processing 3, the task counter is updated and the task corresponding to the counter value shown in the execution order table 25 is selected. If the task status 20 of the selected task is the execution request, the task is determined to be the task to be executed next. If there is no execution request for the task, the status flag 17 of each task is checked to search for a task whose execution is suspended. If there is a task whose execution is suspended, the restart priority data 18 is checked, and the task with the highest priority is determined as the task to be executed next. If there is no suspended task, the previously determined auxiliary task is determined as the task to be executed next. The auxiliary task refers to a task that is executed when there is no task that has issued an execution request.

【0026】起動タスク決定処理3終了後、タスク起動
処理4を行う。タスク起動処理4では、状態フラグ17
を実行中に変更し、再開データ19を復帰させ決定した
タスクの実行を行う。タスクの実行終了により実行タス
クの切り換え要求が発生すると、タスク実行終了処理2
を行う。タスク実行終了2処理では、実行していたタス
クのタスクデータ21を初期化する。タスク実行終了処
理2終了後、起動タスク決定処理3を行う。起動タスク
決定処理3では、各タスクの状態フラグ17をチェック
して、実行中断中のタスクを検索する。そして、実行中
断中のタスクのうち、一番優先順位の高いタスクを次に
実行するタスクに決定する。中断中のタスクが無かった
場合、予め決めておいた補助タスクを次に実行するタス
クに決定する。起動タスク決定処理3終了後、タスク起
動処理4を行う。
After the activation task determination process 3 is completed, a task activation process 4 is performed. In the task activation process 4, the status flag 17
Is changed during execution, the restart data 19 is restored, and the determined task is executed. When an execution task switching request is generated due to the end of task execution, task execution end processing 2
I do. In the task execution end 2 process, the task data 21 of the task being executed is initialized. After the task execution end process 2 is completed, a start task determination process 3 is performed. In the activation task determination processing 3, the status flag 17 of each task is checked to search for a task whose execution is suspended. Then, of the suspended tasks, the task with the highest priority is determined as the task to be executed next. If there is no suspended task, the previously determined auxiliary task is determined as the task to be executed next. After the activation task determination processing 3 is completed, the task activation processing 4 is performed.

【0027】[0027]

【発明の効果】本発明によれば、予め実行するタスクの
順序を決めているため、実行要求タスクの登録及び実行
するタスクの決定に要する時間を短縮することができる
とともにタスクの制御を容易に行うことができる。
According to the present invention, since the order of tasks to be executed is determined in advance, it is possible to reduce the time required for registering the execution request task and determining the task to be executed, and to easily control the tasks. It can be carried out.

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

【図1】本発明タスク切り換え方法の一実施例を示すフ
ローチャート。
FIG. 1 is a flowchart showing an embodiment of a task switching method according to the present invention.

【図2】本発明で使用されるタスクデータの一例を示す
データ図。
FIG. 2 is a data diagram showing an example of task data used in the present invention.

【図3】本発明のタスク実行要求処理を示すフローチャ
ート。
FIG. 3 is a flowchart showing task execution request processing of the present invention.

【図4】本発明タスク切り換え方法の処理手順の一例を
示すフローチャート。
FIG. 4 is a flowchart showing an example of a processing procedure of the task switching method of the present invention.

【図5】従来のタスク切り換え方法で使用されるタスク
データの一例を示すデータ図。
FIG. 5 is a data diagram showing an example of task data used in a conventional task switching method.

【図6】従来の起動待ちタスクコントロールブロックと
タスクデータの関係を示すデータ図。
FIG. 6 is a data diagram showing the relationship between a conventional activation waiting task control block and task data.

【図7】図6の状態から変化した状態を示すデータ図。FIG. 7 is a data diagram showing a state changed from the state of FIG.

【図8】図7の状態から変化した状態を示すデータ図。FIG. 8 is a data diagram showing a state changed from the state of FIG.

【図9】本発明タスク切り換え方法で使用される実行順
序テーブルを示すテーブル。
FIG. 9 is a table showing an execution order table used in the task switching method of the present invention.

【図10】本発明タスク切り換え方法で使用される関係
マトリックステーブルを示すテーブル。
FIG. 10 is a table showing a relationship matrix table used in the task switching method of the present invention.

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

1,27…タスク中断処理、2,28…タスク実行終了
処理、3,29…起動タスク決定処理、4,30…タス
ク起動処理、17,31,33a〜33e…状態フラ
グ、18,32,33a〜33e…再開優先順位デー
タ、19,33,33a〜33e…再開データ、20…
タスクステータス、21,35,35a〜35e…タス
クデータ、25…実行順序テーブル、26…関係マトリ
ックステーブル、34,34a〜34e…次タスクデー
タ先頭アドレス、36…先頭タスクデータアドレス、3
7…最終タスクデータアドレス、38…起動待ちタスク
コントロールブロック。
1, 27 ... Task interruption processing, 2, 28 ... Task execution end processing, 3, 29 ... Activation task determination processing, 4, 30 ... Task activation processing, 17, 31, 33a to 33e ... Status flag, 18, 32, 33a ... 33e ... Resume priority data, 19, 33, 33a-33e ... Resume data, 20 ...
Task status 21, 35, 35a to 35e ... Task data, 25 ... Execution order table, 26 ... Relationship matrix table, 34, 34a to 34e ... Next task data start address, 36 ... Start task data address, 3
7 ... Final task data address, 38 ... Activation waiting task control block.

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 複数のタスクを時分割により順次実行す
るリアルタイム処理において、少なくとも、タスクが実
行中、待機中、中断中のいずれであるかを示す状態フラ
グ、タスクに実行要求があるか否かを示すタスクステー
タス、各タスクの実行を再開する時の優先順位を示す再
開優先順位データ、各タスクを起動する際のレジスタ
値、アドレス値等を示す再開データからなるタスクデー
タ及びタスクの実行順序が予め登録された実行順序テー
ブルを備え、実行順序テーブルに登録されているタスク
の実行順序に従い実行するタスクを決定する際に、順番
の回ってきたタスクの前記タスクステータスを検査し、
実行可能であれば該タスクの実行を行うことを特徴とす
るタスク切り換え方法。
1. In real-time processing for sequentially executing a plurality of tasks in a time-division manner, at least a status flag indicating whether the task is executing, waiting, or suspended, and whether or not the task has an execution request. The task data consisting of the task status that indicates the task status, the restart priority data that indicates the priority order when restarting the execution of each task, the register value when starting each task, the restart data that indicates the address value, and the task execution order are With a pre-registered execution order table, when determining the task to be executed according to the execution order of the tasks registered in the execution order table, inspect the task status of the task that has come in order,
A task switching method characterized by executing the task if it is executable.
【請求項2】 タスクの実行要求時に、該タスクの実行
が可能であれば、該タスクと同時に実行を行えないタス
クのタスクステータスを実行要求無しにする等他のタス
クデータを変更することにより、タスク間の制御を行え
るようにしたことを特徴とする請求項1記載のタスク切
り換え方法。
2. When a task execution request is made, if the task can be executed, the task status of the task that cannot be executed simultaneously with the task is changed to other task data by changing the task status to no execution request. The task switching method according to claim 1, wherein control between tasks is performed.
JP1555295A 1995-01-04 1995-01-04 Task switching method Pending JPH08190491A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1555295A JPH08190491A (en) 1995-01-04 1995-01-04 Task switching method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1555295A JPH08190491A (en) 1995-01-04 1995-01-04 Task switching method

Publications (1)

Publication Number Publication Date
JPH08190491A true JPH08190491A (en) 1996-07-23

Family

ID=11891941

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1555295A Pending JPH08190491A (en) 1995-01-04 1995-01-04 Task switching method

Country Status (1)

Country Link
JP (1) JPH08190491A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005284906A (en) * 2004-03-30 2005-10-13 Kyocera Corp Mobile phone terminal device, program management method, and computer program therefor
JP2005284904A (en) * 2004-03-30 2005-10-13 Kyocera Corp Mobile phone terminal device, program management method, and computer program therefor
US7386707B2 (en) 2002-01-09 2008-06-10 Matsushita Electric Industrial Co., Ltd. Processor and program execution method capable of efficient program execution
JP2009104611A (en) * 2002-01-09 2009-05-14 Panasonic Corp Processor
US7730479B2 (en) 2004-03-30 2010-06-01 Kyocera Corporation Cell-phone terminal, program management method and computer program of same
US7735087B2 (en) 2003-03-13 2010-06-08 Panasonic Corporation Task switching apparatus, method and program

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7930520B2 (en) 2002-01-09 2011-04-19 Panasonic Corporation Processor and program execution method capable of efficient program execution
US9823946B2 (en) 2002-01-09 2017-11-21 Socionext Inc. Processor and program execution method capable of efficient program execution
US7386707B2 (en) 2002-01-09 2008-06-10 Matsushita Electric Industrial Co., Ltd. Processor and program execution method capable of efficient program execution
JP2009104611A (en) * 2002-01-09 2009-05-14 Panasonic Corp Processor
JP2009266252A (en) * 2002-01-09 2009-11-12 Panasonic Corp Processor
US8719827B2 (en) 2002-01-09 2014-05-06 Panasonic Corporation Processor and program execution method capable of efficient program execution
US8006076B2 (en) 2002-01-09 2011-08-23 Panasonic Corporation Processor and program execution method capable of efficient program execution
US7921281B2 (en) 2002-01-09 2011-04-05 Panasonic Corporation Processor and program execution method capable of efficient program execution
US7735087B2 (en) 2003-03-13 2010-06-08 Panasonic Corporation Task switching apparatus, method and program
US7950016B2 (en) 2003-03-13 2011-05-24 Panasonic Corporation Apparatus for switching the task to be completed in a processor by switching to the task assigned time slot
US8276156B2 (en) 2003-03-13 2012-09-25 Panasonic Corporation Task switching based on assigned time slot
JP2005284906A (en) * 2004-03-30 2005-10-13 Kyocera Corp Mobile phone terminal device, program management method, and computer program therefor
US7730479B2 (en) 2004-03-30 2010-06-01 Kyocera Corporation Cell-phone terminal, program management method and computer program of same
JP2005284904A (en) * 2004-03-30 2005-10-13 Kyocera Corp Mobile phone terminal device, program management method, and computer program therefor

Similar Documents

Publication Publication Date Title
JP2001134454A (en) Method and system for updating component in computer environment and manufactured product
JPH08190491A (en) Task switching method
JPH04284548A (en) Data base exclusive controlling system
JP2000315192A (en) Client-server system, method for managing server application and recording medium
JPH0325624A (en) Program control system
JP2007179100A (en) Job queue system, job management method, control program, and readable recording medium
JP2843748B2 (en) Exclusive control method
JPS628234A (en) Shared program control system
JP2822728B2 (en) Computer system
JP3778720B2 (en) Software update method
JPH02127732A (en) Job control system
JPH0433127A (en) Check point control system
JPH03196222A (en) Program replacing system
JP2976725B2 (en) Resource management method in standby system
JPH0546452A (en) Commitment control system
JPS62194559A (en) Memory scheduling system of program in virtual storage system
JPH03196341A (en) Data synchronization management method in online systems
JPH08263296A (en) System for preserving and restoring program execution environment
JP2000285031A (en) Method and device for automatically duplicating computer file
JPH04157534A (en) Suspending/restarting system for task group unit
JPH07200283A (en) Exchange system for resident load module
JPH10124331A (en) Data processing method
JPH076045A (en) Memory management method in multiprocessing system
JPH02211545A (en) Job execution control method
JPH04104339A (en) Automatic allocation method for file area of computer