JPH01129345A - Multi-processor system - Google Patents

Multi-processor system

Info

Publication number
JPH01129345A
JPH01129345A JP62288102A JP28810287A JPH01129345A JP H01129345 A JPH01129345 A JP H01129345A JP 62288102 A JP62288102 A JP 62288102A JP 28810287 A JP28810287 A JP 28810287A JP H01129345 A JPH01129345 A JP H01129345A
Authority
JP
Japan
Prior art keywords
pointer
write
read
control system
shared memory
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
JP62288102A
Other languages
Japanese (ja)
Inventor
Itsuki Hasegawa
長谷川 厳
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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP62288102A priority Critical patent/JPH01129345A/en
Publication of JPH01129345A publication Critical patent/JPH01129345A/en
Pending legal-status Critical Current

Links

Landscapes

  • Memory System (AREA)
  • Multi Processors (AREA)

Abstract

PURPOSE:To cause the processing speed of a control system to be the high speed and to improve processing efficiency by eliminating necessity to prohibit the access of a shared memory with the other control system when the processing is stopped since it is allocated to the processing by other interruption while one control system accesses the shared memory. CONSTITUTION:Data control in a ring buffer in the shared memory is executed only by a read pointer and a write pointer, which are provided in the shared memory. Then, concerning the read pointer, the update of the value of the data is executed only by a read side control system and concerning the write pointer, it is executed only by a write side control system. According to the relation between the values of the read pointer and the write pointer, the presence and absence of the space of the buffer and the presence and absence of the data are known and when there is the space of the buffer, or, when there is reading data, an access is executed to an area which is determined in correspondence to the size relation between the values of the read pointer and the write pointer. Thus, the processing is eliminated to prohibit the access to the shared memory to one control system when the other control system starts the access to the shared memory until the access is ended.

Description

【発明の詳細な説明】 〔発明の目的〕 (産業上の利用分野) 本発明はマルチプロセッサ・システムに係わり、特に共
有メモリのアクセスにおける制御の改良を図ったマルチ
プロセッサ・システムに関するものである。
DETAILED DESCRIPTION OF THE INVENTION [Object of the Invention] (Industrial Field of Application) The present invention relates to a multiprocessor system, and more particularly to a multiprocessor system with improved control over shared memory access.

(従来の技術) プロセッサを利用した複数の独立した制御系において、
共有のメモリを設け、この共有メモリを介して相手の制
御系に情報を授受するようにしたマルチプロセッサ・シ
ステムがある。このようなシステムにおいて、一般に共
有メモリを介する2つ以上の独立な制御系間における情
報授受に関する処理は、情報を受は渡す側の制御系にお
ける上記情報の共有メモリへの書き込み処理と、情報を
受は取る側の制御系における同情報の共有メモリからの
読み出し処理とに分けられる。また、共有メモリにおい
て、授受される情報(データ)は共有メモリ内の有限領
域内に記憶され、同情報の授受に整合を保つべく、この
情報の上記記憶領域内における情報数、記憶領域の空き
領域、次の書き込み処理に対する書き込み箇所を示すポ
インタ(以下、ライトポインタWと称する)或いは次の
読み取り処理に対する読み取り箇所を示すポインタ(以
下、リードポインタRと称する)等、様々な管理データ
により管理するようにしている。
(Prior art) In multiple independent control systems using processors,
There is a multiprocessor system in which a shared memory is provided and information is sent and received to and from a partner control system via this shared memory. In such a system, the processing related to the exchange of information between two or more independent control systems via a shared memory generally involves the processing of writing the above information into the shared memory in the control system on the receiving side, and the processing of writing the information to the shared memory in the control system on the receiving side. The receiving process is divided into the reading process of the same information from the shared memory in the control system on the receiving side. In addition, in the shared memory, the information (data) to be exchanged is stored in a limited area within the shared memory, and in order to maintain consistency in the exchange of the same information, the number of information in the storage area for this information, the free space of the storage area, etc. It is managed using various management data, such as an area, a pointer indicating the write location for the next write process (hereinafter referred to as write pointer W), or a pointer indicating the read location for the next read process (hereinafter referred to as read pointer R). That's what I do.

一方、マルチプロセッサ・システムでは複数の制御系が
互いに独立に動作しているため、そのままではある一つ
の制御系が同共有メモリにアクセス(情報の書き込みや
読み出し操作)を行っている途中において、他の制御系
が同共有メモリをアクセスする事態が生ずるのを避ける
ことが出来ない。例えば、共有メモリの情報がリードポ
インタRとライトポインタWとで管理されているものと
し、今、一つの制御系がある情報を共有メモリヘライト
した後、ライトポインタを更新しようとして、まさに共
有メモリ内のライトポインタWの記憶場所にその更新し
たライトポインタWの値を書き込もうとしている時、他
の読み込み側制御系が同ライトポインタWの値を参照す
べく、同記憶場所へリードアクセスを行うという事態が
生じたとする。このようなリードとライトが同時に実施
されるような事態が生じた時には、状態が不安定となり
、同ライトポインタWの更新値が正しく記憶されず、ま
た、この時点で読み込んだその値も正しい値ではないと
いったことが生じ易く、従って、このような事態が発生
した場合は、以降の共有メモリにおける情報の管理は正
しく行われなくなる。一般に、このような現象を共有メ
モリのメモリ競合と言い、このメモリ競合を避けるため
に、従来より、マスク・スレーブ方式あるいはアクセス
・コントロール方式等の共有メモリ排他方式が採用され
ている。
On the other hand, in a multiprocessor system, multiple control systems operate independently of each other, so while one control system is accessing the same shared memory (writing or reading information), other control systems may It is unavoidable that the control system of two systems accesses the same shared memory. For example, assume that shared memory information is managed by a read pointer R and a write pointer W, and now, after a control system has written certain information to the shared memory, it attempts to update the write pointer and the shared memory When the updated value of the write pointer W is about to be written to the memory location of the write pointer W in the controller, another reading-side control system performs a read access to the same memory location to refer to the value of the write pointer W. Suppose that a situation like this occurs. When such a situation occurs where reading and writing are performed simultaneously, the state becomes unstable, the updated value of the write pointer W is not stored correctly, and the value read at this point is also not the correct value. Therefore, if such a situation occurs, the subsequent management of information in the shared memory will not be performed correctly. Generally, such a phenomenon is called memory contention between shared memories, and in order to avoid this memory contention, shared memory exclusion methods such as a mask slave method or an access control method have conventionally been employed.

ここで、マスク・スレーブ方式とは、複数ノ制御系の一
つをマスクとし、他をスレーブの関係に定め、共有メモ
リのアクセス権は常時マスク側が持ち、スレーブ側のそ
のアクセスはマスクに問合わせを行い、その結果に応じ
て行う方式である。
Here, the mask-slave method refers to one of the multiple control systems as a mask and the others as slaves, and the mask side always has access rights to the shared memory, and the slave side queries the mask for access. This method is based on the results.

従って、この方式によれば、両制御系が同時に同じメモ
リをアクセスすることは防止できる。
Therefore, according to this method, it is possible to prevent both control systems from accessing the same memory at the same time.

また、アクセスコントローラ方式とは、2つの制御系に
主従関係を置かず、そのアクセス権の優位差は持たせな
い方式であり、複数の制御系がほぼ同時に共有メモリの
アクセスを要求した時、要求の早い方に同メモリのアク
セス権を与え、同アクセスが終了した後、要求の遅かっ
た方の制御系にアクセス権が与える方式である。従って
、アクセス要求が遅れた方の制御系はその要求が早かっ
た方のリードまたはライトサイクル終了まで待機させら
れることになる。
In addition, the access controller method is a method that does not establish a master-slave relationship between two control systems and does not give them superiority in access rights.When multiple control systems request shared memory access almost simultaneously, the request In this method, the access right to the same memory is granted to the earlier requester, and after the same access is completed, the access right is granted to the control system that made the request later. Therefore, the control system whose access request is delayed is made to wait until the end of the read or write cycle whose request was earlier.

