JPS6320653A - Memory access method for multiprocessor system - Google Patents

Memory access method for multiprocessor system

Info

Publication number
JPS6320653A
JPS6320653A JP16633286A JP16633286A JPS6320653A JP S6320653 A JPS6320653 A JP S6320653A JP 16633286 A JP16633286 A JP 16633286A JP 16633286 A JP16633286 A JP 16633286A JP S6320653 A JPS6320653 A JP S6320653A
Authority
JP
Japan
Prior art keywords
shared memory
semaphore
cpu
access
flag
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
JP16633286A
Other languages
Japanese (ja)
Inventor
Masashi Kuriwaki
栗脇 真史
Satoshi Sato
聡 佐藤
Ryosuke Ashizuka
良介 芦塚
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.)
Sekisui Chemical Co Ltd
Original Assignee
Sekisui Chemical 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 Sekisui Chemical Co Ltd filed Critical Sekisui Chemical Co Ltd
Priority to JP16633286A priority Critical patent/JPS6320653A/en
Publication of JPS6320653A publication Critical patent/JPS6320653A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/16Combinations of two or more digital computers each having at least an arithmetic unit, a program unit and a register, e.g. for a simultaneous processing of several programs
    • G06F15/163Interprocessor communication
    • G06F15/167Interprocessor communication using a common memory, e.g. mailbox

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multi Processors (AREA)

Abstract

PURPOSE:To prevent the collision for a bus by constituting a system where one processor confirms contents of a read-only area after writing a flag on a write-only area and starts the access to a shared memory after confirming that another processor does not access the shared memory. CONSTITUTION:Even if CPUs 1 and 2 write flags in the first semaphore 4 and the second semaphore 5 for the purpose of accessing a shared memory 3, CPUs 1 and 2 do not access it because they read out flags from semaphores for read, and simultaneous access is prevented. When both flags are set, the flag of the semaphore set by one CPU is cleared, and the access is stopped to wait for reset of the flag of the semaphore set by the other CPU.

Description

【発明の詳細な説明】 (産業上の利用分野) 本発明は、マイクロプロセッサを複数個備えて複雑な処
理を行うシステムにおけるメモリアクセス方法に関し、
例えば主制御を行う制御部と入出力のインターフェース
制御を行う制御部がそれぞれ個々のマイクロプロセッサ
によって構成されているプラスチック押出成形機システ
ムに利用される。
Detailed Description of the Invention (Field of Industrial Application) The present invention relates to a memory access method in a system that includes a plurality of microprocessors and performs complex processing.
For example, it is used in a plastic extrusion molding machine system in which a control section that performs main control and a control section that performs input/output interface control are each configured by individual microprocessors.

(従来の技術) 従来、簡単な制御系においては1つのマイクロプロセッ
サ(CP U)によって制御されているが、複雑なシス
テムになると複数個のCPUが設けられ、これらCPU
が連係動作するいわゆるマルチプロセッサシステムを構
成している。例えば、複数個のCPU0中で他の残りの
CPUの制御をも兼ねているのがマスターCPUで、こ
のマスターcpuの指令に応じて各部の制御を行うもの
がスレーブ−CP Uである。このようなシステムは、
例えば近時差々複雑な制御が要請されるプラスチック押
出成形機などの各種コントローラに利用されている。こ
のようなマルチプロセッサシステムにおいては、双方の
CPUが共有できる共有メモリが設けられており、相互
の動作を互いに規制している。そして、この共有メモリ
をアクセスするグこめにセマフォと呼ばれるフラグを使
用し、このフラグを判断して各CPUは共有メモリをア
クセスしている。
(Prior Art) Conventionally, simple control systems are controlled by one microprocessor (CPU), but complex systems are equipped with multiple CPUs, and these CPUs
A so-called multi-processor system is constructed in which two processors work together. For example, among the plurality of CPUs 0, the master CPU is the one that also controls the remaining CPUs, and the slave CPU is the one that controls each part according to commands from the master CPU. Such a system is
For example, they are now used in various controllers such as plastic extrusion molding machines, which require increasingly complex control. In such a multiprocessor system, a shared memory that can be shared by both CPUs is provided, and mutual operations are mutually regulated. A flag called a semaphore is used to access this shared memory, and each CPU accesses the shared memory based on this flag.

(発明が解決しようとする問題点) しかるに、従来、共有メモリのアクセスにあたり、一の
CPUがまずセマフォの内容を読込んで他のCPUが共
有メモリを使用していないことを確認した後に、当該セ
マフォに自分が使用するためのフラグを立てていた。こ
のため、複数個のCPUが同時にセマフォの内容を読込
むと、一方のCPUが読込んだ時にはセマフォのフラグ
は立っていないので、複数個のCPtJが同時に共有メ
モリをアクセスしてしまい、アドレスバス、データバス
の衝突が起こる。
(Problem to be Solved by the Invention) Conventionally, however, when accessing shared memory, one CPU first reads the contents of the semaphore and checks that no other CPU is using the shared memory, and then accesses the semaphore. I had flagged it for my own use. Therefore, if multiple CPUs read the contents of a semaphore at the same time, the semaphore flag is not set when one CPU reads the contents, so multiple CPtJs access the shared memory at the same time, and the address bus A data bus collision occurs.

(問題点を解決するための手段) 本発明は、複数個のプロセッサが各々共有メモリにアク
セス可能となされたマルチプロセッサシステムにおいて
、前記共有メモリのアクセスを管理するためのフラグを
格納するセマフォが書込み専用領域と読出し専用領域と
に分離され、一のプロセッサは書込み専用領域にフラグ
を書込んだ後に読出し専用領域の内容を確認して他のプ
ロセッサが共有メモリをアクセスしていないのを6I 
jUして初めて該共有メモリのアクセスを開始するもの
である。
(Means for Solving the Problems) The present invention provides a multiprocessor system in which a plurality of processors can each access a shared memory, in which a semaphore that stores flags for managing access to the shared memory is used for writing. It is separated into a dedicated area and a read-only area, and one processor writes a flag to the write-only area and then checks the contents of the read-only area to check that other processors are not accessing the shared memory.
Access to the shared memory is started only after jU.

(作用) 一のプロセッサは、共有メモリをアクセスする際には、
まず書込み専用領域にフラグを書込んだ後に、読出し専
用領域の内容を確認する。他のプロセッサが共有メモリ
にアクセスしておれば、この読出し専用領域には他のプ
ロセッサが書込んだフラグが立っているので、当該一の
プロセッサは共有メモリのアクセスをしない。
(Function) When one processor accesses shared memory,
First, a flag is written in the write-only area, and then the contents of the read-only area are checked. If another processor is accessing the shared memory, a flag written by the other processor is set in this read-only area, so that one processor will not access the shared memory.

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

図面は、本発明に係るマルチプロセッサシステムにおけ
るセマフォの構成を示すブロック図である。
The drawing is a block diagram showing the configuration of a semaphore in a multiprocessor system according to the present invention.

本例は2つのプロセッサ(以下CPUと称す)1.2に
よって構成されるマルチプロセッサシステムを例示して
おり、これらCPUI、2は共有メモリ3を共有してい
る。CPUIは例えばCPU2を監視している制御部で
あり、独自の制御手順によって自動制御を行うとともに
CPU2の動作をも規制している。すなわち、CPU2
が共有メモリ3に書込んだ内容を適宜読出し、この内容
をCPtJlが続出してCPU2の動作状態を確認して
いる。また、CPU2の動作手順はCPUIが共有メモ
リ3内に記憶する命令手順に応じて実行動作がなされて
いる。CPU1は、例えばプラスチック押出成形機にお
いて、樹脂加熱用ヒータ、押出スクリュー等のM ?I
ll対象を予め決めた立上げ条件によって始動させるよ
うに自動制御させるもので、これに対してCPU2は温
度センサ、押出スクリューの回転数等を検出するセンサ
類の入出力装置を制御しているものである。なお、図面
上では2つのCPUI、2を例示しているが、もちろん
3つ以上のCPUが実際には存在している。
This example illustrates a multiprocessor system composed of two processors (hereinafter referred to as CPUs) 1 and 2, which share a shared memory 3. The CPUI is a control unit that monitors the CPU 2, for example, and performs automatic control according to its own control procedure and also regulates the operation of the CPU 2. That is, CPU2
CPtJl reads out the contents written in the shared memory 3 as appropriate, and CPtJl successively reads the contents to check the operating state of the CPU 2. Further, the operating procedure of the CPU 2 is executed according to the instruction procedure stored in the shared memory 3 by the CPUI. For example, in a plastic extrusion molding machine, the CPU 1 is used to control a heater for heating resin, an extrusion screw, etc. I
It automatically controls the target to start according to predetermined start-up conditions, and the CPU 2 controls input/output devices such as temperature sensors and sensors that detect the rotation speed of the extrusion screw. It is. Note that although two CPUIs 2 are illustrated in the drawing, of course three or more CPUs actually exist.

CPU1.2相互には、第1のセマフオ4及び第2のセ
マフォ502つのセマフォが接続されており、これらセ
マフォ4,5は読出し、書込みが可能になされている。
Two semaphores, a first semaphore 4 and a second semaphore 50, are connected to the CPU 1.2, and these semaphores 4 and 5 are readable and writable.

第1のセマフォ4はCPU1からの書込みが可能で、C
PU2からは読出しが可能な領域である。第2のセマフ
オ5は前記第1のセマフォ4とは逆にCPU2から書込
みがなされ、CPUIは読込みだけがなされる領域であ
る。このように、本例では2つのセマフォをそれぞれ1
つのCPUに対して読出しもしくは書込みしかできない
構成である。
The first semaphore 4 can be written to by CPU 1, and
This is an area that can be read from PU2. Contrary to the first semaphore 4, the second semaphore 5 is an area where writing is performed by the CPU 2, and the CPU 2 is an area where only reading is performed. In this way, in this example, each of the two semaphores is
This configuration allows only reading or writing to one CPU.

かかる上述の構成からなるマルチプロセッサシステムに
おいて、cpuiが共有メモリ3にアクセスする場合に
は、まず第1のセマフォ4にフラグを書込んだ後に、第
2のセマフォ5の内容を読込む。この第2のセマフォ5
には、前記CPU2が共有メモリ3をアクセスする場合
に立てられるフラグが記憶される領域であるので、第2
のセマフォ5にフラグが立っておれば、すてにCPU2
が共有メモリ3をアクセスしていることになる。
In the multiprocessor system configured as described above, when the CPU accesses the shared memory 3, it first writes a flag to the first semaphore 4, and then reads the contents of the second semaphore 5. This second semaphore 5
is an area in which a flag that is set when the CPU 2 accesses the shared memory 3 is stored, so the second
If the flag is set on semaphore 5, CPU2
is accessing shared memory 3.

CPUIは第2のセマフォ5にフラグが立っていなけれ
ば、CPU2が共有メモリ3をアクセスしていないのを
Tri 認できるので、CPUIは共有メモリ3をアク
セスする。CPU2が共有メモリ3をアクセスする場合
は、上述したCPUIがアクセスする場合と同じ手順で
行われる。しかして、今仮にCPUI、2が共有メモリ
3へのアクセスをするべく第1のセマフォ4、第2のセ
マフォ5にフラグを書込んでも、双方のCPtJl、2
は読出し用のセマフォからフラグを読出すのでアクセス
を行わず、同時アクセスは防止される。そして、双方の
フラグが立っている時には、一方のCPUが立てたセマ
フォのフラグをクリアしてアクセスを停止し、他方のC
PUが立てたセマフォのフラグが立ち下がるのを待てば
よい。
If the second semaphore 5 is not flagged, the CPU can recognize that the CPU 2 is not accessing the shared memory 3, so the CPU accesses the shared memory 3. When the CPU 2 accesses the shared memory 3, the procedure is the same as when the CPU 2 accesses the shared memory 3 described above. Therefore, even if the CPUI, 2 writes flags to the first semaphore 4 and the second semaphore 5 in order to access the shared memory 3, both CPtJl, 2
Since the flag is read from the read semaphore, no access is performed, and simultaneous access is prevented. When both flags are set, one CPU clears the semaphore flag set and stops access, and the other CPU clears the semaphore flag set by the other CPU.
All you have to do is wait for the semaphore flag set by the PU to fall.

(発明の効果) 以上述べたように、本発明によれば、マルチプロセッサ
システムにおいて、共有メモリの同時アクセスが防止さ
れバスの衝突が起こらない。
(Effects of the Invention) As described above, according to the present invention, in a multiprocessor system, simultaneous access to shared memory is prevented and bus collisions do not occur.

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

図面は本発明に係るマルチプロセッサシステムのメモリ
アクセス方法を説明するプコノク図である。 1.2・・・CPU       3・・・共有メモリ
4・・・第1のセマフォ  5・・・第2のセマフォ特
許出願人 積水化学工業株式会社 代表者  廣1) 馨
The drawing is a block diagram illustrating a memory access method of a multiprocessor system according to the present invention. 1.2... CPU 3... Shared memory 4... First semaphore 5... Second semaphore Patent applicant Sekisui Chemical Co., Ltd. Representative Hiroshi 1) Kaoru

Claims (1)

【特許請求の範囲】[Claims] 1)複数個のプロセッサが各々共有メモリにアクセス可
能となされたマルチプロセッサシステムにおいて、前記
共有メモリのアクセスを管理するためのフラグを格納す
るセマフォが書込み専用領域と読出し専用領域とに分離
され、一のプロセッサは書込み専用領域にフラグを書込
んだ後に読出し専用領域の内容を確認して他のプロセッ
サが共有メモリをアクセスしていないのを確認して初め
て該共有メモリのアクセスを開始することを特徴とする
マルチプロセッサシステムのメモリアクセス方法。
1) In a multiprocessor system in which a plurality of processors can each access a shared memory, a semaphore that stores flags for managing access to the shared memory is separated into a write-only area and a read-only area. The processor writes a flag in the write-only area, checks the contents of the read-only area, and starts accessing the shared memory only after confirming that no other processor is accessing the shared memory. Memory access method for multiprocessor systems.
JP16633286A 1986-07-15 1986-07-15 Memory access method for multiprocessor system Pending JPS6320653A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP16633286A JPS6320653A (en) 1986-07-15 1986-07-15 Memory access method for multiprocessor system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP16633286A JPS6320653A (en) 1986-07-15 1986-07-15 Memory access method for multiprocessor system

Publications (1)

Publication Number Publication Date
JPS6320653A true JPS6320653A (en) 1988-01-28

Family

ID=15829400

Family Applications (1)

Application Number Title Priority Date Filing Date
JP16633286A Pending JPS6320653A (en) 1986-07-15 1986-07-15 Memory access method for multiprocessor system

Country Status (1)

Country Link
JP (1) JPS6320653A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1997041514A1 (en) * 1996-04-30 1997-11-06 3Com Corporation Qualified burst buffer
JP2008034026A (en) * 2006-07-28 2008-02-14 Hitachi Ulsi Systems Co Ltd Semiconductor device
JP2014154077A (en) * 2013-02-13 2014-08-25 Nippon Telegr & Teleph Corp <Ntt> Double update prevention system and double update prevention method

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS59223873A (en) * 1983-06-01 1984-12-15 Toshiba Corp Control method of multi-processor

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS59223873A (en) * 1983-06-01 1984-12-15 Toshiba Corp Control method of multi-processor

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1997041514A1 (en) * 1996-04-30 1997-11-06 3Com Corporation Qualified burst buffer
JP2008034026A (en) * 2006-07-28 2008-02-14 Hitachi Ulsi Systems Co Ltd Semiconductor device
JP2014154077A (en) * 2013-02-13 2014-08-25 Nippon Telegr & Teleph Corp <Ntt> Double update prevention system and double update prevention method

Similar Documents

Publication Publication Date Title
US5214776A (en) Multiprocessor system having global data replication
CA1221173A (en) Microcomputer system with bus control means for peripheral processing devices
US5291605A (en) Arrangement and a method for handling interrupt requests in a data processing system in a virtual machine mode
JP4874165B2 (en) Multiprocessor system and access right setting method in multiprocessor system
JPS6320653A (en) Memory access method for multiprocessor system
WO1995000908A1 (en) A high speed/low overhead bus arbitration apparatus and method for arbitrating a system bus
JP2003030042A (en) Microcomputer with cores
US6032173A (en) Synchronization of a computer system having a plurality of processors
KR930004910Y1 (en) Data bus arbitrator for multiprocessor system
JPS61234447A (en) Bus acuisition controller
JPH0374759A (en) Multiprocessor system
JPH0679306B2 (en) Multiprocessor control method
JP2687716B2 (en) Information processing device
JPH01316851A (en) Channel control system
JPS61101865A (en) Multi-microprocessor system
JPS63155254A (en) Information processor
JPH0298769A (en) Arithmetic processor
JPH04348437A (en) Debugging device
JPH0289154A (en) Information processing system
JPH05324593A (en) Task management system un multi-processor system
JPS61177565A (en) Multiprocessor system
JPS63158660A (en) Multiprocessor bus control system
JPS6337418B2 (en)
JPS6244295B2 (en)
JPH0727468B2 (en) Redundant information processing device