JP2576659B2 - Task common area allocation method - Google Patents

Task common area allocation method

Info

Publication number
JP2576659B2
JP2576659B2 JP4013290A JP4013290A JP2576659B2 JP 2576659 B2 JP2576659 B2 JP 2576659B2 JP 4013290 A JP4013290 A JP 4013290A JP 4013290 A JP4013290 A JP 4013290A JP 2576659 B2 JP2576659 B2 JP 2576659B2
Authority
JP
Japan
Prior art keywords
task
common area
program
address
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.)
Expired - Fee Related
Application number
JP4013290A
Other languages
Japanese (ja)
Other versions
JPH03241431A (en
Inventor
曉一 安部
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.)
NEC Corp
Original Assignee
Nippon Electric 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 Nippon Electric Co Ltd filed Critical Nippon Electric Co Ltd
Priority to JP4013290A priority Critical patent/JP2576659B2/en
Publication of JPH03241431A publication Critical patent/JPH03241431A/en
Application granted granted Critical
Publication of JP2576659B2 publication Critical patent/JP2576659B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Multi Processors (AREA)
  • Devices For Executing Special Programs (AREA)

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はタスク内共通領域の割当て方式に関し、特に
複数個のプロセッサ上で各々のタスクを並列に実行する
計算機システムに対するタスク内共通領域の割当て方式
に関する。
Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for allocating a common area in a task, and more particularly to allocating a common area in a task to a computer system that executes each task in parallel on a plurality of processors. About the method.

〔従来の技術〕[Conventional technology]

従来のタスク内共通領域の割当て方式は、タスク間で
は共通領域としたくはないが、タスク内のサブルーチン
間では共通領域として参照したいデータ領域を割当てる
場合に、そのプログラムの静的リンク時に操作者がタス
クの構造やタスク数を考えて割当ててしまうか、タスク
の生成時に動的に割当ててダイナミックリンカ等によ
り、そのアドレスの参照を解決させるかどちらかの方法
を用いている。
In the conventional method of allocating a common area in a task, the operator does not want to use a common area between tasks, but assigns a data area to be referred to as a common area between subroutines within a task. Either the task is assigned in consideration of the structure of the task or the number of tasks, or the task is dynamically assigned at the time of task generation and the address reference is resolved by a dynamic linker or the like.

〔発明が解決しようとする課題〕[Problems to be solved by the invention]

上述した従来のタスク内共通領域の割当て方式は、プ
ログラムのリンク時にタスクの構造やタスク数を考えて
割当てる前者の方法では、プログラムが処理するデータ
の数や条件によって、実行時に動的に生成するタスクの
数等を変えることが困難であり、実際に使用するタスク
数がリンク時に指定したものより小さい場合には、無駄
な領域を専有してしまうという欠点を有している。
In the above-described conventional method of allocating a common area in a task, in the former method of allocating a task in consideration of the structure and the number of tasks at the time of linking a program, the area is dynamically generated at the time of execution according to the number and conditions of data processed by the program. It is difficult to change the number of tasks and the like, and when the number of tasks actually used is smaller than that specified at the time of linking, there is a disadvantage that a useless area is occupied.

また、プログラムの実行時に動的に割当てる後者の方
法では、ダイナミックリンカ等によって、動的に割当て
た領域に対するアドレスの参照を解決させる必要があ
り、そのオーバーヘッドが大きくなるという欠点を有し
ている。
Further, the latter method of dynamically allocating at the time of program execution requires the use of a dynamic linker or the like to resolve address references to dynamically allocated areas, which has the disadvantage of increasing overhead.

〔課題を解決するための手段〕[Means for solving the problem]