上記したマスク・スレーブ方式、アクセスコントローラ
方式はここでは詳細を説明しないが、共にハードウェア
により構成され制御されるものであり、これによって、
共有メモリの排他処理を行うことができるものであるが
、これらの方式を用いても、共有メモリにおける情報の
整合性が失われるのを避けることが出来ない。その例を
説明する。一般に、一連の処理の過程において、待ちの
状態を持つ情報について、その待ち状態の管理はリング
バッファ方式によって行われる。以下、最も一般的な手
法である共有メモリにおいてのサイクルチエツク(C/
C)ビットを用いたリングバッファ方式による情報(デ
ータ)の管理について、述べる。ここで、リングバッフ
ァとはデータを記憶する有限のエリアについて、そのエ
リアの先頭と末尾とを繋いだかたちで管理し、末尾まで
行くと先頭に戻ると云った具合に無終端方式で連続して
使用するものである。すなわち、データのライト処理に
おいては、エリアの末尾エリアに書き込んだ後、次の書
き込みは同エリアの先頭エリアに対して行うと言う方式
をとる。データのリードにおいても、同様である。また
、リングバッファにおけるデータのリード−ライトはリ
ードポインタW及びライトポインタR及びサイクルチエ
ツク・ビットとにより、管理される。ライトポインタは
リングバッファにおけるライト可能なエリアを指し、そ
のエリアへデータのライトが行われた後、その値が更新
される。リードポインタはリングバッファにおけるリー
ドすべきデータが記憶されているエリアを指し、データ
がリードされた後、その値が更新される。ここで、サイ
クルチエツク(C/C)  ・ビットとはその値として
「0」と「1」との値をとり、リード処理及びライト処
理において、その値が参照され、あるいは書き込まれる
The mask/slave method and access controller method described above will not be explained in detail here, but they are both configured and controlled by hardware, and as a result,
Although shared memory exclusive processing can be performed, even if these methods are used, loss of consistency of information in the shared memory cannot be avoided. An example will be explained. Generally, in a series of processes, the waiting state of information that is in a waiting state is managed using a ring buffer method. The most common method, cycle check (C/
C) Management of information (data) using a ring buffer method using bits will be described. Here, a ring buffer is a finite area that stores data, and it is managed by connecting the beginning and end of that area, and when it reaches the end, it returns to the beginning, and so on in an endless manner. It is what you use. That is, in the data write process, after writing to the last area of an area, the next write is performed to the first area of the same area. The same applies to reading data. Further, read/write of data in the ring buffer is managed by a read pointer W, a write pointer R, and a cycle check bit. The write pointer points to a writable area in the ring buffer, and its value is updated after data is written to that area. The read pointer points to an area in the ring buffer where data to be read is stored, and its value is updated after the data is read. Here, the cycle check (C/C) bit has values of "0" and "1", and its value is referenced or written in read processing and write processing.

すなわち、サイクルチエツク・ビットは次のような規則
により書き変えられ、また、参照されることにより、リ
ングバッファ内のデータを管理する。
That is, the cycle check bit is rewritten and referenced according to the following rules to manage data in the ring buffer.

まず、リード処理において、データのリードが行われ、
リードポインタを更新するとき、リードポインタがバッ
ファの末尾から先頭に更新される際に、C/Cビットに
は「0」が書き込まれる。
First, in read processing, data is read,
When updating the read pointer, "0" is written to the C/C bit when the read pointer is updated from the end of the buffer to the beginning.

また、ライト処理においてはデータのライトが行われ、
ライトポインタを更新するとき、ライトポインタがバッ
ファの末尾から先頭の値に更新される際に、C/Cビッ
トには「1」が書き込まれる。
Also, in write processing, data is written,
When updating the write pointer, "1" is written to the C/C bit when the write pointer is updated from the end of the buffer to the value at the beginning.

以上のC/Cビットの値と、リードポインタ及びライト
ポインタによりバッファ内の情報は次のように管理され
る。ここで、バッファ内にデータが一つも存在しない状
態をr c/cビット−〇で且つR−W(リードポイン
タとライトポインタの値が等しい)」と定義する。また
、バッファ内がデータで満杯の状態をr c/cビット
−1で且つR−W−0」と与えておく。
Information in the buffer is managed as follows using the above C/C bit value, read pointer, and write pointer. Here, a state in which there is no data in the buffer is defined as rc/c bit-0 and R-W (read pointer and write pointer values are equal). Further, the state in which the buffer is full with data is given as rc/c bit-1 and R-W-0.

C/Cビットを用いたリングバッファの概念を示したも
のが第5図である。この図ではリングバッファの大きさ
としてはポインタ0からポインタM相当分までのM+1
なるエリアを持つものとして示しである。初期値におい
ては、リードポインタ及びライトポインタ及びC/Cビ
ットにはそれぞれ先頭を示すRo及びW。及びc/c 
−0の値が与えられている。これらを利用してのリード
処理側の処理手順は第6図(a)のフローチャートの如
きであり、ライト処理側の処理手順は第6図(b)のフ
ローチャートの如きである。今、初期状態において、例
えばリード処理を実施しようとする制御系がデータをリ
ードすべく同リードポインタ、ライトポインタ及びC/
Cビットを調べた時(sl。
FIG. 5 shows the concept of a ring buffer using C/C bits. In this figure, the size of the ring buffer is M+1 from pointer 0 to pointer M equivalent.
It is shown as having an area of In the initial value, the read pointer, write pointer, and C/C bit each have Ro and W indicating the beginning. and c/c
A value of -0 is given. The processing procedure on the read processing side using these is as shown in the flowchart of FIG. 6(a), and the processing procedure on the write processing side is as shown in the flowchart of FIG. 6(b). Now, in the initial state, for example, a control system that is about to perform a read process uses the same read pointer, write pointer, and C/
When examining the C bit (sl.

S 2) 、R−W−c/e−0であれば、読み出すデ
ータがないと判断し、データリードを行わない。
S2) If it is R-W-c/e-0, it is determined that there is no data to be read, and data reading is not performed.

また、この処理の実行時においてライト処理を行う制御
系がデータをライトすべくリード処理側と同様にリード
、ライトポインタおよびC/Cビットを調べたとすると
(s 11.  s 12) 、R−W、 c/c−〇
であることから、バッファ内に空きエリアがある(デー
タの書き込みが可能である)と判断し、ライトポインタ
Wが指すリングバッファのエリアへデータをライトしく
513)、その後、同ライトポインタを更新する。これ
は、sl4においてライトポインタWの値が最大値WM
に達しているか否かを調べてから等しくない場合はsl
5に入り、Wをインクリメントしてこの値を更新させる
ことにより行い、814において、最大値WMに達して
いるならば、Wを0として同ライトポインタを更新する
( s 1B)。従って、ライト処理側においては、デ
ータ書き込み不可能な状態(R−Wで且っc/c = 
1 )に出会うまで、ライトポインタの指すエリアにデ
ータをライトし、ライトポインタの更新を行うことがで
きる。そして、ライトポインタがWM(エリアの末尾を
示す値)に達しく s 14)、WMからWo (エリ
アの先頭を示す値)に更新される時に(s 1B) 、
c/cビットに「1」の値を書き込む(s 17)。一
方、リード処理はrR−Wで且つc/c−0でない」条
件を満たした時(sl。
Furthermore, when the control system that performs write processing checks the read and write pointers and C/C bits in the same way as the read processing side in order to write data when executing this processing (s 11. s 12), R-W , c/c-〇, it is determined that there is an empty area in the buffer (data can be written), and the data is written to the area of the ring buffer pointed to by the write pointer W (513), and then, Update the same light pointer. This means that the value of the write pointer W in sl4 is the maximum value WM
Check whether it has reached or not, and if it is not equal, sl
5, W is incremented to update this value, and in step 814, if the maximum value WM has been reached, W is set to 0 and the write pointer is updated (s 1B). Therefore, on the write processing side, data cannot be written (R-W and c/c =
Until 1) is encountered, data can be written to the area pointed to by the write pointer and the write pointer can be updated. Then, when the write pointer reaches WM (value indicating the end of the area) (s 14) and is updated from WM to Wo (value indicating the beginning of the area) (s 1B),
Write the value "1" to the c/c bit (s17). On the other hand, when the read processing is rR-W and not c/c-0 (sl.

s2)、リードポインタRの指すエリアからデータの読
み出しを行ってゆ<(s3)。このデータの読み出し毎
にリードポインタの値が最大値R。
s2), data is read from the area pointed to by the read pointer R (s3). Each time this data is read, the value of the read pointer reaches the maximum value R.

