JPH03257634A - Method and device for parallelly processing program - Google Patents

Method and device for parallelly processing program

Info

Publication number
JPH03257634A
JPH03257634A JP5688190A JP5688190A JPH03257634A JP H03257634 A JPH03257634 A JP H03257634A JP 5688190 A JP5688190 A JP 5688190A JP 5688190 A JP5688190 A JP 5688190A JP H03257634 A JPH03257634 A JP H03257634A
Authority
JP
Japan
Prior art keywords
task
cpu
tasks
interrupt
register
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
JP5688190A
Other languages
Japanese (ja)
Inventor
Toshiaki Ochiai
落合 利章
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP5688190A priority Critical patent/JPH03257634A/en
Publication of JPH03257634A publication Critical patent/JPH03257634A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To simultaneously execute plural tasks at real time by executing the plural tasks on the same memory by using plural central processing units (CPU). CONSTITUTION:A CPU 7a executes an initial processing by power-on interruption and executes the task by task activation interruption and CPUs 7b-7m do not generate interruption by power-on but execute the tasks by the task activating interruption. Corresponding to a task activation requiring signal outputted from any one of CPUs 7a-7m, an interruption controller 9 generates the interruption in any one of the CPUs 7a-7m. Thus, the plural tasks stored in an integrated computer can be executed in parallel and simultaneously.

Description

【発明の詳細な説明】 [産業上の利用分野] この発明は高速なリアルタイム処理が要求される組み込
み計算機用プログラムに於いて各種プログラム・タスク
(以降タスクと言う)を簡単な方法で並列に実行させる
ことを実現したプログラム並列実行方法及びその装置に
関するものである。
[Detailed Description of the Invention] [Field of Industrial Application] This invention is a simple method for executing various program tasks (hereinafter referred to as tasks) in parallel in embedded computer programs that require high-speed real-time processing. The present invention relates to a program parallel execution method and apparatus that achieve this.

[従来の技術] 従来、1つのメモリ領域に入っている複数のプログラム
を並行して実行する場合、各プログラムに優先レベルを
付けてタスクとして定義し、それらの実行制御をオペレ
ーティング・ンステム(以降O8と言う)が行い、実行
時点で最も優先レベルの高いタスクを実行する方式を採
っていたので幾つかのタスクが起動されているときに複
数のタスクが並行して実行している様に見えるが、実際
は1つのセントラル・プロセッサ(以降CPUと言う)
しかないので、同時点では1つのタスクしか実行できな
かった。
[Prior Art] Conventionally, when multiple programs stored in one memory area are executed in parallel, each program is assigned a priority level and defined as a task, and their execution is controlled by an operating system (hereinafter referred to as O8). ), and the task with the highest priority level at the time of execution was executed, so it appears that multiple tasks are running in parallel when several tasks are activated. , actually one central processor (hereinafter referred to as CPU)
At the same time, only one task could be executed.

「発明が解決しようとする課題] 従来の組み込み計算機用プログラムのタスク・スケジュ
ーリング方式ではCPUが1つしかなかったので、同一
メモリ上の複数のタスクを同時に並行して実行するのが
困難であった。又、低レベルのタスクが実行中に高レベ
ルのタスクが起動されたとき、その時点で高レベルのタ
スクに実行制御が移り、低レベルのタスクの実行が中断
する為低レベルのタスクの実行終了時間が高レベルのタ
スク実行状況に応じて変動していた。さらに、各タスク
がシリアルに実行される為、1つのタスクの実行時間に
全体のタスクの実行終了時間が左右されて所定の時間範
囲に納まらなくなる場合があった。また9組み込み計算
機の性能(例えばMIPS値)の向上には玄海が出始め
てきており、かつ1組み込み計算機の分野にも高級言語
が採用され出して来ているため従来より実行時間が長く
なる傾向があることから、ハードウェアの性能向上だけ
ではなくソフトウェアのアルゴリズムの改良により計算
機処理の性能を向上する必要が出てきた。
``Problems to be solved by the invention'' In the conventional task scheduling method for embedded computer programs, there was only one CPU, so it was difficult to simultaneously execute multiple tasks in the same memory in parallel. .Also, when a high-level task is started while a low-level task is being executed, execution control is transferred to the high-level task at that point, and the execution of the low-level task is interrupted, so the execution of the low-level task is interrupted. The completion time varied depending on the high-level task execution status.Furthermore, since each task was executed serially, the execution time of one task affected the execution completion time of the entire task, and the completion time of the entire task was determined by the specified time. There were cases where it fell outside the range.9 Genkai has begun to appear in improving the performance (for example, MIPS value) of embedded computers, and high-level languages are also being adopted in the field of embedded computers. Therefore, the execution time tends to be longer than before, so it has become necessary to improve computer processing performance not only by improving hardware performance but also by improving software algorithms.