本発明のタスク内共通領域の割当て方式は、一つのプ
ログラムを複数個のタスクに分割し、複数個のプロセッ
サ上で各々のタスクを並列に実行する計算機システムに
対するタスク内共通領域の割当て方式において、 ソースプログラムから並列処理が可能な目的プログラ
ムを生成する並列化部を持つコンパイラと、前記目的プ
ログラムを結合して並列処理が可能な実行時プログラム
を生成するリンカと、前記実行時プログラムの実行を制
御することにより前記実行時プログラムをタスクごとに
分割して並列に実行させるタスク制御手段とを備えると
ともに、 前記コンパイラの前記並列化部に、一つのタスク内で
使用する各サブルーチンの間でだけ参照される共通領域
であるタスク内共通領域の先頭アドレスを各サブルーチ
ンの実行開始時に得させるために、並列実行中プログラ
ムに含まれるすべてのタスク内共通領域を含む領域であ
る全タスク内共通領域の先頭アドレスと参照したいタス
ク内共通領域の割付け位置である相対アドレスとを加え
る前記目的プログラムを生成するタスク内共通領域アド
レス解決目的プログラム生成手段を含み、 前記リンカに、入力した前記目的プログラム中に含ま
れるすべてのタスク内共通領域をまとめて全タスク内共
通領域を設定して、個々のタスク内共通領域の割付け位
置を全タスス内共通領域の先頭からの相対アドレスとし
て前記実行時プログラム中のアドレス参照箇所に埋め込
むタスク内共通領域アドレス解決手段を含み、 前記タスク制御手段に、全タスク内共通領域のサイズ
分の領域をタスク開始時に確保してその先頭アドレスを
各サブルーチンに渡すタスス内共通領域割当て手段を含
む、 ことにより構成されている。
The method for allocating a common area in a task according to the present invention is a method for allocating a common area in a task to a computer system that divides one program into a plurality of tasks and executes each task in parallel on a plurality of processors. A compiler having a parallelizing unit for generating a target program capable of parallel processing from a source program, a linker for combining the target programs to generate a runtime program capable of parallel processing, and controlling execution of the runtime program Task control means for dividing the run-time program for each task and executing the program in parallel, and the parallelizing section of the compiler refers to only the subroutines used in one task. At the start of execution of each subroutine. The target program to add the start address of the common area in all tasks, which is the area including all the common areas in the tasks included in the program being executed in parallel, and the relative address, which is the allocation position of the common area in the task to be referred to. Including a task common area address solving purpose program generating means for generating a common area within the task, setting all common areas within the task included in the input target program in the linker, and setting a common area within all tasks. An intra-task common area address resolving means for embedding an allocation position of the intra-task common area as an address relative to the beginning of all task common areas in an address reference location in the runtime program; An area equivalent to the size of the common area is secured at the start of the task, and the start address is assigned to each subroutine. Including Tasusu the common region allocating means to pass to Chin, is constituted by.

〔実施例〕〔Example〕

次に、本発明の実施例について図面を参照して説明す
る。
Next, embodiments of the present invention will be described with reference to the drawings.

第1図は本発明のタスク内共通領域の割当て方式の一
実施例を示すブロック図である。
FIG. 1 is a block diagram showing one embodiment of a method of allocating a common area in a task according to the present invention.

第1図に示すように、コンパイラ2は、並列化部21を
持ち、その中にタスク内共通領域アドレス解決目的プロ
グラム生成手段211を含み、リンカ3は、タスク内共通
領域アドレス解決手段31を含み、タスク制御手段4は、
タスク内共通領域割当て手段41を含んでいる。
As shown in FIG. 1, the compiler 2 has a parallelizing unit 21 and includes therein a task common area address solving purpose program generating means 211, and the linker 3 includes a task common area address solving means 31. , The task control means 4
It includes an intra-task common area allocation means 41.

そして、コンパイラ2は、ソースプログラム1を入力
して、並列化部21により、並列処理が可能な目的プログ
ラム6を生成する。
Then, the compiler 2 receives the source program 1 and generates a target program 6 that can be processed in parallel by the parallelizing unit 21.