に達したか否かを調べつつ(s4)、リードポインタR
をインクリメントして更新してゆくが(s5)、リード
ポインタの値が最大値RMに達すると、RMを先頭値R
8に更新しくs6)、更にc/eビットを「0」にセッ
トする(S7)。
While checking whether the read pointer R has been reached (s4),
is incremented and updated (s5), but when the value of the read pointer reaches the maximum value RM, RM is changed to the leading value R.
8 (s6), and further sets the c/e bit to "0" (S7).

このように、e/cビットを用いたリングバッファにお
いては、リードポインタR1ライトポインタWの値を比
較し、それらが等しい時(wNmRN)、e/cビット
を参照し、e/e −1であればライト不可能とし、そ
れ以外の時はライトポインタの指すエリアへデータをラ
イトできるようにしている。しかし、このようなアクセ
スコントロール方式を適用し、共有メモリのデータをC
/Cビットを用いたリングバッファにより管理している
システムにおいては次のようなデータの整合性が失われ
る場合が生ずることがあり、マルチプロセッサにおける
共有メモリを介しての情報の授受、特に一方の制御系か
ら他方の制御系へ一方向に特定の情報を授受する際には
大きな問題となる。尚、ここではリードポインタ、ライ
トポインタのそれぞれがバッファの最大値を指し、C/
CビットがrOJの時について述べる。
In this way, in a ring buffer using e/c bits, the values of read pointer R1 and write pointer W are compared, and when they are equal (wNmRN), the e/c bits are referenced and e/e -1. If so, writing is disabled, and in other cases, data can be written to the area pointed to by the write pointer. However, by applying such an access control method, data in shared memory can be
In a system managed by a ring buffer using the /C bit, data integrity may be lost as described below. This poses a major problem when specific information is sent and received in one direction from one control system to another. Note that the read pointer and write pointer each point to the maximum value of the buffer, and the C/
The case where the C bit is rOJ will be described.

すなわち、この状態においては、RM−WM。That is, in this state, RM-WM.

c/c−0であるから、バッファにはデータがないこと
を意味している。この状態において、ライト側制御系に
おいてライト処理が起動された場合、ライト処理は第6
図における■→■→■の如くライト処理を実行して行く
。この処理を実行中、ライト側制御において、ライト処
理よりも優先度の高い処理レベルを有するライト処理以
外の処理の割込みがあって、ライト処理を中断してそれ
が実行されたとする。まさにその時点がライト処理フロ
ーにおける符号イの点であったとする。これにより、ラ
イト処理フローがイの時点で中断することになるが、こ
の中断の最中にリード側制御系において、リード処理が
起動されたとすると、この時点でのリード、ライトポイ
ンタ及びC/CビットのそれぞれはR−RM、W−0,
c/c −oであるから、リード処理は■゛−■′を実
行して行けることになる。そして、口の時点まで処理を
行ったとすると、この時点でリード、ライトポインタ及
びc/cビットはそれぞれR−0,W−WM 、 C/
C−〇となり、読み出しが終了することになる。そして
、この時点でライト処理がイの点から再開されたとする
と、ライト処理ではc/eを「1」にセットする処理の
実行に入ることになる。そのため、ライト処理がイの時
点以降の処理の終了時点でのリード、ライトポインタ及
びC/Cビットの状態はR−W−0,c/c−1となる
。先の規則に従えばrR−W−0,c/c −IJはデ
ータが満杯であることを意味しているが、読み取りが終
了しているので、実際にはバッファにはデータは一つも
存在していない。従って、この状況下では書き込みがで
きなくなる。これは、一方の制御系においてリードポイ
ンタまたはライトポインタのいずれか一方を更新し、C
/Cビットを書き変えると云う一連の処理の途中で、他
の制御系の割込みが入ることにより生じる現象である。
Since it is c/c-0, it means that there is no data in the buffer. In this state, if the write process is started in the write side control system, the write process will be started in the 6th control system.
Write processing is executed as shown by ■→■→■ in the figure. Assume that while this process is being executed, there is an interruption of a process other than the write process that has a higher priority level than the write process in the write side control, and the write process is interrupted and executed. Assume that this point is exactly at point A in the write processing flow. As a result, the write processing flow is interrupted at point A, but if read processing is started in the read-side control system during this interruption, the read, write pointer, and C/C Each of the bits is R-RM, W-0,
Since it is c/c -o, the read process can be performed by executing ■゛-■'. If processing is performed up to the start point, at this point the read, write pointer, and c/c bits are R-0, W-WM, and C/, respectively.
The result is C-0, and the reading ends. If the write process is restarted from point A at this point, the write process will start executing the process of setting c/e to "1". Therefore, the states of the read and write pointers and the C/C bit become R-W-0, c/c-1 at the end of the process after write process A. According to the previous rule, rR-W-0,c/c-IJ means that the data is full, but since reading has finished, there is actually no data in the buffer. I haven't. Therefore, under this situation, writing becomes impossible. This updates either the read pointer or the write pointer in one control system, and
This phenomenon occurs when an interrupt from another control system occurs during a series of processing to rewrite the /C bit.

従って、このような現象を回避するためには、どちらか
一方の制御系が上記一連のポインタとC/Cビットの書
替え処理を実行している時、他方の制御系は共有メモリ
のアクセスを禁止させなければならなかった。
Therefore, in order to avoid such a phenomenon, when one of the control systems is executing the above series of pointer and C/C bit rewriting processing, the other control system must prohibit access to the shared memory. I had to let it happen.

(発明が解決しようとする問題点) −ト述の如く、マルチプロセッサ・システムにおいて、
共有メモリのアクセスに、アクセスコントロール方式を
適用し、共有メモリのデータをC/Cビットを用いたリ
ングバッファにより管理しているシステムにおいては、
リードポインタR1ライトポインタWの値を比較し、そ
れらが等しい時(WN −RN ) 、c/cビットを
参照し、c/c −1であればライト不可能とし、それ
以外の時はライトポインタの指すエリアへデータをライ
トできるようにしている。そして、C/Cビットはリー
ドポインタがバッファの末尾から先頭に更新される時に
「0」にセットされ、ライトポインタがバッファの末尾
から先頭に更新される時に「1」にセットされるように
している。そのため、例えばライト処理中に、割込みに
より他の処理に移り、その間に他の制御系において読み
出しが行われたとすると、リードポインタの値が変るの
で、一方の制御系においてリードポインタ及びライトポ
インタのいずれかを更新し、C/Cビットを書き変える
処理の途中でこれを中断したような場合、この間に他の
制御系がリングバッファのアクセスを実行すると、最悪
の場合、以後の共有メモリのアクセスがおかしくなる危
険がある。そのため、一つの制御系が共有メモリをアク
セスしている間は、他の制御系は共有メモリのアクセス
を禁止するようにするが、その制御系が共有メモリのア
クセスより上位の割込みに対する処理に移ると、共有メ
モリのアクセスが全く行われていないにもかかわらず、
他の制御系は共有メモリのアクセスが出来ないから待ち
続けなければならず、従って、システムの処理スピード
の低下を招き、処理能率が悪くなると言う欠点があった
(Problems to be solved by the invention) -As mentioned above, in a multiprocessor system,
In a system that applies an access control method to shared memory access and manages shared memory data using a ring buffer using C/C bits,
Compare the values of read pointer R1 and write pointer W, and when they are equal (WN - RN), refer to the c/c bits, and if c/c -1, write is not possible, otherwise write pointer It is possible to write data to the area pointed to by . The C/C bit is set to ``0'' when the read pointer is updated from the end of the buffer to the beginning, and set to ``1'' when the write pointer is updated from the end of the buffer to the beginning. There is. Therefore, if, for example, during a write process, the process moves to another process due to an interrupt, and a read is performed in the other control system during that time, the value of the read pointer will change, so the value of the read pointer and write pointer in one control system will change. If this is interrupted in the middle of the process of updating the C/C bit and rewriting the C/C bit, if another control system accesses the ring buffer during this time, in the worst case, subsequent access to the shared memory will be interrupted. There is a danger that things will go wrong. Therefore, while one control system is accessing the shared memory, other control systems are prohibited from accessing the shared memory, but that control system shifts to processing for interrupts higher than the shared memory access. , even though no shared memory is accessed at all.
Since other control systems cannot access the shared memory, they have to keep waiting, which has the disadvantage of slowing down the processing speed of the system and reducing processing efficiency.