本発明は、:れらの課題を解決するためになされたもの
である。
The present invention has been made to solve these problems.

[課題を解決するための手段] 主メモリに格納されている各種プログラムを実行するC
PUと、タスクの実行先頭アドレスを格納するタスク先
頭アドレスレジスタと、タスクの実行要求を設定するタ
スクステータスレジスタとCPUの使用状況を設定する
CPUビジーフラグレジスタとアプリケーションプログ
ラムからのタスク実行要求によって空きCPUを捜し、
空いているCPUがあった場合にそのCPLJに割り込
み制御装置によって割り込みを発生させて対応するタス
クの実行要求を出し、空きCPUがないときには待ち行
列バッファにタスクの実行要求を登録するO8とを備え
る。
[Means for solving the problem] C that executes various programs stored in main memory
PU, a task start address register that stores the execution start address of a task, a task status register that sets a task execution request, a CPU busy flag register that sets the CPU usage status, and a free CPU that is determined by a task execution request from an application program. search for
When there is a free CPU, an interrupt is generated by the interrupt control device in the CPLJ to issue a corresponding task execution request, and when there is no free CPU, the O8 registers the task execution request in the queue buffer. .

E作用] 同一メモリ上の複数のタスクを複数のCPUを使って実
行することにより、複数のタスクを同時にリアルタイム
で実行できる。
E-effect] By executing multiple tasks on the same memory using multiple CPUs, multiple tasks can be executed simultaneously in real time.

[実施例] 第1図はこの発明によるプログラム並列実行装置の一実
施例を示すもので1図中(1)はタスクの先頭アドレス
を設定するアドレス設定装置、 (2a)〜(2n)は
タスクの先頭アドレスを格納するタスク先頭アドレスレ
ジスタ、(3)はタスクの実行要求を設定するタスクス
テータスレジスタ、(4)はCPU(7a)〜(7鵬〉
の使用状況を設定するCPUビジーフラグレジスタ、(
5)はCP U (7a)〜CP U (7m)が凡て
使用中のときに実行要求が出されたタスクを登録してお
くタスク待ち行列バッファ、(6)は実行したタスクが
どのCPUで実行されていたかを判別するためのタスク
/CPU対応バッファ、 (7a)はパワーオン割り込
みによってイニシャル処理を実行し、タスク起動割り込
みによってタスクを実行するCPU、(7b)〜(7m
)はパワーオンによって割り込みが発生せず、タスク起
動割り込みによってタスクを実行するcpv、(s)は
各種プログラムを格納しておく主メモリ、(9)はCP
 U (7a)〜CP U(7a+)の何れかのCPU
から出されたタスク起動要求信号に応じてCP U (
7a)〜CP U (7+n)の何れかのCPUに割り
込みを発生させる割り込み制御装置である。
[Embodiment] Fig. 1 shows an embodiment of a program parallel execution device according to the present invention. In Fig. 1, (1) is an address setting device that sets the start address of a task, and (2a) to (2n) are tasks. (3) is the task status register that sets the task execution request, (4) is the CPU (7a) to (7peng)
CPU busy flag register, which sets the usage status of (
5) is a task queue buffer that registers tasks that are requested to be executed when all CPUs (7a) to (7m) are in use, and (6) is a task queue buffer that registers tasks that are requested to be executed when all CPUs (7a) to (7m) are in use. A task/CPU correspondence buffer for determining whether the task is being executed; (7a) is a CPU that executes initial processing by a power-on interrupt, and a CPU that executes a task by a task activation interrupt; (7b) to (7m);
) is a cpv that does not generate an interrupt upon power-on and executes a task by a task activation interrupt, (s) is the main memory that stores various programs, and (9) is a CPV.
Any CPU from U (7a) to CPU U (7a+)
The CPU (
This is an interrupt control device that generates an interrupt to any of the CPUs 7a) to CPU (7+n).

第2図〜第5図はこの発明によるプログラム並列実行方
法の一実施例の処理内容である。図中、二重線の処理ブ
ロックはO3の処理を呼ぶことを意味している。第2図
はCP U (7a)の処理内容を。
2 to 5 show the processing contents of an embodiment of the program parallel execution method according to the present invention. In the figure, the double-lined processing block means that the O3 processing is called. Figure 2 shows the processing content of the CPU (7a).