第2図は本実施例で使用するソースプログラムの一例
を示すプログラム説明図である。また、第3図および第
4図は第2図のソースプログラムから生成される目的プ
ログラムの部分例を示すプログラム説明図である。
FIG. 2 is a program explanatory diagram showing an example of a source program used in this embodiment. FIGS. 3 and 4 are program explanatory diagrams showing a partial example of a target program generated from the source program of FIG.

並列化部21内のタスク内共通領域アドレス解決目的プ
ログラム生成手段211は、ソースプログラム1中の共通
領域の参照部分のうち、例えば第2図ののlocal COMM
ON/A/AA(1000),/B/BB(1000)に示す宣言によって定
められたそのタスク内に含まれるサブルーチン間でだけ
定義/参照が可能な領域を参照する場合に、例えば第2
図ののXX=AA(I)に対して、第3図に示す目的プロ
グラムを生成する。
The in-task common area address solving purpose program generation means 211 in the parallelization unit 21 includes, for example, the local COMM in FIG.
When referring to an area that can be defined / referenced only between subroutines included in the task defined by the declarations shown in ON / A / AA (1000) and / B / BB (1000), for example, the second
The target program shown in FIG. 3 is generated for XX = AA (I) in FIG.

このように、第2図ののlocal COMMON/A/AA(100
0),/B/BB(1000)は、共通領域AおよびBがタスク内
のサブルーチン間でだけ定義/参照が可能な領域である
ことを宣言している例である。
Thus, the local COMMON / A / AA (100
0), / B / BB (1000) is an example of declaring that the common areas A and B are areas that can be defined / referenced only between subroutines within a task.

また、のglobal COMMON/C/CC(100000)は、共通領
域Cがプログラム中の全タスクから定義/参照が可能な
領域であることを宣言している例である。さらに、の
XX=AA(I)は、共通領域A中の要素AA(I)を、の
YY=BB(I)は、共通領域B中の要素BB(I)を、の
ZZ=CC(I)は、共通領域C中の要素CC(I)をそれぞ
れ参照している例である。
The global COMMON / C / CC (100000) is an example in which the common area C is declared as an area that can be defined / referenced from all tasks in the program. In addition,
XX = AA (I) represents the element AA (I) in the common area A as
YY = BB (I) represents the element BB (I) in the common area B as
ZZ = CC (I) is an example in which each element CC (I) in the common area C is referred to.

そして、第3図の命令Sa←relative address(A)
は、全てのタスク内共通領域を集めた領域における共通
領域Aの割当て位置である先頭からの相対アドレスをレ
ジスタSaに格納することを示している。ただし、この割
当ては、リンカ3によりなされるので、コンパイル時点
でこの値を決定することはできない。
Then, the instruction S a ← relative address (A) in FIG.
Shows that storing the relative address from the head is assigned a position in the common area A in the region gathered all tasks in the common area in the register S a. However, since this assignment is made by the linker 3, this value cannot be determined at the time of compilation.

また、第3図の次の命令Saa←Sa+Sbaseは、全てのタ
スク内共通領域を集めた領域の先頭アドレスSbaseとタ
スク内共通領域Aの相対アドレスSaとを加えることによ
って、タスク内共通領域Aの絶対アドレスを求めてレジ
スタSaaに格納することを示している。
Further, the next instruction S aa ← S a + S base in FIG. 3 is obtained by adding the start address S base of the area where all the in-task common areas are collected and the relative address S a of the in-task common area A. This shows that the absolute address of the intra-task common area A is obtained and stored in the register Saa .

なお、先頭アドレスSbaseには、タスクの開始時にタ
スク制御手段4内のタスク内共通領域割当て手段41によ
って、割当てられたタスクごとに固有な領域の先頭アド
レスが格納されている。
Note that the start address S base stores the start address of an area unique to each task assigned by the intra-task common area assignment unit 41 in the task control unit 4 at the start of the task.