そこでこの発明の目的とするところは、マルチプロセッ
サによる共有メモリアクセスにおいて、一つの制御系が
共有メモリをアクセス中にその処理が他の割込みによる
処理に振向けられて中断したような場合において、他の
制御系は共有メモリのアクセスを禁止する必要をなくし
、これにより、制御系の処理スピードの高速化を図って
、処理能率の向上を図ることのできるようにしたマルチ
プロセッサーシステムを提供することにある。
Therefore, an object of the present invention is to prevent a shared memory access by a multiprocessor from occurring when one control system is accessing the shared memory and its processing is redirected to processing by another interrupt and interrupted. To provide a multiprocessor system that eliminates the need for the control system to prohibit access to shared memory, thereby increasing the processing speed of the control system and improving processing efficiency. be.

〔発明の構成〕[Structure of the invention]

(問題点を解決するための手段) すなわち上記目的を達成するため本発明は次のように構
成する。すなわち、独立した複数の制御系と、所定の容
量を持つリングバッファとして利用されると共に前記制
御系より情報の書き込み読み出しが可能な共通の記憶手
段と、該記憶手段内の同一記憶領域に複数の制御系が同
時にアクセスしないよう調停する調停手段とを有するマ
ルチプロセッサ・システムにおいて、前記記憶手段には
前記リングバッファの書き込みポインタと読み出しポイ
ンタとを記憶する領域を設け、前記各制御系には前記記
憶手段のリングバッファに情報を書込む時、前記ライト
ポインタの値W及びリードポインタの値Rを前記記憶手
段より読み取り、これらがr(W<R)かつ少なくとも
(W−R−1)Jまたはr(W≧R)かつ(R−0)か
つ(W−ポインタ最大値)」の条件を満たすとき、書き
込み情報を書き込みポインタの示す前記リングバッファ
内の領域に書き込み、且つ、この書き込みポインタの値
Wを次の書き込み位置対応の値に更新する機能と前記リ
ングバッファ内より情報を読取る時、前記WとRの値を
該記憶手段より読み取り、これらがR≠Wの条件を満た
すとき、読み出しポインタが示すリングバッファの該当
領域の記憶情報を読み取り、且つ、この読み出しポイン
タを次の読み出し位置対応の値に更新する機能を付加し
た構成とする。
(Means for Solving the Problems) That is, in order to achieve the above object, the present invention is configured as follows. That is, a plurality of independent control systems, a common storage means that is used as a ring buffer with a predetermined capacity and can read and write information from the control system, and a plurality of storage devices in the same storage area within the storage means. In a multiprocessor system, the multiprocessor system includes an arbitration unit that arbitrates to prevent simultaneous access by control systems, wherein the storage unit is provided with an area for storing a write pointer and a read pointer of the ring buffer, and each control system has an area for storing a write pointer and a read pointer of the ring buffer; When writing information to the ring buffer of the means, the value W of the write pointer and the value R of the read pointer are read from the storage means, and these are r(W<R) and at least (W-R-1)J or r. (W≧R) and (R-0) and (W-pointer maximum value)", the write information is written to the area in the ring buffer indicated by the write pointer, and the value W of this write pointer is When reading information from within the ring buffer, the values of W and R are read from the storage means, and when they satisfy the condition R≠W, the read pointer is updated to a value corresponding to the next write position. The structure has an added function of reading the storage information of the corresponding area of the ring buffer shown and updating the read pointer to a value corresponding to the next read position.

(作用) このような構成において、共有の前記記憶手段における
リングバッファ内の情報の管理は該記憶手段内に設けた
リードポインタとライトポインタのみで行い、それらの
値の更新はリードポインタについては読み出し処理側制
御系のみで行い、ライトポインタについては書き込み処
理側制御系のみで行う。そして、リードポインタとライ
トポインタの値の関係によりバッファの余裕の有無、デ
ータの有無を知り、バッファの余裕がある時または、読
み出し情報ありの時はリードポインタとライトポインタ
の値の大小関係に応じて定まるエリアに対してアクセス
を行うようにする。このようにリードポインタとライト
ポインタの値の関係に応じてバッファの余裕度やデータ
の有無を知り、リード/ライトの制御を行うとともに読
み出し処理系によりリードポインタの更新を、そして、
書き込み処理系によりライトポインタの更新を行うこと
から、記憶手段に対して一方の制御系のアクセス(ライ
トまたはリード)の合間に、他の制御系がアクセス(リ
ードまたはライト)しても混乱が生、じなくなるので、
一つの制御系が前記記憶手段のアクセスを開始するとそ
れが終了するまで、他方の制御系に対して該記憶手段へ
のアクセスを禁止すると言う処理が不用になり、これに
より、複数の制御系における該記憶手段へのアクセスを
競合しない範囲で互いの合間を見計らって実施できるよ
うになって、従来のようにアクセス権を得た制御系が該
記憶手段のアクセスを完全に終了するまで待たなければ
ならないと云った事態を回避でき、システムの実行速度
を向上させることが出来るようになり、それぞれの制御
系の能率を大幅に向上することが出来るようになると言
う利点が得られる。
(Function) In such a configuration, information in the ring buffer in the shared storage means is managed only by the read pointer and write pointer provided in the storage means, and their values are updated by reading the read pointer. This is performed only by the processing side control system, and the write pointer is performed only by the write processing side control system. Then, based on the relationship between the values of the read pointer and write pointer, it is possible to determine whether there is enough buffer space or whether there is data. access to the area determined by In this way, the buffer capacity and the presence or absence of data are known according to the relationship between the values of the read pointer and write pointer, and the read/write is controlled, and the read pointer is updated by the read processing system.
Since the write pointer is updated by the writing processing system, confusion will occur if one control system accesses (reads or writes) the storage means between the accesses (writes or reads) of one control system. , so that
When one control system starts accessing the storage means, the process of prohibiting the other control system from accessing the storage means until the access is completed becomes unnecessary, and this makes it possible for multiple control systems to It has become possible to access the storage means at regular intervals without conflict, and it is no longer necessary to wait until the control system that has gained access rights has completely finished accessing the storage means, as in the past. This has the advantage that it is possible to avoid such situations where the system cannot be used, to improve the execution speed of the system, and to greatly improve the efficiency of each control system.

(実施例) 以下、本発明の一実施例について図面を参照して説明す
る。
(Example) Hereinafter, an example of the present invention will be described with reference to the drawings.