第3図はCP U (7b)の処理内容を、第4図はc
pU (7c)の処理内容を、第5図は各CPUで共通
的に使われるO8の処理内容を示している。説明の都合
上、タスクレベル(以降タスク1と言う)、タスクレベ
ル2(以降タスク2と言、う)、タスクレベル3(以降
タスク3と言う)の3つのタスクを同時に実行する場合
を考える。また、タスク1の各種フラグはデータのビッ
ト1で処理されるものとする。第2図においてCP U
 (7a)にパワーオン割り込みが発生することにより
タスク1を起動する(ステップ10)。タスク1の起動
要求が発行されることによってO3のタスク起動要求処
理が起動されタスクステータスレジスタのビット1にタ
スクIの実行要求が発生した旨のフラグを設定しくステ
ップ23)、 CP Uビジーフラグレジスタの内容を
見て(ステップ24)、 CP Uの占有状況をチエツ
クする(ステップ25)。 この時点ではまだどのタス
クも起動されていないのでCPUビジーレジスタのビッ
ト1をオンにしてCP U (7a)の使用中フラグを
設定しくステップ26)、タスク/CPU対応バッファ
のタスク1の使用CPUをCP U (7a)に設定し
くステップ27)、 CP U (7a)へタスク起動
要求信号を発生させ5割り込みを起こさせることにより
(ステップ28)、 CP U (7a)にタスク起動
割り込みが発生する。CP U (7a)ではタスク起
動割り込み処理(ステップ11)を実行し、OSタスク
起動割り込み処理(ステップ31〜ステツプ33)を起
動するタスク起動割り込み処理ではタスクステータスレ
ジスタの内容を見てビット1がオンになっていることか
らタスク1の起動要求が発行されていることを認識しく
ステップ31)タスクステータスレジスタをクリアしく
ステップ32)タスクエの実行先頭アドレスをタスク先
頭アドレスレジスタから知り。
Figure 3 shows the processing content of CPU (7b), and Figure 4 shows the processing content of CPU (7b).
The processing content of pU (7c) is shown in FIG. 5, and the processing content of O8, which is commonly used by each CPU, is shown in FIG. For convenience of explanation, a case will be considered in which three tasks are executed simultaneously: task level (hereinafter referred to as task 1), task level 2 (hereinafter referred to as task 2), and task level 3 (hereinafter referred to as task 3). Further, it is assumed that various flags of task 1 are processed using bit 1 of data. In Figure 2, CPU
When a power-on interrupt occurs at (7a), task 1 is activated (step 10). When the activation request for task 1 is issued, the task activation request processing of O3 is activated, and a flag indicating that an execution request for task I has been generated is set in bit 1 of the task status register (step 23), and the CPU busy flag register is set. (step 24) and check the CPU occupancy status (step 25). At this point, no task has been started yet, so turn on bit 1 of the CPU busy register and set the busy flag for the CPU (7a) (step 26), and check the CPU used by task 1 in the task/CPU correspondence buffer. A task activation interrupt is generated in the CPU (7a) by generating a task activation request signal to the CPU (7a) (step 28). The CPU (7a) executes task activation interrupt processing (step 11), and in the task activation interrupt processing that starts the OS task activation interrupt processing (steps 31 to 33), it checks the contents of the task status register and turns on bit 1. Step 31) Clear the task status register. Step 32) Find the execution start address of task 1 from the task start address register.

cb−分岐する(ステップ33)。対象タスクへの分岐
処理(ステップ33)の実行によってタスク1処理(1
)(ステップ12)が実行され9次にタスク3の起動要
求を発行したとする(ステップ13)。タスク1が起動
されたのと同じ手順(ステップ23〜ステ。
cb-Branch (step 33). Task 1 processing (1
) (Step 12) is executed, and then a request to start task 3 is issued (Step 13). The same procedure as when task 1 was activated (steps 23 to 3).

プ27)でCP U (7b)にタスク起動割り込みが
発生する(ステップ28)。CP U (7b)への割
り込み起動後、タスク起動要求処理が発行された次の位
置(ステップ14)に制御が移る(ステップ30)。 
CPU(7a)ではタスク1処理(2)(ステップ14
)を実行した後、タスク2起動要求処理(ステップ15
)を実行しタスク2を起動する。この時点ではCP U
 (7a)とCP U (7b)が使用中であることか
