JPH0944460A - Barrier synchronization processing method - Google Patents
Barrier synchronization processing methodInfo
- Publication number
- JPH0944460A JPH0944460A JP19174295A JP19174295A JPH0944460A JP H0944460 A JPH0944460 A JP H0944460A JP 19174295 A JP19174295 A JP 19174295A JP 19174295 A JP19174295 A JP 19174295A JP H0944460 A JPH0944460 A JP H0944460A
- Authority
- JP
- Japan
- Prior art keywords
- bit
- register
- local
- local register
- bits
- 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
Links
Landscapes
- Multi Processors (AREA)
Abstract
Description
【0001】[0001]
【発明の属する技術分野】本発明は、計算機システム特
にマルチプロセッサシステムにおけるバリア同期処理方
法に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a barrier synchronization processing method in a computer system, particularly a multiprocessor system.
【0002】[0002]
【従来の技術】従来のマルチプロセッサシステムにおけ
るバリア同期処理方法では、Test And Set 命令を利用
していた。Test And Set命令(以降、TS命令と記す)
とは、自プロセッサのローカルレジスタの値と共有レジ
スタの値を交換する命令で、共有レジスタの最上位ビッ
トがオンの場合には、共有レジスタの値のローカルレジ
スタへのコピーのみを行う。この命令を使用することに
よって、共有レジスタのロックおよび変更を行う。2. Description of the Related Art A conventional barrier synchronization processing method in a multiprocessor system utilizes a Test And Set instruction. Test And Set command (hereinafter referred to as TS command)
Is an instruction for exchanging the value of the local register of the self processor with the value of the shared register. When the most significant bit of the shared register is ON, the value of the shared register is only copied to the local register. This instruction is used to lock and modify shared registers.
【0003】図1はマルチプロセッサシステムのシステ
ム構成図、図4は共有レジスタおよびローカルレジスタ
の各ビットの意味付けを説明した図、図5は従来のバリ
ア同期処理の処理フロー図である。FIG. 1 is a system configuration diagram of a multiprocessor system, FIG. 4 is a diagram explaining the meaning of each bit of a shared register and a local register, and FIG. 5 is a processing flow chart of a conventional barrier synchronization processing.
【0004】まず、それぞれのプロセッサ(以降PEと
記す)がロックを示すビット0をオンにした状態でスタ
ートする(ステップ4.1)。PE1がTS命令を発行
し、共有レジスタとの値の交換を行う(ステップ4.
2)。コピーされた値のロックビットのビット0がオフ
なので、ロックがPE1に与えられる(ステップ4.
3)。PE1が自PEのビットであるビット1をオンに
して共有レジスタへ書き込みを行う(ステップ4.
4)。ここでの書き込みには既にロックを得ているの
で、通常の命令を使用して強制的に書き込む。次にPE
2がTS命令を発行して共有レジスタとの値の交換を行
う(ステップ4.5)。コピーされた値のロックビット
のビット0がオフなので、ロックがPE2に与えられる
(ステップ4.6)。PE2が自PEのビットであるビ
ット2をオンにして共有レジスタへ書き込みを行う(ス
テップ4.7)。これで、共有レジスタ内のビットが全
てオンになるので、バリア動機が成立する(ステップ
4.8)。First, each processor (hereinafter referred to as PE) starts with bit 0 indicating lock being turned on (step 4.1). PE1 issues a TS instruction to exchange values with the shared register (step 4.
2). A lock is given to PE1 since bit 0 of the lock bit of the copied value is off (step 4.
3). PE1 turns on bit 1 of its own PE to write to the shared register (step 4.
4). Since the lock has already been acquired for writing here, it is forcibly written using a normal instruction. Then PE
2 issues a TS instruction to exchange values with the shared register (step 4.5). A lock is given to PE2 because bit 0 of the lock bit in the copied value is off (step 4.6). PE2 turns on bit 2 which is the bit of its own PE, and writes to the shared register (step 4.7). This turns on all the bits in the shared register, thus establishing the barrier motive (step 4.8).
【0005】[0005]
【発明が解決しようとする課題】上述した従来のバリア
同期処理方法では、ロックを使用してバリア同期処理を
行うため、ロックが解除されるまでの他のプロセッサが
全て待たされてバリア同期の処理に時間がかかるという
欠点があり、特にプロセッサ台数が多い場合に処理時間
の増加が顕著であり、マルチプロセッサの性能が低下す
るという問題がある。In the above-mentioned conventional barrier synchronization processing method, since the barrier synchronization processing is performed by using the lock, all the other processors wait until the lock is released and the barrier synchronization processing is performed. However, there is a problem that the processing time increases remarkably when the number of processors is large, and the performance of the multiprocessor deteriorates.
【0006】[0006]
【課題を解決するための手段】本発明は、n個(nは2
以上の整数)のプロセッサと共有レジスタから構成され
前記プロセッサには各々ローカルレジスタを有するマル
チプロセッサシステムにおけるバリア同期処理方法にお
いて、ビット0はロックビット、ビット1からビットn
までの各ビットは各々前記n個のプロセッサの1つに対
応するビット構成を有する前記共有レジスタと前記ロー
カルレジスタを予め用意し、各々の前記プロセッサが、
自プロセッサの前記ローカルレジスタの自プロセッサ対
応のビットをオンにし(ステップ2.2)、次に、TS
(Test&Set)命令で前記ローカルレジスタの情
報と前記共有レジスタの情報を交換し(ステップ2.
3)、次に、前記交換により前記ローカルレジスタに得
た前記情報における全プロセッサのビットがオンかチェ
ックし(ステップ2.4)、前記全プロセッサのビット
が全てオンであればバリア同期終了とみなし、前記全プ
ロセッサのビットにおける1つのビットでもオンでなけ
れば前記ローカルレジスタにおける自プロセッサのビッ
ト以外のビットがすべてオンかチェックし(ステップ
2.5)、前記ステップ2.5におけるチェック結果す
べてオンでなければ前記ローカルレジスタの前記自プロ
セッサのビットをオンにし(ステップ2.6)た後、前
記ステップ2.3に戻り、前記ステップ2.5における
チェック結果すべてオンであれば前記ローカルレジスタ
の前記ビット0をオンにして前記TS命令で前記ローカ
ルレジスタの情報と前記共有レジスタの情報を交換する
(ステップ2.7)ことを特徴とする。According to the present invention, n (n is 2)
In the barrier synchronization processing method in the multiprocessor system in which the processors each having the above integer) and the shared register and each processor has a local register, bit 0 is a lock bit and bit 1 to bit n.
Each of the bits up to is prepared in advance with the shared register and the local register having a bit configuration corresponding to one of the n processors, and each processor has
The bit corresponding to the local processor of the local register of the local processor is turned on (step 2.2), and then TS
The information of the local register and the information of the shared register are exchanged by a (Test & Set) instruction (step 2.
3) Next, it is checked whether the bits of all the processors in the information obtained in the local register by the exchange are on (step 2.4), and if all the bits of all the processors are on, it is considered that the barrier synchronization has ended. If even one of the bits of all the processors is not on, it is checked whether all the bits other than the bit of the local processor in the local register are on (step 2.5), and all the check results in step 2.5 are on. Otherwise, after turning on the bit of the local processor of the local register (step 2.6), the process returns to step 2.3, and if all the check results in step 2.5 are on, the bit of the local register is turned on. When 0 is turned on, the information of the local register is Exchanging information of the serial shared register (step 2.7) to be characterized.
【0007】[0007]
【発明の実施の形態】次に、本発明について図面を参照
して説明する。Next, the present invention will be described with reference to the drawings.
【0008】図1は本発明のバリア同期処理方法が実施
されるシステム構成図であり、図2は本発明の一実施例
を示すバリア同期処理フロー図、図3は本発明のバリア
同期処理による動作説明図である。FIG. 1 is a system configuration diagram for implementing the barrier synchronization processing method of the present invention, FIG. 2 is a flow chart of a barrier synchronization processing showing an embodiment of the present invention, and FIG. 3 is a block diagram of the barrier synchronization processing of the present invention. FIG.
【0009】以下の例では、2プロセッサの場合につい
て説明するが、3プロセッサ以上の場合についても同様
である。In the following example, the case of two processors will be described, but the same applies to the case of three or more processors.
【0010】本発明においても、ローカルレジスタと共
有レジスタの値を交換する命令としてTS(Test And
Set )命令を使用する。即ち、共有レジスタの最上位ビ
ットがオフならば、TS命令は単純な交換命令として動
作する。Also in the present invention, TS (Test And) is used as an instruction for exchanging the values of the local register and the shared register.
Set) instruction. That is, if the most significant bit of the shared register is off, the TS instruction operates as a simple exchange instruction.
【0011】図2を参照すると、各々のPEは、自PE
のローカルレジスタの自PEのビットをオンにする(ス
テップ2.2)。次に、TS命令でローカルレジスタの
値と共有レジスタの値を交換する(ステップ2.3)。
次に、交換によりローカルレジスタに得た値の全PEの
ビットがオンかチェックする(ステップ2.4)。全て
がオンであればバリア同期終了とみなしバリア終了とな
る(ステップ2.8)。全てのビットがオンでなけれ
ば、ローカルレジスタの自PEのビット以外のビットが
すべてオンかチェックする(ステップ2.5)。ステッ
プ2.5がnoであれば、ローカルレジスタの自PEの
ビットをオンにし(ステップ2.6)、ステップ2.3
に戻る。ステップ2.5でyesであれば、ローカルレ
ジスタのビット0をオンにしてTS命令でローカルレジ
スタアの値と共有レジスタの値を交換して(ステップ
2.7)、ステップ2.8に進む。Referring to FIG. 2, each PE is its own PE.
The local PE bit of the local register is turned on (step 2.2). Next, the value of the local register and the value of the shared register are exchanged by the TS instruction (step 2.3).
Next, it is checked whether the bits of all PEs of the value obtained in the local register by the exchange are on (step 2.4). If all are turned on, it is considered that the barrier synchronization has ended, and the barrier ends (step 2.8). If all the bits are not on, it is checked whether all the bits in the local register other than the PE's own bit are on (step 2.5). If step 2.5 is no, the bit of the local PE of the local register is turned on (step 2.6), and step 2.3
Return to If yes in step 2.5, bit 0 of the local register is turned on, the value of the local register and the value of the shared register are exchanged by the TS instruction (step 2.7), and the process proceeds to step 2.8.
【0012】次に、図3を用いて具体例を説明する。ま
ず、それぞれのPE(プロセッサ)が自PE対応のビッ
トをオン(論理1)にした状態からスタートする(ステ
ップ3.1)。PE1がTS命令を発行して(ステップ
3.2)、共有レジスタの値とローカルレジスタの値を
交換する(ステップ3.3)。ここでは、ロックビット
をオンにしてはいないので、共有レジスタのロックはさ
れず、共有レジスタのアクセスはどのPEからでも自由
にできる。次に、PE2がTS命令を発行してローカル
レジスタと共有レジスタの値を交換する(ステップ3.
4)。PE2は、ローカルレジスタにコピーされた値の
自PEのビットをオンにする(ステップ3.6)。ここ
で、全PEのビットがオンになったので、ロックビット
もオンにする(ステップ3.7)。これによって、全ビ
ットがオンになった値が共有レジスタから交換されてし
まうのを防止する。PE2がTS命令を発行して共有レ
ジスタと値を交換する(ステッフ3.8)。これで共有
レジスタのビットが全てオンになったのでバリア同期が
成立する。ロックビットがオンなので、他のPEからの
TS命令の発行にも書換られることがなく、他のPEも
この値を参照してすぐにバリアが成立する。Next, a specific example will be described with reference to FIG. First, each PE (processor) starts from a state in which the bit corresponding to its own PE is turned on (logic 1) (step 3.1). PE1 issues a TS instruction (step 3.2) and exchanges the value of the shared register with the value of the local register (step 3.3). Since the lock bit is not turned on here, the shared register is not locked and the shared register can be accessed freely from any PE. Next, the PE 2 issues a TS instruction to exchange the values of the local register and the shared register (step 3.
4). PE2 turns on the bit of its own PE of the value copied to the local register (step 3.6). Since the bits of all PEs are turned on, the lock bit is also turned on (step 3.7). This prevents the value with all bits turned on from being exchanged from the shared register. PE2 issues a TS instruction to exchange the value with the shared register (step 3.8). Now all the bits of the shared register are turned on, so that barrier synchronization is established. Since the lock bit is on, it is not rewritten even when the TS instruction is issued from another PE, and the other PE also refers to this value and the barrier is established immediately.
【0013】この方法によるTS命令の発行回数は、P
E台数に対して穏かに上昇して、従来技術に比べるとP
E台数が増えれば増えるほど効果が顕著となる。The number of times the TS command is issued by this method is P
It rises moderately with respect to the number of E, and P compared with the conventional technology
The effect becomes more remarkable as the number of E units increases.
【0014】[0014]
【発明の効果】以上説明したように、本発明のバリア同
期処理方法は、ロックを使用しないで共有レジスタとロ
ーカルレジスタの値を交換することを主にバリア同期を
実現するため、各プロセッサが常に共有レジスタを定義
参照でき、プロセッサ台数が増えても高速にバリア同期
が実現できるという効果がある。As described above, the barrier synchronization processing method of the present invention mainly realizes the barrier synchronization by exchanging the values of the shared register and the local register without using the lock, so that each processor always operates. There is an effect that the shared register can be defined and referenced, and barrier synchronization can be realized at high speed even if the number of processors increases.
【図1】バリア同期処理が適用されるシステム構成例を
示す図である。FIG. 1 is a diagram illustrating a system configuration example to which a barrier synchronization process is applied.
【図2】本発明のバリア同期処理の一実施例を示すフロ
ーチャートである。FIG. 2 is a flowchart showing an example of barrier synchronization processing of the present invention.
【図3】本発明の動作を説明するためのフローチャート
である。FIG. 3 is a flowchart for explaining the operation of the present invention.
【図4】共有レジスタの構成を示す図である。FIG. 4 is a diagram showing a configuration of a shared register.
【図5】従来例のバリア同期処理方法の一例を示すフロ
ーチャートである。FIG. 5 is a flowchart showing an example of a conventional barrier synchronization processing method.
1.1,1.4 PE(プロセッサ) 1.3 共有レジスタ 1.2,1.5 ローカルレジスタ ステップ2.1〜ステップ2.7 バリア同期処理フ
ローチャート1.1, 1.4 PE (processor) 1.3 Shared register 1.2, 1.5 Local register Step 2.1 to Step 2.7 Barrier synchronization processing flowchart
Claims (1)
と共有レジスタから構成され前記プロセッサには各々ロ
ーカルレジスタを有するマルチプロセッサシステムにお
けるバリア同期処理方法において、ビット0はロックビ
ット、ビット1からビットnまでの各ビットは各々前記
n個のプロセッサの1つに対応するビット構成を有する
前記共有レジスタと前記ローカルレジスタを予め用意
し、各々の前記プロセッサが、自プロセッサの前記ロー
カルレジスタの自プロセッサ対応のビットをオンにし
(ステップ2.2)、次に、TS(Test&Set)
命令で前記ローカルレジスタの情報と前記共有レジスタ
の情報を交換し(ステップ2.3)、次に、前記交換に
より前記ローカルレジスタに得た前記情報における全プ
ロセッサのビットがオンかチェックし(ステップ2.
4)、前記全プロセッサのビットが全てオンであればバ
リア同期終了とみなし、前記全プロセッサのビットにお
ける1つのビットでもオンでなければ前記ローカルレジ
スタにおける自プロセッサのビット以外のビットがすべ
てオンかチェックし(ステップ2.5)、前記ステップ
2.5におけるチェック結果すべてオンでなければ前記
ローカルレジスタの前記自プロセッサのビットをオンに
し(ステップ2.6)た後、前記ステップ2.3に戻
り、前記ステップ2.5におけるチェック結果すべてオ
ンであれば前記ローカルレジスタの前記ビット0をオン
にして前記TS命令で前記ローカルレジスタの情報と前
記共有レジスタの情報を交換する(ステップ2.7)こ
とを特徴とするバリア同期処理方法。1. In a barrier synchronization processing method in a multiprocessor system comprising n (n is an integer of 2 or more) processors and shared registers, each processor having a local register, bit 0 is a lock bit, and bit 1 is a lock bit. Each bit from to n is prepared in advance with the shared register and the local register having a bit configuration corresponding to one of the n processors, and each processor has its own local register self-registered. Turn on the bit corresponding to the processor (step 2.2), and then TS (Test & Set)
An instruction exchanges information in the local register and information in the shared register (step 2.3), and then checks whether all processor bits in the information obtained in the local register by the exchange are on (step 2). .
4) If all the bits of all the processors are on, it is considered that the barrier synchronization has ended, and if even one of the bits of all the processors is not on, it is checked whether all the bits other than the bits of the local processor of the local register are on. (Step 2.5), if the check results in step 2.5 are not all on, the bit of the local processor of the local register is turned on (step 2.6), and then the process returns to step 2.3. If all the check results in the step 2.5 are on, the bit 0 of the local register is turned on and the information of the local register and the information of the shared register are exchanged by the TS instruction (step 2.7). A characteristic barrier synchronization processing method.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP19174295A JPH0944460A (en) | 1995-07-27 | 1995-07-27 | Barrier synchronization processing method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP19174295A JPH0944460A (en) | 1995-07-27 | 1995-07-27 | Barrier synchronization processing method |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH0944460A true JPH0944460A (en) | 1997-02-14 |
Family
ID=16279751
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP19174295A Pending JPH0944460A (en) | 1995-07-27 | 1995-07-27 | Barrier synchronization processing method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0944460A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6516403B1 (en) | 1999-04-28 | 2003-02-04 | Nec Corporation | System for synchronizing use of critical sections by multiple processors using the corresponding flag bits in the communication registers and access control register |
| US7398376B2 (en) | 2001-03-23 | 2008-07-08 | International Business Machines Corporation | Instructions for ordering execution in pipelined processes |
-
1995
- 1995-07-27 JP JP19174295A patent/JPH0944460A/en active Pending
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6516403B1 (en) | 1999-04-28 | 2003-02-04 | Nec Corporation | System for synchronizing use of critical sections by multiple processors using the corresponding flag bits in the communication registers and access control register |
| US7398376B2 (en) | 2001-03-23 | 2008-07-08 | International Business Machines Corporation | Instructions for ordering execution in pipelined processes |
| US7844802B2 (en) | 2001-03-23 | 2010-11-30 | International Business Machines Corporation | Instructions for ordering execution in pipelined processes |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP5539432B2 (en) | Vector mask setting technology | |
| JP3218773B2 (en) | Cache controller | |
| KR970011207B1 (en) | Method and apparatus for a register providing atomic access to set and clear individual bits of a shared register without a software interlock | |
| US5781763A (en) | Independent control of DMA and I/O resources for mixed-endian computing systems | |
| CN120653306A (en) | Atomic instruction execution method and device | |
| JPH02234242A (en) | Partial write control system | |
| JP2591502B2 (en) | Information processing system and its bus arbitration system | |
| CN115756767A (en) | Device and method for multi-core CPU atomic operation memory | |
| US6922666B2 (en) | Method and data processing system for performing atomic multiple word reads | |
| JPH0944460A (en) | Barrier synchronization processing method | |
| JPS623347A (en) | Saving system for error recovery information | |
| JPH03656B2 (en) | ||
| JP3710798B2 (en) | Compound processing unit | |
| JP3179891B2 (en) | Bus control method | |
| JP2755646B2 (en) | Data driven data processor | |
| JPS6235142B2 (en) | ||
| JP2609685B2 (en) | Reset circuit | |
| JPH086905A (en) | Access arbitration circuit for multiport RAM | |
| JP2573711B2 (en) | Micro subroutine control method | |
| JPH03138749A (en) | Data transfer system by shared memory | |
| JPH03271950A (en) | Memory control system | |
| JPS6149695B2 (en) | ||
| JPS6027977A (en) | parallel processing device | |
| JPH0478931A (en) | Designated word interruption generating system | |
| JPS61250748A (en) | Memory access system of information processor |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 19981013 |