本装置はサイクルチエツクビットを用いたリングバッフ
ァ方式に代るリングバッファ管理方式であり、共有メモ
リにはリングバッファとライトポインタ及びリードポイ
ンタを設け、リングバッファ内の情報を管理するデータ
であるライトポインタとリードポインタについてライト
ポインタの値Wを更新はライト側制御系のみで、また、
リードポインタの値Rの更新はリード側の制御系のみで
それぞれ行うことを特徴としている。そして、リングバ
ッファ上でのライト処理において、データの書き込みは
リードポインタが指しているエリアから2つ手前のエリ
アまで可能とする規則を設ける。すなわち、ライト不許
可の条件を例えばrW<Rでは、W−(R−1)Jそし
て[W≧Rでは、  R= 0 、 W −WM Jと
定める。このような条件を外れる時、ライト処理はライ
トポインタが指すエリアに対してデータのライトを可能
にし、ライト実行後にライトポインタを更新する。また
、リード処理においてはR−Wのとき、データがないと
定義し、この条件においてはリード不可能とする。従っ
て、リード処理においては、上述の条件以外の状態では
リードポインタの指すエリアに対してデータをリードす
ることができる。リード処理においては、データをリー
ドした後、リードポインタを更新するようにする。
This device uses a ring buffer management method that replaces the ring buffer method using cycle check bits.The shared memory is equipped with a ring buffer, a write pointer, and a read pointer, and the write pointer is data that manages information in the ring buffer. The value W of the write pointer for the read pointer is updated only in the write side control system, and
A feature is that the value R of the read pointer is updated only by the control system on the read side. In write processing on the ring buffer, a rule is established that allows data to be written up to two areas before the area pointed to by the read pointer. That is, the conditions for not permitting writing are determined as, for example, when rW<R, W-(R-1)J, and [When W>=R, R=0, W-WMJ. When such conditions are not met, the write process enables data to be written to the area pointed to by the write pointer, and updates the write pointer after the write is executed. Further, in read processing, when R-W, it is defined that there is no data, and reading is not possible under this condition. Therefore, in read processing, data can be read from the area pointed to by the read pointer under conditions other than those described above. In read processing, the read pointer is updated after data is read.

その詳細を説明する。第1図は本発明の一実施例を示す
ブロック図である。この図では2つの互いに独立な制御
系CCI 、 CC2と、これら制御系CCL 、 C
C2によりそれぞれのデータバスB1. B2を介して
アクセスされる共有メモリCOM、制御系CCI 、 
CC2がこの共有メモリCOHのアクセスの際、競合し
ないように制御する共有メモリ調停装置C0NT、制御
系CCI 、 CC2の共有メモリCOHに対するアク
セスの信号を共有メモリ調停装置C0NTに伝える信号
線R1,R2、共有メモリCOMに対する同時アクセス
が生じた時、どちらか一方の制御系に対して待機信号を
伝送する信号線w1. W2、共有メモリCOHに対す
るアクセスが可能などちらか一方の制御系に対してその
アクセスを可能にすべく、共有メモリCOHに対して制
御信号を伝える信号線C1とにより構成されている。
The details will be explained below. FIG. 1 is a block diagram showing one embodiment of the present invention. In this figure, two mutually independent control systems CCI, CC2 and these control systems CCL, C
C2 to the respective data buses B1. Shared memory COM accessed via B2, control system CCI,
A shared memory arbitration device C0NT that controls so that there is no conflict when CC2 accesses the shared memory COH, a control system CCI, signal lines R1 and R2 that transmit signals for CC2's access to the shared memory COH to the shared memory arbitration device C0NT, A signal line w1. which transmits a standby signal to one of the control systems when simultaneous access to the shared memory COM occurs. W2, and a signal line C1 that transmits a control signal to the shared memory COH in order to enable access to either control system that can access the shared memory COH.

第2図は共有メモ900M内に設けられた制御系CCI
 、 CC2との間で伝送されるデータのバッファを示
す。このバッファはその領域の大きさが0〜MまでのM
+1個分確保され、その先頭をBUFTOP、末尾をB
UPENDで示すものとする。また、このバッファ内の
データを管理するためのリードポインタとライトポイン
タとの値を記憶するためのエリアとして、それぞれRE
DPNT、 WITPNTとを設ける。また、REDP
NT、νITPNTのそれぞれの領域の大きさはここで
は例えば、1バイトとする。
Figure 2 shows the control system CCI installed in the shared memo 900M.
, indicates a buffer for data transmitted to and from CC2. This buffer has an area size of 0 to M.
+1 is secured, the beginning is BUFTOP, the end is B
It shall be indicated by UPEND. Also, RE is used as an area for storing the values of read pointer and write pointer for managing data in this buffer.
DPNT and WITPNT are provided. Also, REDP
Here, the size of each area of NT and νITPNT is, for example, 1 byte.

以下、一方の制御系CC2より共有メモ900M内のバ
ッファ(BUETOP−BUFEND、 REDPNT
、νITPNT)を介して制御系CC1へのデータ転送
について詳細を説明する。
Below, the buffers (BUETOP-BUFEND, REDPNT) in the shared memory 900M are sent from one control system CC2.
, νITPNT) to the control system CC1 will be explained in detail.

第3図は制御系におけるデータのライト処理の制御フロ
ーである。第3図において、リードポインタとライトポ
インタのそれぞれの値はR,!=Wで表わしてあり、ま
た、WMはライトポインタが共有メモリCOHの末尾位
置BUPENDを指しているとフローである。この図に
おいても、第3図と同様にリードポインタとライトポイ
ンタのそれぞれのまず、第3図を用いて制御系CC2の
ライト処理フローについて説明する。制御系CC2にお
いて、共有メモリCOHに転送すべきデータが発生した
時、制御系CG2は自己の有しているソフトウェアであ
る共有メモリ・ライト処理モジュールを起動する。
FIG. 3 is a control flow of data write processing in the control system. In FIG. 3, the values of the read pointer and write pointer are R,! =W, and WM is a flow when the write pointer points to the end position BUPEND of the shared memory COH. In this figure as well, similarly to FIG. 3, the write processing flow of the control system CC2 for the read pointer and write pointer will first be explained using FIG. In the control system CC2, when data to be transferred to the shared memory COH occurs, the control system CG2 activates its own software, the shared memory write processing module.

このライト処理モジュールにおいて、まず、共有メモリ
COHにデータが書き込めるか否かを調べるため、共存
メモ900M内のバッファのリードポインタ、ライトポ
インタの値をREDPNT、νITPNTからリードす
べく、アクセス調停装置C0NTに信号線R2を介して
共有メモリ・アクセス要求信号を送る。
In this write processing module, first, in order to check whether data can be written to the shared memory COH, the access arbitration device C0NT is sent to read the values of the read pointer and write pointer of the buffer in the coexistence memory 900M from REDPNT and νITPNT. A shared memory access request signal is sent via signal line R2.

制御系CC2から共有メモリ・アクセス要求信号を受け
たアクセス調停装置C0NTは、その受信時に他方の制
御系CCIが共有メモリCONをアクセスしているか否
かを調べる。その結果、他方の制御系CC1が共有メモ
リCOMをアクセスしていなければ、アクセス調停装置
C0NTは制御系CC2がデータバッファB2を介して
共有メモリCOHにアクセスを可能にする制御信号を信
号線C1を介して送出する。
Upon receiving the shared memory access request signal from the control system CC2, the access arbitration device C0NT checks whether the other control system CCI is accessing the shared memory CON. As a result, if the other control system CC1 is not accessing the shared memory COM, the access arbitration device C0NT sends a control signal to the signal line C1 to enable the control system CC2 to access the shared memory COH via the data buffer B2. Send via.

また、制御系CC1が共有メモリCOMをアクセスして
いたならば、アクセス調停装置C0NTは制御系CCI
の共有メモリCOHに対するリードサイクル或いはライ
トサイクルが終了するまで、制御系CC2のライト処理
を待機させるべく、信号線W2を介して制御系CC2に
ウェイトの制御信号を送出する。このウェイトの制御信
号を受けた制御系CC2はデータライト処理におけるR
EDPNT或いはWITPNTの読み出し処理ルーチン
において、その実行を停止させられる。制御系CCIの
共有メモリCOHに対するリードサイクル或いはライト
サイクルが終了すると、アクセス調停装置C0NTは制
御系CC2に対して、上記ウェイトを解除すべく信号線
W2を介して制御系CC2にウェイト解除の制御信号を
送り、且つ、制御系CC2がデータバッファB2を介し
て共有メモリCOHにアクセスできるよう、共有メモリ
COMに対し、信号線C1を介してその制御信号を送る
。このウェイト解除の制御信号を受けると制御系CC2
は、実行を停止していたルーチンより、実行を再開する
Furthermore, if the control system CC1 is accessing the shared memory COM, the access arbitration device C0NT
A wait control signal is sent to the control system CC2 via the signal line W2 in order to make the control system CC2 wait for the write process until the read cycle or write cycle for the shared memory COH ends. The control system CC2 receiving this weight control signal performs R in data write processing.
Execution of the EDPNT or WITPNT read processing routine is stopped. When the read cycle or write cycle for the shared memory COH of the control system CCI ends, the access arbitration device C0NT sends a wait release control signal to the control system CC2 via the signal line W2 in order to release the above-mentioned wait. At the same time, a control signal is sent to the shared memory COM via the signal line C1 so that the control system CC2 can access the shared memory COH via the data buffer B2. Upon receiving this wait release control signal, the control system CC2
resumes execution from the routine that had stopped execution.

アクセス調停装置C0NTは制御系CCIとCC2の共
有メモリCOMに対するアクセスを競合のないように調
停する装置であり、本発明においては重要な役割を果た
す構成要素であるがこのアクセス調停装置自体は従来よ
り広く利用されているものである。そして、以下の説明
において、制御系CCI及び制御系CC2が共をメモリ
Cf)Mをアクセスするときは、常にアクセス調停装置
C0NTが機能し、共有メモリCOHに対する再制御系
CCI 、 CC2のアクセスの競合は無いように調停
されるものとして、各処理におけるアクセス調停装置C
0NTの作用の説明は省略する。
The access arbitration device C0NT is a device that arbitrates accesses to the shared memory COM between the control systems CCI and CC2 to avoid contention, and is a component that plays an important role in the present invention, but this access arbitration device itself is conventional. It is widely used. In the following explanation, when both the control system CCI and the control system CC2 access the memory Cf)M, the access arbitration device C0NT always functions, and the access conflict between the control systems CCI and CC2 to the shared memory COH is prevented. The access arbitration device C in each process is arbitrated so that there is no
A description of the action of 0NT will be omitted.