さらに、第3図の最後の命令XX←(Saa)は、Saaが増
す領域、すなわちタスク内共通領域Aの先頭要素AA
(I)をXXに格納することを示しており、所望の動的に
割当てられたタスク内共通領域Aの参照が可能となって
いる。
Further, the last instruction XX ← (S aa ) in FIG. 3 is an area where S aa is increased, that is, a head element AA of the common area A in the task.
(I) is stored in XX, and a desired dynamically allocated intra-task common area A can be referenced.

一方、第4図は、タスク間共通領域Cの参照における
目的プログラムの部分例である。第4図の命令Sc←addr
ess(C)は、タスク間共通領域Cのアドレスをレジス
タScに格納する命令を示し、次の命令ZZ←(Sc)は、Sc
の指す領域すなわちタスク間共通領域Cの先頭要素CC
(1)をZZに格納することを示している。
On the other hand, FIG. 4 is a partial example of the target program in referring to the inter-task common area C. The instruction S c ← addr in FIG.
ess (C) shows an instruction for storing an address of the common region C between tasks register S c, the next instruction ZZ ← (S c) is S c
, The head element CC of the inter-task common area C
(1) is stored in ZZ.

また、タスク間共通領域Cは、プログラム中に1個だ
け存在し、リンク時に静的にアドレスが決定されてい
る。
Further, only one inter-task common area C exists in the program, and the address is statically determined at the time of linking.

次に、第1図のリンカ3は、目的プログラム6を入力
して並列処理が可能な実行時プログラム7を生成すると
同時に、タスク内共通領域アドレス解決手段31によって
タスク内の共通領域のアドレスをタスク内の共通領域群
全体中での相対アドレスとして解決して実行時プログラ
ム7中に埋め込んでいる。
Next, the linker 3 shown in FIG. 1 inputs the target program 6 to generate a runtime program 7 which can be processed in parallel, and at the same time, uses the intra-task common area address resolution means 31 to change the address of the common area in the task. And is embedded in the runtime program 7 as a relative address in the entire common area group.

他方、第1図のタスク制御手段4は、実行時プログラ
ム7を入力し、並列実行中プログラム5を実行させてい
る。第1図中のタスクT1,タスクT2は、並列実行中プロ
グラム5中に含まれるタスクを示し、命令コードやタス
ク間共通領域は、並列実行中プログラム5中に1個だけ
存在し、タスクT1,T2間で共有されている。また、タス
ク内共通領域は、タスク内共通領域割当て手段41によっ
て、タスク開始時にタスクごとに割当てられ、その先頭
アドレスがそのタスク内に含まれる各サブルーチンに渡
されている。
On the other hand, the task control means 4 in FIG. 1 inputs the runtime program 7 and executes the parallel execution program 5. Tasks T1 and T2 in FIG. 1 indicate tasks included in the program 5 during parallel execution, and there is only one instruction code and an inter-task common area in the program 5 during parallel execution. Shared between T2. The intra-task common area is allocated by the intra-task common area allocating means 41 for each task at the start of the task, and the start address is passed to each subroutine included in the task.

そこで、各サブルーチンは、第3図に示すような命令
列を実行することにより、所望のデータを得ることがで
きる。
Thus, each subroutine can obtain desired data by executing an instruction sequence as shown in FIG.

第5図は第2図のソースプログラムに対するタスク間
/タスク内共通領域の割当ての一例を示す領域説明図で
ある。
FIG. 5 is an explanatory diagram of an area showing an example of assignment of an inter-task / intra-task common area to the source program of FIG.

第5図に示すように、タスク内共通領域A,Bは、各タ
スクごとに存在し、タスク間共通領域Cは、プログラム
中に1個だけ存在して各タスク間で共有されている。
As shown in FIG. 5, the intra-task common areas A and B exist for each task, and only one inter-task common area C exists in the program and is shared between the tasks.

〔発明の効果〕〔The invention's effect〕