らタスク起動要求処理(ステップ23〜ステツプ28)
ニよっテcP U (7c)に割り込みが発行されタス
ク1終了処理(ステップ16)に戻る。CP IJ (
7a)によって実行されたタスクはO3のタスク終了処
理(ステップ34〜ステツプ39)でタスク待ち行列バ
ッファ(5)の待ちタスクの有無を判定(ステップ34
)、この場合は待ちタスクがないこと(ステップ35)
、及びタスク/CPU対応バッファ(6)のタスクlに
登録されているCPUがCPU(7a)であることから
、CPUビジーフラグレジスタのビットIをクリアしく
ステップ3g)、  CP U (7a)を停止する(
ステップ39)。もし、タスク待ち行列バッファ(5)
に処理待ちタスクがある場合はタスク待ち行列バッファ
(5)から待ちタスクを取り出しくステップ36)、対
応するタスクの先端アドレスをタスク先頭アドレスレジ
スタ(2a〜2n)の中から取り出し対象タスクへ分岐
する。その際、タスク/CPU対応バッファ(6)の対
応CPUの実行タスクを対応する番号に設定する。一方
、CPU(7b)はタスク起動割り込み発生処理(ステ
ップ28)によって割り込みが発生り、O5のタスク割
り込み処理を起動しくステップ17)、タスク3を実行
しくステップ18)、タスク3終了処理(ステップ19
)によってCP U (7b)(7)処FIを終了させ
る。同様にCP U (7c)ではO3のタスク起動割
り込み処理を起動しくステップ2o)、タスク2を実行
しくステップ21)、タスク2終了処理(ステップ22
)によってCP U (7c)の実行を終了させる。
At step 27), a task activation interrupt is generated in the CPU (7b) (step 28). After the interrupt activation to the CPU (7b), control is transferred to the next position (step 14) where the task activation request process was issued (step 30).
The CPU (7a) performs task 1 processing (2) (step 14).
), task 2 activation request processing (step 15) is executed.
) to start task 2. At this point, the CPU
Since (7a) and CPU (7b) are in use, task activation request processing (steps 23 to 28)
An interrupt is issued to cPU (7c) and the process returns to task 1 termination processing (step 16). CP IJ (
The task executed in step 7a) determines whether there is a task waiting in the task queue buffer (5) in the task end processing of O3 (steps 34 to 39) (step 34).
), in this case there are no waiting tasks (step 35)
, and since the CPU registered in task l of task/CPU correspondence buffer (6) is CPU (7a), clear bit I of the CPU busy flag register (step 3g) and stop CPU (7a). do(
Step 39). If task queue buffer (5)
If there is a task waiting to be processed, step 36) takes out the waiting task from the task queue buffer (5), takes out the start address of the corresponding task from the task start address register (2a to 2n), and branches to the target task. . At this time, the execution task of the corresponding CPU in the task/CPU correspondence buffer (6) is set to the corresponding number. On the other hand, the CPU (7b) generates an interrupt by the task activation interrupt generation process (step 28), starts the task interrupt process of O5 (step 17), executes task 3 (step 18), and executes task 3 (step 19).
) terminates the CPU (7b) (7) processing FI. Similarly, the CPU (7c) executes task start interrupt processing of O3 (step 2o), executes task 2 (step 21), and task 2 termination processing (step 22).
) terminates the execution of CPU (7c).

[発明の効果] この様に本発明によれば組み込み計算機に格納されてい
る複数のタスクを並行して同時に実行することが出来る
。また、同時に実行するタスクの数がCPUの数より多
い場合でもタスク待ち行列バッファ内に待ちタスクを登
録することが出来ることから、CPU0数を任意に変更
できる。
[Effects of the Invention] As described above, according to the present invention, a plurality of tasks stored in an embedded computer can be simultaneously executed in parallel. Furthermore, even if the number of tasks to be executed simultaneously is greater than the number of CPUs, waiting tasks can be registered in the task queue buffer, so the number of CPU0 can be changed arbitrarily.

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

第1図はこの発明の一実施例を示す全体構成図ドレス設
定装置、 (2a)〜(2n)はタスク先頭アドレスレ
ジスタ、 (3)はタスクステータスレジスタ、 (4
)はCPUビジーフラグレジスタ、(5)はタスク待ち
行列バッファ、(6)はタスク/CPU応対バッファ(
7a)〜(7m)はCPU、(8)は主メモiハ(9)
は割り込み制御装置である。
FIG. 1 is an overall configuration diagram showing an embodiment of the present invention. (2a) to (2n) are task start address registers, (3) are task status registers, (4)
) is the CPU busy flag register, (5) is the task queue buffer, and (6) is the task/CPU response buffer (
7a) to (7m) are CPU, (8) is main memory i (9)
is an interrupt controller.

Claims (2)

【特許請求の範囲】[Claims] (1)タスクの起動要求をタスクステータスレジスタか
ら入力し、CPUビジーフラグレジスタの内容から空き
CPUを探し、空きCPUがあるときに割り込み制御装
置によって対応CPUに割り込みをかけてCPUを活性
化、活性化されたCPUに於いてタスク先頭アドレスレ
ジスタに格納されている対応タスクの先頭アドレスを入
力し主メモリに格納されている対応タスクを実行させる
ことにより、複数のCPUが存在する組み込み計算機シ
ステムに於いて複数のタスクを実行することを可能にし
たことを特徴とするプログラム並列実行方法。
(1) Input a task activation request from the task status register, search for a free CPU from the contents of the CPU busy flag register, and when there is a free CPU, use the interrupt control device to interrupt the corresponding CPU to activate the CPU. In an embedded computer system where multiple CPUs exist, by inputting the start address of the corresponding task stored in the task start address register in the integrated CPU and executing the corresponding task stored in the main memory. A program parallel execution method characterized by making it possible to execute multiple tasks.
(2)タスクの先頭アドレスを格納しておくタスク先頭
アドレスレジスタと、タスクの起動要求を格納しておく
タスクステータスレジスタと、CPUの使用状況を格納
しておくCPUビジーフラグレジスタと、凡てのCPU
が使用中のときに起動要求タスクを一時的に登録するタ
スク待ち行列バッファと、使用しているCPUの実行中
のタスク情報を格納しておくタスク/CPU対応バッフ
ァと、各種プログラムを実行するCPUと、各種プログ
ラムを格納しておく主メモリと、タスク実行時に割り込
みを発生する割り込み制御装置を備えたことを特徴とす
るプログラム並列実行装置。
(2) A task start address register that stores the start address of a task, a task status register that stores task activation requests, a CPU busy flag register that stores the CPU usage status, and all CPU
A task queue buffer that temporarily registers startup request tasks when the CPU is in use, a task/CPU correspondence buffer that stores information about tasks being executed by the CPU being used, and a CPU that executes various programs. A program parallel execution device comprising: a main memory for storing various programs; and an interrupt control device that generates an interrupt when a task is executed.
JP5688190A 1990-03-08 1990-03-08 Method and device for parallelly processing program Pending JPH03257634A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5688190A JPH03257634A (en) 1990-03-08 1990-03-08 Method and device for parallelly processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5688190A JPH03257634A (en) 1990-03-08 1990-03-08 Method and device for parallelly processing program

Publications (1)

Publication Number Publication Date
JPH03257634A true JPH03257634A (en) 1991-11-18

Family

ID=13039760

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5688190A Pending JPH03257634A (en) 1990-03-08 1990-03-08 Method and device for parallelly processing program

Country Status (1)

Country Link
JP (1) JPH03257634A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7644214B2 (en) 2005-05-12 2010-01-05 Sony Computer Entertainment Inc. Information processing apparatus and task execution method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7644214B2 (en) 2005-05-12 2010-01-05 Sony Computer Entertainment Inc. Information processing apparatus and task execution method

Similar Documents

Publication Publication Date Title
CN105579961B (en) Data processing system, operating method and hardware unit for data processing system
US5706514A (en) Distributed execution of mode mismatched commands in multiprocessor computer systems
US7996843B2 (en) Symmetric multi-processor system
KR970016979A (en) Queuing system and method of tasks in a multiprocessing system
JPS5841538B2 (en) Multiprocessor system instructions
US7103631B1 (en) Symmetric multi-processor system
US7844782B2 (en) Data processing system with memory access
JPH0916409A (en) Microcomputer
JPH03257634A (en) Method and device for parallelly processing program
JP3006676B2 (en) Multiprocessor
CN113439260A (en) I/O completion polling for low latency storage devices
JPS603229B2 (en) Information processing method
Takada et al. Inter-and intra-processor synchronizations in multiprocessor real-time kernel
JP2553526B2 (en) Multitasking processor
JPH06324861A (en) System and method for controlling cpu
JP2003005987A (en) Emulation device
JP3022398B2 (en) Virtual computer system
JP2594557B2 (en) Multitask processing unit
JPH08297585A (en) Data transfer method by operating system
US20030225817A1 (en) Concurrent execution of kernel work and non-kernel work in operating systems with single-threaded kernel
WO1992003783A1 (en) Method of implementing kernel functions
JPH0444131A (en) Device and method for execution of inter-processor communication in plural os running systems
JPH10507548A (en) Data processing systems and methods and communication systems with such systems
JP2872042B2 (en) Shared memory access method
JPS63826B2 (en)