制御系CC2はアクセス調停装置C0NTより共有メモ
リCOMのREDPNT、讐ITPNTからそれぞれリ
ードポインタ、ライトポインタの値を読み取り、その両
者の大小を比較する(ステップ541)。その比較の結
果、W≧Rであったとする。次に制御系CC2はリード
ポインタの値を調べる(ステップ542)。今、リード
ポインタの値がrOJであったとする。このときは制御
系CC2はライトポインタの値を調べる(ステップ54
3)。その結果、ライトポインタがバッファの終端を指
していた時は、バッファにデータが満杯であると判断し
、制御系CC2はデータのライトをあきらめ、このライ
ト処理を終了する。ライト処理して終了する。ポインタ
がバッファの終端を指していなかった時は制御系CC2
はバッファの先i BUPTOPエリアから、ライトポ
インタの値を加えた場合で示されるエリアへデータを書
込む(ステップ544)。その後、制御系CC2はライ
トポインタの値を更新すべく、ライトポインタの値をイ
ンクリメント(+1)した値をWITPNTのエリアに
書き込む。また、ステップs42において、リードポイ
ンタの値を調べた時、リードポインタの値がR>0であ
ったならば、制御系CC2はBUPTOPから数えてラ
イトポインタの値が示すエリアにデータを書き込む(ス
テップ546)。次にライトポインタの値がバッファの
末尾を指しているか、否かを調べる(ステップ547)
。そして、その結果、ライトポインタの値がバッファの
末尾を指していたならば、ライトポインタの値を「0」
に更新する(ステップ848)。また、ライトポインタ
の値がバッファの末尾を指していなければライトポイン
タの値をインクリメントする(ステップ549)。この
ようにして、更新されたライトポインタの値はWITP
NTのエリアに書き込まれる。
The control system CC2 reads the read pointer and write pointer values from the shared memory COM REDPNT and ITPNT from the access arbitration device C0NT, respectively, and compares the two values (step 541). Assume that as a result of the comparison, W≧R. Next, the control system CC2 checks the value of the read pointer (step 542). Assume now that the value of the read pointer is rOJ. At this time, the control system CC2 checks the value of the write pointer (step 54).
3). As a result, when the write pointer points to the end of the buffer, it is determined that the buffer is full of data, the control system CC2 gives up writing data, and ends this write process. Write processing and exit. If the pointer does not point to the end of the buffer, control system CC2
writes data from the i BUPTOP area of the buffer to the area indicated by adding the value of the write pointer (step 544). After that, the control system CC2 writes a value obtained by incrementing (+1) the value of the write pointer to the WITPNT area in order to update the value of the write pointer. Further, in step s42, when checking the value of the read pointer, if the value of the read pointer is R>0, the control system CC2 writes data to the area indicated by the value of the write pointer counting from BUPTOP (step 546). Next, check whether the value of the write pointer points to the end of the buffer (step 547).
. As a result, if the value of the write pointer points to the end of the buffer, the value of the write pointer is set to "0".
(step 848). Furthermore, if the value of the write pointer does not point to the end of the buffer, the value of the write pointer is incremented (step 549). In this way, the value of the updated write pointer is WITP
Written to the NT area.

次に上記ステップs41におけるリードポインタとライ
トポインタの比較において、両者の値がW<Rであった
場合について説明する。この場合、制御系CC2は次に
ライトポインタがリードポインタの1工リア分手前のエ
リアを指4しているか否かを調べる(ステップ550)
。このとき、W−(R−1)であれば、制御系CC2は
バッファが満杯であると判断し、データの書き込みが不
可能であることを知って、ライト処理を終了する。また
、W≠(R−1)であった時、制御系CC2はBUPT
OPからライトポインタの値が示すエリアへデータを書
き込む(ステップ551)。次にライトポインタを更新
すべく現在のライトポインタの値をインクリメントし、
WITPNTに書き込む(ステップ552)。
Next, a case where the read pointer and write pointer are compared in step s41 and the values of both are W<R will be described. In this case, the control system CC2 next checks whether the write pointer is pointing to an area 1 area before the read pointer (step 550).
. At this time, if it is W-(R-1), the control system CC2 determines that the buffer is full, knows that data cannot be written, and ends the write process. Also, when W≠(R-1), the control system CC2 is BUPT
Data is written from OP to the area indicated by the value of the write pointer (step 551). Next, increment the current light pointer value to update the light pointer,
Write to WITPNT (step 552).

制御系CC2は以上の処理を以て終了する。The control system CC2 ends with the above processing.