以上説明したように、本発明のタスク内共通領域の割
当て方式は、あるタスクに含まれるサブルーチン間でだ
け共通に定義/参照したい領域を各タスクの開始時に一
括して割当て、ダイナミックリンカ等の介在なしにアド
レスの参照に対する解決を行うことにより、タスクの構
造やタスク数を意識することなく、動的にタスク内共通
領域を割当てることが可能になり、そのアドレスの参照
に対する解決も低オーバーヘッドで行うことができると
いう効果を有している。
As described above, according to the method of allocating a common area in a task according to the present invention, areas to be commonly defined / referenced only among subroutines included in a certain task are collectively allocated at the start of each task, and a dynamic linker or the like is used. By resolving an address reference without a task, it becomes possible to dynamically allocate a common area in a task without being aware of the task structure and the number of tasks, and to resolve the address reference with low overhead. It has the effect that it can be done.

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

第1図は本発明のタスク内共通領域の割当て方式の一実
施例を示すブロック図、第2図は本実施例で使用できる
ソースプログラムの一例を示すプログラム説明図、第3
図および第4図は第2図のソースプログラムから生成さ
れる目的プログラムの部分例を示すプログラム説明図、
第5図は第2図のソースプログラムに対するタスク間/
タスク内共通領域の割当ての一例を示す領域説明図であ
る。 1……ソースプログラム、2……コンパイラ、21……並
列化部、211……タスク内共通領域アドレス解決目的プ
ログラム生成手段、3……リンカ、31……タスク内共通
領域アドレス解決手段、4……タスク制御手段、41……
タスク内共通領域割当て手段、5……並列実行中プログ
ラム、6……目的プログラム、7……実行時プログラ
ム。
FIG. 1 is a block diagram showing an embodiment of a method of allocating a common area in a task according to the present invention, FIG. 2 is a program explanatory diagram showing an example of a source program usable in this embodiment, and FIG.
FIG. 4 is a program explanatory diagram showing a partial example of a target program generated from the source program of FIG. 2,
FIG. 5 shows the tasks / tasks for the source program of FIG.
FIG. 9 is an explanatory diagram of an area showing an example of assignment of a common area in a task. 1 ... source program, 2 ... compiler, 21 ... parallelizing section, 211 ... task internal area address solving purpose program generating means, 3 ... linker, 31 ... task internal area address solving means, 4 ... … Task control means, 41 ……
Task common area allocating means, 5... Parallel execution program, 6... Target program, 7.

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】一つのプログラムを複数個のタスクに分割
し、複数個のプロセッサ上で各々のタスクを並列に実行
する計算機システムに対するタスク内共通領域の割当て
方式において、 ソースプログラムから並列処理が可能な目的プログラム
を生成する並列化部を持つコンパイラと、前記目的プロ
グラムを結合して並列処理が可能な実行時プログラムを
生成するリンカと、前記実行時プログラムの実行を制御
することにより前記実行時プログラムをタスクごとに分
割して並列に実行させるタスク制御手段とを備えるとと
もに、 前記コンパイラの前記並列化部に、一つのタスク内で使
用する各サブルーチンの間でだけ参照される共通領域で
あるタスク内共通領域の先頭アドレスを各サブルーチン
の実行開始時に得させるために、並列実行中プログラム
に含まれるすべてのタスク内共通領域を含む領域である
全タスク内共通領域の先頭アドレスと参照したいタスク
内共通領域の割付け位置である相対アドレスとを加える
前記目的プログラムを生成するタスク内共通領域アドレ
ス解決目的プログラム生成手段を含み、 前記リンカに、入力した前記目的プログラム中に含まれ
るすべてのタスク内共通領域をまとめて全タスク内共通
領域を設定して、個々のタスク内共通領域の割付け位置
を全タスク内共通領域の先頭からの相対アドレスとして
前記実行時プログラム中のアドレス参照箇所に埋め込む
タスク内共通領域アドレス解決手段を含み、 前記タスク制御手段に、全タスク内共通領域のサイズ分
の領域をタスク開始時に確保してその先頭アドレスを各
サブルーチンに渡すタスク内共通領域割当て手段を含
む、 ことを特徴とするタスク内共通領域の割当て方式。
In a method for allocating a common area in a task to a computer system which divides one program into a plurality of tasks and executes each task in parallel on a plurality of processors, parallel processing is possible from a source program. A compiler having a parallelizing unit for generating a target program, a linker for generating a runtime program capable of performing parallel processing by combining the target programs, and a runtime program for controlling execution of the runtime program. And a task control unit that divides each task into tasks and executes the tasks in parallel. The task is a common area that is referred to only among subroutines used in one task by the parallelizing unit of the compiler. In order to obtain the start address of the common area at the start of execution of each subroutine, The common area in the task for generating the target program, which adds the start address of the common area in the task, which is an area including the common area in the task included in the RAM, and the relative address, which is the allocation position of the common area in the task to be referenced An address resolution purpose program generating means, wherein the linker collectively sets all the task common areas included in the input target program and sets a common area within all tasks, and allocates the common area within each task And a task common area address resolving means which embeds in the address reference location in the run-time program as a relative address from the beginning of the common area in all tasks. Area within the task that secures the start address of the task and passes the start address to each subroutine Against comprising means, tasks in the common area of the assignment scheme, characterized in that.
JP4013290A 1990-02-20 1990-02-20 Task common area allocation method Expired - Fee Related JP2576659B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4013290A JP2576659B2 (en) 1990-02-20 1990-02-20 Task common area allocation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4013290A JP2576659B2 (en) 1990-02-20 1990-02-20 Task common area allocation method