以上、説明したように、制御系CC2おける共有メモリ
COMへのデータ書き込み処理は、共有メモリのバッフ
ァの管理データであるリードポインタとライトポインタ
のうち、ライトポインタの値の更新処理のみ行う。そし
て、その更新はバッファの末尾の書き込みならばバッフ
ァの先頭に、それ以外ではインクリメントした値を以て
行う。そして、ライトポインタがリードポインタの1工
リア分手前のエリアを指しているか否かを調べ、W−(
R−1)であれば、バッファが満杯であると判断し、デ
ータの書き込みを行わずにライト処理を終了し、W≠(
R−1)であれば、BUPTOPから数えてライトポイ
ンタの値が示すエリアへデータを書き込むように制御す
るものである。
As described above, the control system CC2 performs data write processing to the shared memory COM only to update the value of the write pointer among the read pointer and write pointer, which are the management data of the shared memory buffer. Then, if the end of the buffer is written, the update is performed at the beginning of the buffer, otherwise the update is performed with an incremented value. Then, it is checked whether the write pointer points to the area one area before the read pointer, and W-(
R-1), it is determined that the buffer is full, the write process is ended without writing data, and W≠(
R-1), the control is to write data to the area counted from BUPTOP and indicated by the value of the write pointer.

次に制御系における共有メモリCOMからのブタがある
か否かを調べるため、共有メモリCON内のリードポイ
ンタとライトポインタそれぞれを記憶しているエリアR
EDPNT、 WITPNTよりその値を読み出し、比
較する(ステップ561)。読み出したリードポインタ
とライトポインタのそれぞれの値が等しければ(R−W
) 、制御系CCIはバッファにデータが一つもないと
判断し、リード処理を終了する。また、RAWのとき、
制御系CCIはリードポインタとライトポインタの値の
大小を調べる(ステップ562)。
Next, in order to check whether there is a pig from the shared memory COM in the control system, the area R that stores the read pointer and write pointer in the shared memory CON
The values are read from EDPNT and WITPNT and compared (step 561). If the read pointer and write pointer values are equal (R-W
), the control system CCI determines that there is no data in the buffer and ends the read process. Also, when RAW,
The control system CCI checks the magnitude of the read pointer and write pointer values (step 562).

今、リードポインタとライトポインタの値の大小関係が
RAWであったとすると、制御系CCIはバッファの先
頭(BtlPTOP)の位置より、リードポインタの鎖
骨を加えた値の指し示すエリアからデータを読み取る(
ステップ563)。その後、リードポインタの値を更新
すべく、現在の値に1を加え、その値をREDPNTの
エリアに書込む。また、RAWであったとすると、制御
系CCIはバッファの先頭(BUFTOP)の位置より
、リードポインタの鎖骨を加えた値よりリードポインタ
の指示するエリアを知り、このエリアからデータを読み
出しくステップ585)、その後、リードポインタを更
新すべく、リードポインタの値がバッファの末尾を指し
ている値か否かを調べる(ステップ866)。
Now, assuming that the magnitude relationship between the read pointer and write pointer values is RAW, the control system CCI reads data from the area pointed to by the value of the read pointer plus the clavicle, starting from the buffer head position (BtlPTOP) (
step 563). Thereafter, in order to update the value of the read pointer, 1 is added to the current value and the value is written in the REDPNT area. Also, if it is RAW, the control system CCI learns the area pointed to by the read pointer from the buffer head position (BUFTOP) plus the clavicle of the read pointer, and reads data from this area (step 585). Then, in order to update the read pointer, it is checked whether the value of the read pointer points to the end of the buffer (step 866).

その結果、末尾を指している場合(R= RMの場合)
には、制御系CCIはリードポインタをバッファの先頭
に戻すべく 、REDPNTへ「0」を書込む。
As a result, if it points to the end (if R = RM)
In order to return the read pointer to the beginning of the buffer, the control system CCI writes "0" to REDPNT.

また、末尾を指していない場合(R≠RMの場合)には
、制御系CCIは現在のリードポインタの値をインクリ
メントし、その値をREDPNTへ書込む。制御系CC
Iは以上の処理を以てデータの共有メモリからの読み出
しを終了する。
Furthermore, if it does not point to the end (R≠RM), the control system CCI increments the value of the current read pointer and writes that value to REDPNT. Control system CC
I completes the reading of data from the shared memory through the above processing.

以上説明したように制御系CC1における共有メモリか
らのデータの読み取り処理においては、読み取り毎にリ
ードポインタの値のみを更新するように制御されている
。そして、その更新はバッファの末尾の読取りならばバ
ッファの先頭に、それ以外ではインクリメントした値を
以て行う。そして、データリードに当っては、ライトポ
インタの値Wとリードポインタの値Rを比較し、W−H
のときはバッファにデータなしと判断し、W≠Rのとき
はWとRの大小比較してW<HのときはRの値より得ら
れるエリアよりデータを読み取り、W>Hのときはバッ
ファの先頭よりリードポインタRの鎖骨加えた値の示す
エリアより得られるデータを読み取るように制御する。
As described above, in the process of reading data from the shared memory in the control system CC1, control is performed so that only the value of the read pointer is updated every time the data is read. Then, if the end of the buffer is read, the update is performed at the beginning of the buffer, and in other cases, the update is performed with an incremented value. When reading data, the value W of the write pointer and the value R of the read pointer are compared, and W-H
When , it is determined that there is no data in the buffer, when W≠R, the magnitude of W and R is compared, when W<H, data is read from the area obtained from the value of R, and when W>H, the buffer is Control is performed so that the data obtained from the area indicated by the value of the read pointer R plus the clavicle is read from the beginning.

以上、詳述したように共有メモリにおけるリングバッフ
ァ内のデータの管理を共有メモリ内に設けたリードポイ
ンタとライトポインタのみで行い、それらの値の更新は
リードポインタについてはリード側制御系のみで行い、
ライトポインタについてはライト側制御系のみで行うよ
うにするとともに、リードポインタとライトポインタの
値の関係によりバッファの余裕の有無、データの有無を
知り、バッファの余裕がある時または、読み出しデータ
有の時はリードポインタとライトポインタの値の大小関
係に応じて定まるエリアに対してアクセスを行うように
したことにより、共有メモリに対して一方の制御系のア
クセスの合間に、他の制御系がアクセスしても混乱が生
じなくなるので、一つの制御系が共有メモリをアクセス
開始するとそれが終了するまで、他方の制御系に対して
共有メモリへのアクセスを禁止すると言う処理が不用に
なり、これにより、複数の制御系における共有メモリへ
のアクセスを共有メモリへのアクセスが競合しない範囲
で互いの合間を見計らって実施できるようになり、従来
のようにアクセス権を得た制御系が共有メモリのアクセ
スを完全に終了するまで待たなければならないと云った
事態を回避でき、システムの実行速度を向上させること
が出来るようになり、それぞれの制御系の能率を大幅に
向」ニすることが出来るようになると言う利点が得られ
る。
As detailed above, the data in the ring buffer in the shared memory is managed only by the read pointer and write pointer provided in the shared memory, and their values are updated only by the read-side control system. ,
The write pointer should be handled only by the write-side control system, and the relationship between the read pointer and write pointer values should be used to determine whether there is buffer space or data. By making accesses to an area determined by the size relationship between the read pointer and write pointer values, one control system accesses the shared memory between the other control system accesses. This eliminates the need to prevent other control systems from accessing the shared memory when one control system starts accessing the shared memory until it finishes. , it is now possible for multiple control systems to access the shared memory at certain intervals within the range where accesses to the shared memory do not conflict. This makes it possible to avoid the situation where you have to wait until the complete completion of the system, improve the execution speed of the system, and greatly improve the efficiency of each control system. You can get the advantage of doing so.

〔発明の効果〕〔Effect of the invention〕

以上、詳述したように本発明によれば、マルチプロセッ
サによる共有メモリアクセスにおいて、一つの制御系が
共有メモリをアクセス中にその処理が他の割込みによる
処理に振向けられて中断したような場合において、他の
制御系は共有メモリのアクセスを禁止する必要をなくし
、これにより、制御系の処理スピードの高速化を図って
、処理能率の向上を図ることのできるようにしたマルチ
プロセッサ・システムを提供することが出来る。
As detailed above, according to the present invention, in shared memory access by multiprocessors, when one control system is accessing the shared memory, its processing is diverted to processing by another interrupt and interrupted. , we have developed a multiprocessor system that eliminates the need to prohibit other control systems from accessing shared memory, thereby increasing the processing speed of the control system and improving processing efficiency. can be provided.

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

第1図は本発明の一実施例を示すブロック図、第2図は
共有メモリ内に設けられた制御系CCI 。 CC2との間で伝送されるデータのバッファとポインタ
を示す図、第3図は本発明装置におけるライト処理の手
順を示すフローチャート、第4図は本発明装置における
リード処理の手順を示すフローチャート、第5図は従来
のリングバッファとその管理手法を説明するための図、
第6図はその管理手法を示すフローチャートである。 斡寺唾CCI 、 CC2・・・制御系、Bl、 B2
・・・データバス、COM・・・共をメモリ、C0NT
・・・共有メモリ調停装置、R1,R2,vL、 W2
. C1−信号線。 出願人代理人 弁理士 鈴江武彦 第1図 REDPNTロ=ニニ=二] 1 ノでイトWITPN
T口==iiバイト 第2図 〔ライト居遅〕 〔リート°メ匹、i) 〔リード、部理〕 (a)          第 6 〔フィト処理〕
FIG. 1 is a block diagram showing an embodiment of the present invention, and FIG. 2 is a control system CCI provided in a shared memory. FIG. 3 is a flowchart showing the write processing procedure in the device of the present invention; FIG. 4 is a flowchart showing the read processing procedure in the device of the present invention; Figure 5 is a diagram to explain the conventional ring buffer and its management method.
FIG. 6 is a flowchart showing the management method. CCI, CC2...control system, Bl, B2
...data bus, COM...both memory, C0NT
...Shared memory arbitration device, R1, R2, vL, W2
.. C1-signal line. Applicant's agent Patent attorney Takehiko Suzue Figure 1 REDPNT Ro=Nini=2] 1 Nodeito WITPN
T mouth ==ii Byte Figure 2 [Light late] [Leet °me, i) [Lead, part] (a) Part 6 [Phyto processing]

Claims (1)

【特許請求の範囲】[Claims] 独立した複数の制御系と、所定の容量を持つリングバッ
ファとして利用されると共に前記制御系より情報の書き
込み読み出しが可能な共通の記憶手段と、該記憶手段内
の同一記憶領域に複数の制御系が同時にアクセスしない
よう調停する調停手段とを有するマルチプロセッサ・シ
ステムにおいて、前記記憶手段には前記リングバッファ
の書き込みポインタと読み出しポインタとを記憶する領
域を設け、前記各制御系には前記記憶手段のリングバッ
ファに情報を書込む時、前記ライトポインタの値W及び
リードポインタの値Rを前記記憶手段より読み取り、こ
れらが「(W<R)かつ少なくとも(W=R−1)」ま
たは「(W≧R)かつ(R=0)かつ(W=ポインタ最
大値)」の条件を満たすとき、書き込み情報を書き込み
ポインタの示す前記リングバッファ内の領域に書き込み
、且つ、この書き込みポインタの値Wを次の書き込み位
置対応の値に更新する機能と前記リングバッファ内より
情報を読取る時、前記WとRの値を該記憶手段より読み
取り、これらがR≠Wの条件を満たすとき、読み出しポ
インタが示すリングバッファの該当領域の記憶情報を読
み取り、且つ、この読み出しポインタを次の読み出し位
置対応の値に更新する機能とを付加したことを特徴とす
るマルチプロセッサ・システム。
A plurality of independent control systems, a common storage means that is used as a ring buffer with a predetermined capacity and can read and write information from the control system, and a plurality of control systems in the same storage area within the storage means. In a multiprocessor system, the storage means is provided with an area for storing a write pointer and a read pointer of the ring buffer, and each control system has an area for storing a write pointer and a read pointer of the ring buffer. When writing information to the ring buffer, the value W of the write pointer and the value R of the read pointer are read from the storage means, and if these are "(W<R) and at least (W=R-1)" or "(W ≧R) and (R=0) and (W=maximum pointer value), write the write information to the area in the ring buffer indicated by the write pointer, and set the value W of this write pointer to the next When reading information from within the ring buffer, the values of W and R are read from the storage means, and when they satisfy the condition R≠W, the ring indicated by the read pointer 1. A multiprocessor system comprising: a function of reading storage information in a corresponding area of a buffer; and updating the read pointer to a value corresponding to the next read position.
JP62288102A 1987-11-13 1987-11-13 Multi-processor system Pending JPH01129345A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62288102A JPH01129345A (en) 1987-11-13 1987-11-13 Multi-processor system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62288102A JPH01129345A (en) 1987-11-13 1987-11-13 Multi-processor system

Publications (1)

Publication Number Publication Date
JPH01129345A true JPH01129345A (en) 1989-05-22

Family

ID=17725820

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62288102A Pending JPH01129345A (en) 1987-11-13 1987-11-13 Multi-processor system

Country Status (1)

Country Link
JP (1) JPH01129345A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002054263A1 (en) * 2000-12-28 2002-07-11 Future System Consulting Corp. Framework system
JP2002541698A (en) * 1999-04-06 2002-12-03 マイクロソフト コーポレイション Streaming information equipment with buffer read / write synchronization function
JP2010539592A (en) * 2007-09-17 2010-12-16 ゼネラル・エレクトリック・カンパニイ Method and system for exchanging data

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002541698A (en) * 1999-04-06 2002-12-03 マイクロソフト コーポレイション Streaming information equipment with buffer read / write synchronization function
WO2002054263A1 (en) * 2000-12-28 2002-07-11 Future System Consulting Corp. Framework system
US7177899B2 (en) 2000-12-28 2007-02-13 Future System Consulting Corp. Framework system
US7366751B2 (en) 2000-12-28 2008-04-29 Future Architect, Inc. Framework system
JP2010539592A (en) * 2007-09-17 2010-12-16 ゼネラル・エレクトリック・カンパニイ Method and system for exchanging data

Similar Documents

Publication Publication Date Title
US5913226A (en) Snoop cache memory control system and method
US7533197B2 (en) System and method for remote direct memory access without page locking by the operating system
US5261109A (en) Distributed arbitration method and apparatus for a computer bus using arbitration groups
EP0381325B1 (en) Synchronising and processing of memory access operations
US5504874A (en) System and method of implementing read resources to maintain cache coherency in a multiprocessor environment permitting split transactions
US4951193A (en) Parallel computer with distributed shared memories and distributed task activating circuits
US8255591B2 (en) Method and system for managing cache injection in a multiprocessor system
US5271020A (en) Bus stretching protocol for handling invalid data
EP0022829A1 (en) Data processing system.
IT8922593A1 (en) MULTIPROCESSOR SYSTEM WITH DISTRIBUTED RESOURCES WITH DYNAMIC REPLICATION OF GLOBAL DATA
JPS63238634A (en) Decentralized multiplex processing transaction processing system
JPH04306748A (en) Information processor
JPH0532775B2 (en)
EP0531003A1 (en) Data processing with bidirectional data bus reservation priority controls
US5089953A (en) Control and arbitration unit
US20020112100A1 (en) System and method for data exchange
US5615334A (en) Memory reflection system and method for reducing bus utilization and device idle time in the event of faults
US5938747A (en) Hardware command block delivery queue for host adapters and other devices with onboard processors
US6862646B2 (en) Method and apparatus for eliminating the software generated ready-signal to hardware devices that are not part of the memory coherency domain
JPH01129345A (en) Multi-processor system
US6021466A (en) Transferring data between caches in a multiple processor environment
CN111338998B (en) FLASH access processing method and device based on AMP system
JP3381079B2 (en) Exclusive control system using cache memory
KR20070062537A (en) Method and apparatus for modifying an information unit using an atomic operation in a system with a mixed architecture
JP3141948B2 (en) Computer system