Publications (2)

Publication Number Publication Date
JPH03241431A JPH03241431A (en) 1991-10-28
JP2576659B2 true JP2576659B2 (en) 1997-01-29

Family

ID=12572280

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4013290A Expired - Fee Related JP2576659B2 (en) 1990-02-20 1990-02-20 Task common area allocation method

Country Status (1)

Country Link
JP (1) JP2576659B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6134708A (en) * 1997-02-13 2000-10-17 Nec Corporation Program compilation execution system
GB0911099D0 (en) * 2009-06-26 2009-08-12 Codeplay Software Ltd Processing method

Also Published As

Publication number Publication date
JPH03241431A (en) 1991-10-28

Similar Documents

Publication Publication Date Title
US5345588A (en) Thread private memory storage of multi-thread digital data processors using access descriptors for uniquely identifying copies of data created on an as-needed basis
US20100229161A1 (en) Compile method and compiler
JPH01154267A (en) Incorporating system for input/output device control program of operating system
JP2008529119A (en) Multithreaded processor
JP2004220583A (en) Method and system for executing global processor resource assignment in assembler
Norris et al. An experimental study of several cooperative register allocation and instruction scheduling strategies
JP2576659B2 (en) Task common area allocation method
JPH09502558A (en) Method and system for protecting shared code and data in a multitasking operating system
US6134708A (en) Program compilation execution system
JP2005129001A (en) Apparatus and method for program execution, and microprocessor
JP2000315163A (en) Method and system for equally distributing processor resource
JP2560491B2 (en) Parallelized procedure execution method
JP3016359B2 (en) Processor allocation device, processor allocation method, and medium storing processor allocation program in multiprocessor system
JP3083575B2 (en) Multitask control method and control device
JPH0754511B2 (en) Vectorization processing method
Burns et al. Support for multiprocessor platforms
JP2001184320A (en) Distributed executing device and recording medium
JPH0240721A (en) Parallel compiling system
JPH05189245A (en) Resource allocation device
JPH05324281A (en) Method for changing address assignment
Tousimojarad et al. Efficient Parallel Linked List Processing
JP2682215B2 (en) Procedure call method during parallel processing
JPH01280833A (en) Allocation system for common block
JP2004078617A (en) Parallel processing method for application
JP2633382B2 (en) Multi-register file system

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees