JPH1031616A - Inter-process communication system - Google Patents

Inter-process communication system

Info

Publication number
JPH1031616A
JPH1031616A JP20551996A JP20551996A JPH1031616A JP H1031616 A JPH1031616 A JP H1031616A JP 20551996 A JP20551996 A JP 20551996A JP 20551996 A JP20551996 A JP 20551996A JP H1031616 A JPH1031616 A JP H1031616A
Authority
JP
Japan
Prior art keywords
data
transmission
reception
shared memory
transmitting
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
JP20551996A
Other languages
Japanese (ja)
Inventor
Masashi Tanaka
雅士 田中
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
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP20551996A priority Critical patent/JPH1031616A/en
Publication of JPH1031616A publication Critical patent/JPH1031616A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide an inter-process communication system by which the time for transmission/reception can be shortened in the case of making communication by using the transmission/reception queue of a mail box system. SOLUTION: Between a transmission side process 51 and a reception side process 53, a commonly accessable shared memory 58 is arranged. The transmission side process 51 constructs data 59 to be a communication object in this shared memory 58, copies its start address and the amount of data from a memory area 52 to a transmission/reception queue 57 as information 56 and copies this information into a memory area 54. Thus, a flag 61 is changed into '1' and the reception side process 53 can read data from the relevant area of the shared memory 58. Since the shared memory 58 is constructed for commonly accessing the main section of data, the time required for copy can be remarkably economized.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は共有メモリを用いた
プロセス間通信システムに係わり、詳細には送受信キュ
ーを使用したメールボックス方式でデータの通信を行う
プロセス間通信システムに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an inter-process communication system using a shared memory, and more particularly to an inter-process communication system for performing data communication by a mailbox system using a transmission / reception queue.

【0002】[0002]

【従来の技術】プロセス間で通信を行うプロセス間通信
システムには、送受信キューを使用してメールボックス
方式でデータの通信を行うものがある。このメールボッ
クス方式のシステムでは、送信側プロセスも受信側プロ
セスもそれぞれ初期化時にメモリ領域を独自に割り当て
られるようになっている。送信側プロセスでは、この送
信側に割り当てられたメモリ領域に送信データを構築す
る。構築されたデータは送受信キューにすべてコピーさ
れた後、メールボックスに投函される。メールボックス
は、投函された送受信キューが配送されるべき受信側プ
ロセスに対して、データが送信されたことを通知する。
この通知は、フラグを用いて行われる。受信側プロセス
では、このフラグによる通知を受けると、送受信キュー
に格納されたデータを、初期化時に割り当てられたメモ
リ領域にすべてコピーするようにしている。
2. Description of the Related Art Some interprocess communication systems that perform communication between processes use a send / receive queue to perform data communication by a mailbox method. In this mailbox-type system, each of the transmitting process and the receiving process can independently allocate a memory area at the time of initialization. The sender process constructs the send data in the memory area assigned to this sender. The constructed data is copied to the send / receive queue and then posted to the mailbox. The mailbox notifies the receiving process to which the posted send / receive queue should be delivered that the data has been sent.
This notification is performed using a flag. Upon receiving the notification by this flag, the receiving process copies all the data stored in the transmission / reception queue to the memory area allocated at initialization.

【0003】図2は、このような従来のプロセス間通信
システムの構成の概要を表わしたものである。このシス
テムでは、送信側プロセス11側に、初期化時に割り当
てられた第1のメモリ領域12が配置されており、受信
側プロセス13側には同じく初期化時に割り当てられた
第2のメモリ領域14が配置されている。これら両プロ
セス11、13の間には、送受信されるデータ16を一
時的に格納するための送受信キュー17が配置されてい
る。受信側プロセス13は、送受信キュー17の送信の
有無を示すフラグ18を備えている。
FIG. 2 shows an outline of the configuration of such a conventional inter-process communication system. In this system, the first memory area 12 allocated at the time of initialization is arranged on the side of the transmitting process 11, and the second memory area 14 similarly allocated at the time of initialization is arranged at the side of the receiving process 13. It is arranged. A transmission / reception queue 17 for temporarily storing the data 16 to be transmitted / received is arranged between these processes 11 and 13. The receiving process 13 includes a flag 18 indicating whether or not the transmission / reception queue 17 is transmitted.

【0004】このようなプロセス間通信システムで、送
信側プロセス11は送信すべきデータ21を第1のメモ
リ領域12に構築する。送信を行うとき、この構築され
たデータ21は送受信キュー17にデータ16としてす
べてコピーされ、メールボックスに投函される。送信側
プロセス11からメールボックス方式でデータを保持し
た送受信キュー17が送信されると、受信側プロセス1
3はこの事実をフラグによって通知される。そして、受
信側プロセス13は送受信キュー17に保持されたデー
タ16を第2のメモリ領域にコピーする。このような動
作によって、受信側プロセス13は送信側プロセス11
が構築したデータ21を第2のメモリ領域14にコピー
して、これをデータ19として読み出すことができる。
In such an interprocess communication system, the transmitting side process 11 constructs the data 21 to be transmitted in the first memory area 12. When transmitting, the constructed data 21 is all copied to the transmission / reception queue 17 as data 16 and posted to the mailbox. When the transmission / reception queue 17 holding data in the mailbox system is transmitted from the transmission side process 11, the reception side process 1
3 is notified of this fact by a flag. Then, the reception side process 13 copies the data 16 held in the transmission / reception queue 17 to the second memory area. By such an operation, the receiving side process 13 becomes the transmitting side process 11
The data 21 constructed by can be copied to the second memory area 14 and read as the data 19.

【0005】[0005]

【発明が解決しようとする課題】この図2に示したプロ
セス間通信システムでは、第1のメモリ領域12のデー
タ21を送受信キュー17に第1のコピー作業31でコ
ピーし、次いで、このコピーされたデータ16を第2の
メモリ領域14に第2のコピー作業32でコピーするこ
とにしている。ここで、第1のメモリ領域12に構築さ
れるデータ21の規模が大きい場合には、第1のコピー
作業31で送受信キュー17にコピーを行う際に、この
規模に伴ってある程度長い時間を必要とし、その後にメ
ールボックスへの投函が行われる。受信側プロセス13
においても、データ19を読み出す際には、送受信キュ
ー17内のデータ16を第2のメモリ領域14にコピー
する必要があり、データ16の規模が大きい場合には同
様にコピーにある程度長い時間を必要とすることにな
る。
In the inter-process communication system shown in FIG. 2, the data 21 in the first memory area 12 is copied to the transmission / reception queue 17 by the first copy operation 31, and then this copied data is copied. The copied data 16 is copied to the second memory area 14 by a second copy operation 32. Here, when the size of the data 21 constructed in the first memory area 12 is large, it takes a certain amount of time to copy to the transmission / reception queue 17 in the first copy operation 31. Then, the mail is posted to the mailbox. Receiving process 13
Also, when reading the data 19, it is necessary to copy the data 16 in the transmission / reception queue 17 to the second memory area 14, and when the size of the data 16 is large, the copying requires a relatively long time. It will be.

【0006】音声や動画のようにリアルタイム通信を要
求されるデータが増大している。このようなデータをプ
ロセス間通信で送信する場合には、通信の即時性あるい
は高速化が重要である。しかしながら、プロセス間通信
ではシステムの初期化時に割り当てられる第1および第
2のメモリ領域12、14が各プロセス11、13で完
全に独立している。したがって、第1のメモリ領域12
に構築したデータ21を、送受信キュー17に一度コピ
ーしてメールボックスに投函することにしている。しか
しながら、これに伴う第1と第2の2回のコピー作業3
1、32はデータの通信の即時性を低下させ、特にコピ
ーされるデータの規模が大きい場合にはプロセス間通信
の送受信時間の性能を低下させてリアルタイム通信を困
難とさせるという問題があった。
[0006] The amount of data required for real-time communication such as voice and moving images is increasing. When transmitting such data by inter-process communication, it is important that the communication is immediate or speedy. However, in inter-process communication, the first and second memory areas 12 and 14 allocated at the initialization of the system are completely independent in each process 11 and 13. Therefore, the first memory area 12
Is copied once to the transmission / reception queue 17 and posted to the mailbox. However, with this, the first and second two copying operations 3
Nos. 1 and 32 reduce the immediacy of data communication, and particularly when the size of the data to be copied is large, there is a problem in that the performance of transmission / reception time of inter-process communication is reduced and real-time communication becomes difficult.

【0007】なお、特開昭60−237566号公報で
は、各プロセッサに対応したエリアを割り付け、そのエ
リアを介して相手側のプロセッサに割込通知を行うこと
でそのエリアにデータが存在することを通知すると共
に、データを受信した側のプロセッサが自分のプロセッ
サに割り当てられたエリアに指定されたパターンを書き
込むことでデータが受信されたことを送信側のプロセッ
サに通知するようにしている。
In Japanese Patent Application Laid-Open No. 60-237566, an area corresponding to each processor is allocated, and an interrupt notification is sent to the other processor via the area to confirm that data exists in that area. In addition to the notification, the processor receiving the data writes the specified pattern in the area assigned to its own processor to notify the processor on the transmitting side that the data has been received.

【0008】図3は、この提案のプロセス間通信システ
ムを表わしたものである。この図で第1のプロセッサ4
1と第2のプロセッサ42は共有メモリ領域43を有し
ている。共有メモリ領域43は第1のプロセッサ41が
送信し第2のプロセッサ42が受信する第1の領域44
と、第1のプロセッサ41が受信し第2のプロセッサ4
2が送信する第2の領域45を有している。したがっ
て、第1のプロセッサ41から第2のプロセッサ42に
データを送信する場合には、送りたいそのデータを共有
メモリ領域43の第1の領域44に格納する。その後、
第1のプロセッサ41は第2のプロセッサ42にI/O
命令等を送出する。第2のプロセッサ42はこのI/O
命令を終了させるために応答信号を即時返送する。そし
て、その後、第1の領域44にアクセスしてそのデータ
の読取処理を行うようにしている。受信側の第2のプロ
セッサ42は受信したエリアをクリアしたり、その部分
に応答パターンを書き込むようにしている。
FIG. 3 shows the proposed inter-process communication system. In this figure, the first processor 4
The first and second processors 42 have a shared memory area 43. The shared memory area 43 is a first area 44 transmitted by the first processor 41 and received by the second processor 42.
Received by the first processor 41 and received by the second processor 4
2 has a second area 45 to transmit. Therefore, when transmitting data from the first processor 41 to the second processor 42, the data to be transmitted is stored in the first area 44 of the shared memory area 43. afterwards,
The first processor 41 is connected to the second processor 42 by I / O.
Send commands, etc. The second processor 42 uses this I / O
Immediately returns a response signal to end the command. Then, after that, the first area 44 is accessed to read the data. The second processor 42 on the receiving side clears the received area and writes a response pattern in that area.

【0009】しかしながらこの提案された技術では、共
有メモリ領域43がそれぞれのプロセッサの送信と受信
の対ごとに割り振られているので、プロセッサの対の数
が多くなるとそれぞれの領域を確保する必要がある。し
たがって、比較的大きなサイズのデータを格納する領域
をそれぞれ確保しようとすると、共有メモリ領域の全体
のサイズが極めて大きくなり、プロセス間通信システム
のコストをアップさせるという問題がある。
However, in this proposed technique, the shared memory area 43 is allocated for each pair of transmission and reception of each processor, so that it is necessary to secure each area when the number of pairs of processors increases. . Therefore, if an attempt is made to secure an area for storing data of a relatively large size, the entire size of the shared memory area becomes extremely large, causing a problem of increasing the cost of the inter-process communication system.

【0010】そこで本発明の目的は、メールボックス方
式の送受信キューを使用して通信を行う際の送受信時間
の短縮化を図ることのできるプロセス間通信システムを
提供することにある。
An object of the present invention is to provide an inter-process communication system capable of shortening the transmission / reception time when performing communication using a mailbox type transmission / reception queue.

【0011】本発明の他の目的は、メールボックス方式
の送受信キューを使用して通信を行う際に全体的なメモ
リ容量を節約することのできるプロセス間通信システム
を提供することにある。
Another object of the present invention is to provide an interprocess communication system capable of saving the entire memory capacity when performing communication using a mailbox type send / receive queue.

【0012】[0012]

【課題を解決するための手段】請求項1記載の発明で
は、(イ)データの送信側としての送信側プロセスと、
(ロ)データの受信側としての受信側プロセスと、
(ハ)送信側プロセスからデータの書き込みが少なくと
も可能で受信側プロセスからデータの読み出しが少なく
とも可能な共有メモリと、(ニ)送信側プロセスと受信
側プロセスの間でデータの通信を行うとき送信側プロセ
スが共有メモリに書き込んだ通信対象となるデータの所
在を示す情報を格納して送信側プロセスから受信側プロ
セスに送信される送受信キューと、(ホ)この送受信キ
ューが受信側プロセスに送信されたときこれを通知する
受信完了通知手段と、(ヘ)受信側プロセスの側に配置
され、受信完了通知手段が送受信キューの送信が完了し
たことを通知したとき送受信キューから通信対象となる
データの所在を示す情報を取り出しこの取り出した情報
を基にして共有メモリから対応するデータを読み出すデ
ータ読出手段とをプロセス間通信システムに具備させ
る。
According to the first aspect of the present invention, (a) a transmitting process as a data transmitting device;
(B) A receiving side process as a data receiving side,
(C) a shared memory capable of at least writing data from the transmitting process and reading data from the receiving process; and (d) transmitting data between the transmitting process and the receiving process. A send / receive queue that stores the information indicating the location of the communication target data written by the process in the shared memory and is sent from the sending process to the receiving process, and (e) this sending / receiving queue is sent to the receiving process. When the reception completion notifying means for notifying this and (f) the reception side process is arranged, and when the reception completion notifying means notifies the completion of transmission of the transmission / reception queue, the location of the data to be communicated from the transmission / reception queue And a data reading means for reading the corresponding data from the shared memory based on the extracted information. Interprocess is provided to the communication system.

【0013】すなわち請求項1記載の発明では、送信側
プロセスと受信側プロセスの間に共有メモリを設け、送
信側プロセスが通信を行うデータをこの共有メモリに直
接書き込みできるようにすると共に、この共有メモリを
有効に活用するためにその領域を予め割り振らずに使用
するようにする。共有メモリのどの領域にデータが書き
込まれたかを示す情報は送受信キューによって受信側プ
ロセスに送られ、受信完了通知手段がこれを受信側プロ
セスに通知する。これにより、受信側プロセスは共有メ
モリの該当する領域のデータを読み出すことになる。こ
の結果、データのコピーによる処理時間の遅延を防止す
ることができると共に、共有メモリを共用できるように
してそのメモリサイズの増大を抑制しシステムのコスト
ダウンを図っている。
That is, according to the first aspect of the present invention, a shared memory is provided between a transmitting process and a receiving process so that data to be communicated by the transmitting process can be directly written in the shared memory. In order to effectively use the memory, the area is used without being allocated in advance. Information indicating in which area of the shared memory the data has been written is sent to the receiving process by the transmission / reception queue, and the reception completion notifying means notifies the receiving process. As a result, the receiving process reads the data in the corresponding area of the shared memory. As a result, it is possible to prevent a delay in processing time due to copying of data, and to allow a shared memory to be shared, thereby suppressing an increase in the memory size and reducing the cost of the system.

【0014】請求項2記載の発明では、(イ)データの
送信側としての送信側プロセスと、(ロ)データの受信
側としての受信側プロセスと、(ハ)システムの初期化
時に送信側プロセスに割り当てられた送信側メモリ領域
と、(ニ)送信側プロセスからデータの書き込みが少な
くとも可能で受信側プロセスからデータの読み出しが少
なくとも可能な共有メモリと、(ホ)送信側プロセスと
受信側プロセスの間でデータの通信を行うとき送信側プ
ロセスが共有メモリに書き込んだ通信対象となるデータ
の所在を示す情報を送信側メモリ領域からコピーされて
送信側プロセスから受信側プロセスに送信される送受信
キューと、(ヘ)この送受信キューが受信側プロセスに
送信されたときこれを通知する受信完了通知手段と、
(ト)受信側プロセスの側に配置され、受信完了通知手
段が送受信キューの送信が完了したことを通知したとき
送受信キューから通信対象となるデータの所在を示す情
報を取り出しこの取り出した情報を基にして共有メモリ
から対応するデータを読み出すデータ読出手段とをプロ
セス間通信システムに具備させる。
According to the second aspect of the invention, (a) a transmission side process as a data transmission side, (b) a reception side process as a data reception side, and (c) a transmission side process at the time of system initialization. (D) a shared memory area in which data can be written from the sender process and data can be read from the receiver process, and (e) a sender process and a receiver process. A transmission / reception queue, which is copied from the transmission-side memory area and transmitted from the transmission-side process to the reception-side process, in which information indicating the location of data to be communicated written by the transmission-side process to the shared memory is transmitted by the transmission-side process when performing data communication between the , (F) reception completion notifying means for notifying this when the transmission / reception queue is transmitted to the receiving side process,
(G) When the reception completion notifying means arranged on the receiving side process side notifies that the transmission / reception queue has been transmitted, information indicating the location of the data to be communicated is extracted from the transmission / reception queue and the extracted information is used as a basis. And a data reading means for reading corresponding data from the shared memory.

【0015】すなわち請求項2記載の発明では、送信側
プロセスと受信側プロセスの間に共有メモリを設け、送
信側プロセスが通信を行うデータをこの共有メモリに直
接書き込みできるようにすると共に、この共有メモリを
有効に活用するためにその領域を予め割り振らずに使用
するようにする。共有メモリのどの領域にデータが書き
込まれたかを示す情報は送信側メモリ領域から送受信キ
ューにコピーされ、受信側プロセスに送られる。受信完
了通知手段がこの送信完了を受信側プロセスに通知す
る。これにより、受信側プロセスは共有メモリの該当す
る領域のデータを読み出すことになる。この結果、デー
タのコピーによる処理時間の遅延を防止することができ
ると共に、共有メモリを共用できるようにしてそのメモ
リサイズの増大を抑制しシステムのコストダウンを図っ
ている。
That is, according to the second aspect of the present invention, a shared memory is provided between the transmitting process and the receiving process so that the data transmitted by the transmitting process can be directly written in the shared memory. In order to effectively use the memory, the area is used without being allocated in advance. Information indicating in which area of the shared memory data has been written is copied from the transmission-side memory area to the transmission / reception queue and sent to the reception-side process. The reception completion notifying means notifies the reception side process of the completion of the transmission. As a result, the receiving process reads the data in the corresponding area of the shared memory. As a result, it is possible to prevent a delay in processing time due to copying of data, and to share the shared memory so as to suppress an increase in the memory size and reduce the system cost.

【0016】請求項3記載の発明では、共有メモリに送
信側プロセスから書き込まれるデータは可変長であり、
通信対象となるデータの所在を示す情報は共有メモリに
格納されたそのデータの一端を示すアドレスとデータ量
からなることを特徴としている。すなわち請求項3で
は、可変長のデータの通信を扱っており、共有メモリに
格納されたデータを特定するためにそのデータの先端や
後端を示すアドレスとデータの量を使用することにして
いる。
In the third aspect of the invention, the data written in the shared memory from the transmitting side process has a variable length,
The information indicating the location of the data to be communicated is characterized by including an address indicating one end of the data stored in the shared memory and the data amount. That is, in claim 3, communication of variable-length data is handled, and in order to specify data stored in the shared memory, an address indicating the leading end or the trailing end of the data and the amount of data are used. .

【0017】請求項4記載の発明では、共有メモリに送
信側プロセスから書き込まれるデータは固定長であり、
通信対象となるデータの所在を示す情報は共有メモリに
格納されたそのデータの一端を示すアドレスからなるこ
とを特徴としている。すなわち請求項4記載の発明で
は、固定長のデータの通信を扱っている。固定長でデー
タ量が定まっているので、共有メモリに格納されたデー
タを特定するためにはデータの先端か後端を示すアドレ
スが存在すればよい。
According to the fourth aspect of the present invention, the data written from the transmitting process to the shared memory has a fixed length.
The information indicating the location of data to be communicated is characterized by comprising an address indicating one end of the data stored in the shared memory. That is, the invention according to claim 4 deals with communication of fixed-length data. Since the amount of data is fixed and fixed, the address indicating the leading end or the trailing end of the data may be present to specify the data stored in the shared memory.

【0018】請求項5記載の発明では、請求項1〜請求
項3記載のプロセス間通信システムで受信完了通知手段
は2値のいずれかの状態で送信の完了を示すフラグであ
ることを特徴としている。例えばラスタが“1”のとき
にデータが送信されたことを示すことになる。
According to a fifth aspect of the present invention, in the inter-process communication system according to the first to third aspects, the reception completion notifying means is a flag indicating transmission completion in one of two states. There is. For example, when the raster is "1", it indicates that the data has been transmitted.

【0019】[0019]

【発明の実施の形態】BEST MODE FOR CARRYING OUT THE INVENTION

【0020】[0020]

【実施例】以下実施例につき本発明を詳細に説明する。EXAMPLES The present invention will be described in detail below with reference to examples.

【0021】図1は本発明の一実施例におけるプロセス
間通信システムの構成を表わしたものである。このシス
テムでは、送信側プロセス51側に、初期化時に割り当
てられた第1のメモリ領域52が配置されており、受信
側プロセス53側には同じく初期化時に割り当てられた
第2のメモリ領域54が配置されている。これら両プロ
セス51、53の間には、送受信されるデータの位置を
示すポインタとデータサイズを示す情報56とを格納す
る送受信キュー57と、両プロセス51、53が共にア
クセス可能な共有メモリ58が配置されている。この共
有メモリ58には、通信の対象となるデータ59が格納
されるようになっている。また、受信側プロセス53側
には送受信キュー57の送信の有無を表示するためのフ
ラグ61が配置されている。フラグ61は、送受信キュ
ー57が送信されていない場合には“0”を示すように
なっている。
FIG. 1 shows the configuration of an inter-process communication system according to an embodiment of the present invention. In this system, a first memory area 52 allocated at the time of initialization is arranged on the transmitting process 51 side, and a second memory area 54 also allocated at the time of initialization is allocated on the receiving process 53 side. Are located. Between these processes 51 and 53, a transmission / reception queue 57 for storing a pointer indicating the position of data to be transmitted and received and information 56 for indicating the data size, and a shared memory 58 accessible by both processes 51 and 53 are provided. It is arranged. The shared memory 58 stores data 59 to be communicated. Further, a flag 61 for displaying the presence / absence of transmission in the transmission / reception queue 57 is arranged on the reception side process 53 side. The flag 61 indicates "0" when the transmission / reception queue 57 is not transmitted.

【0022】このようなプロセス間通信システムで、送
信側プロセス51は送信すべきデータ59を共有メモリ
58上に書き込むようになっている。送信側プロセス5
1がこの書き込んだデータ59を受信側プロセス53に
渡す際に、その作業メモリとしての第1のメモリ領域5
2に、共有メモリ58に構築したデータ59の先頭アド
レスを示すポインタAとそのデータサイズaからなる前
記した情報56が保持されている。情報56は、データ
59を受信側プロセス53に渡すとき、第1のコピー作
業71として送受信キュー57にコピーされ、コピー作
業72によってメールボックスに投函される。これによ
り、フラグ61は未送信状態を示す“0”から送信状態
を示す“1”に変化する。
In such an interprocess communication system, the transmitting process 51 writes data 59 to be transmitted on the shared memory 58. Sender process 5
1 transfers the written data 59 to the receiving process 53, the first memory area 5 as a working memory thereof.
2, a pointer A indicating the head address of the data 59 constructed in the shared memory 58 and the information 56 including the data size a are stored. The information 56 is copied to the transmission / reception queue 57 as the first copy work 71 when the data 59 is passed to the reception side process 53, and is posted to the mailbox by the copy work 72. As a result, the flag 61 changes from “0” indicating the non-transmission state to “1” indicating the transmission state.

【0023】受信側プロセス53は、フラグ61の変化
によって、受信すべきデータ59が共有メモリ58に蓄
積されたことを通知される。そして、情報56を構成す
るポインタAとデータサイズaを、システムの初期化時
に割り当てられた作業メモリとしての第2のメモリ領域
54にコピーして保持する。受信側プロセス53は、送
信されてきたこのポインタAとデータサイズaを参照す
ることで、送信側プロセス51が共有メモリ58上に構
築した先頭アドレスAからデータサイズaだけ連続した
データ59を読み出すことができる。
The receiving process 53 is notified by the change of the flag 61 that the data 59 to be received is stored in the shared memory 58. Then, the pointer A and the data size a constituting the information 56 are copied and held in the second memory area 54 as a work memory allocated at the time of system initialization. The receiving side process 53 refers to the transmitted pointer A and the data size a to read the continuous data 59 of the data size a from the head address A constructed on the shared memory 58 by the transmitting side process 51. You can

【0024】以上説明した実施例では、通信の対象とな
るデータ59の先頭アドレスを示すポインタAとそのデ
ータサイズを送受信キュー57に情報56として格納す
ることにしたが、そのデータ59の先頭と末尾をそれぞ
れ示すポインタA、Bを代わりに格納するようにしても
共有メモリ58から読み出すべきデータの範囲を特定す
ることができる。また、共有メモリ58に格納されたそ
のデータ59の末尾を示すアドレスとそのデータサイズ
を格納しても、同様に受信側プロセス53側で送信側プ
ロセス51が共有メモリ58上に構築したデータを読み
出すことができる。
In the embodiment described above, the pointer A indicating the head address of the data 59 to be communicated and the data size are stored in the transmission / reception queue 57 as the information 56, but the head and tail of the data 59 are stored. Can be specified instead of storing pointers A and B respectively indicating the range of data to be read from the shared memory 58. Further, even if the address indicating the end of the data 59 stored in the shared memory 58 and the data size thereof are stored, the data constructed by the transmitting process 51 on the shared memory 58 is similarly read on the receiving process 53 side. be able to.

【0025】なお、これは通信の対象となるデータ59
が可変長であることを前提とするものである。通信の対
象となるデータ59が固定長である場合には送受信キュ
ーにデータの先頭あるいは末尾を示すポインタのみが送
受信キューにコピーされれば足りることは当然である。
This is the data 59 to be communicated.
Is assumed to have a variable length. When the data 59 to be communicated has a fixed length, it is only necessary to copy only the pointer indicating the beginning or end of the data to the transmission / reception queue to the transmission / reception queue.

【0026】[0026]

【発明の効果】以上説明したように請求項1および請求
項2記載の発明によれば、共有メモリを通信対象のデー
タの共通に使用することのできる領域としたので、領域
をプロセスごとに割り当てる場合と異なり、メモリの有
効活用を行うことができ、そのコストダウンを図ること
ができる。しかも送受信キューにアドレス等の少量のデ
ータを入れて送信を行うので、コピーするデータ量を減
少させ、タスク間通信の送受信時間の短縮に伴う通信性
能の向上を図ることができる。また、送受信用のパケッ
トのサイズの小型化を図ることも可能になる。
As described above, according to the first and second aspects of the present invention, the shared memory is an area that can be commonly used for data to be communicated, and the area is allocated to each process. Unlike the case, the memory can be effectively used, and the cost can be reduced. Moreover, since a small amount of data such as an address is put in the transmission / reception queue for transmission, the amount of data to be copied can be reduced, and communication performance can be improved with shortening the transmission / reception time of inter-task communication. In addition, it is possible to reduce the size of the packet for transmission and reception.

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

【図1】本発明の一実施例におけるプロセス間通信シス
テムの構成を表わした概略構成図である。
FIG. 1 is a schematic configuration diagram showing a configuration of an inter-process communication system in an embodiment of the present invention.

【図2】従来のプロセス間通信システムの構成を表わし
た概略構成図である。
FIG. 2 is a schematic configuration diagram illustrating a configuration of a conventional inter-process communication system.

【図3】従来提案された他の通信システムの構成を表わ
した概略構成図である。
FIG. 3 is a schematic configuration diagram showing a configuration of another communication system proposed conventionally.

【符号の説明】[Explanation of symbols]

51 送信側プロセス 52 メモリ領域 53 受信側プロセス 54 第2のメモリ領域 56 情報 57 送受信キュー 58 共有メモリ 59 データ 61 フラグ 51 sending process 52 memory area 53 receiving process 54 second memory area 56 information 57 send / receive queue 58 shared memory 59 data 61 flag

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 データの送信側としての送信側プロセス
と、 データの受信側としての受信側プロセスと、 前記送信側プロセスからデータの書き込みが少なくとも
可能で受信側プロセスからデータの読み出しが少なくと
も可能な共有メモリと、 前記送信側プロセスと受信側プロセスの間でデータの通
信を行うとき送信側プロセスが前記共有メモリに書き込
んだ通信対象となるデータの所在を示す情報を格納して
送信側プロセスから受信側プロセスに送信される送受信
キューと、 この送受信キューが前記受信側プロセスに送信されたと
きこれを通知する受信完了通知手段と、 前記受信側プロセスの側に配置され、送信完了通知手段
が前記送受信キューの送信が完了したことを通知したと
き送受信キューから前記通信対象となるデータの所在を
示す情報を取り出しこの取り出した情報を基にして前記
共有メモリから対応するデータを読み出すデータ読出手
段とを具備することを特徴とするプロセス間通信システ
ム。
1. A transmitting process as a data transmitting side, a receiving process as a data receiving side, and at least writing of data from the transmitting process and at least reading of data from the receiving process are possible. When performing data communication between the transmitting process and the receiving process, the shared memory stores information indicating the location of data to be communicated written in the shared memory by the transmitting process, and receives the information from the transmitting process. A transmission / reception queue to be transmitted to the receiving process; a reception completion notifying means for notifying the transmission / reception queue when the transmission / reception queue is transmitted to the receiving process; When the completion of the queue transmission is notified, the location of the data to be communicated is indicated from the transmission / reception queue. Interprocess communication system, characterized in that based on the retrieved information retrieves the information comprises a data reading means for reading the corresponding data from the shared memory.
【請求項2】 データの送信側としての送信側プロセス
と、 データの受信側としての受信側プロセスと、 システムの初期化時に送信側プロセスに割り当てられこ
の送信側プロセスが保持する送信側メモリ領域と、 前記送信側プロセスからデータの書き込みが少なくとも
可能で受信側プロセスからデータの読み出しが少なくと
も可能な共有メモリと、 前記送信側プロセスと受信側プロセスの間でデータの通
信を行うとき送信側プロセスが前記共有メモリに書き込
んだ通信対象となるデータの所在を示す情報を前記送信
側メモリ領域からコピーされて送信側プロセスから受信
側プロセスに送信される送受信キューと、 この送受信キューが前記受信側プロセスに送信されたと
きこれを通知する受信完了通知手段と、 前記受信側プロセスの側に配置され、受信完了通知手段
が前記送受信キューの送信が完了したことを通知したと
き送受信キューから前記通信対象となるデータの所在を
示す情報を取り出しこの取り出した情報を基にして前記
共有メモリから対応するデータを読み出すデータ読出手
段とを具備することを特徴とするプロセス間通信システ
ム。
2. A transmission-side process as a data transmission-side, a reception-side process as a data-reception-side, a transmission-side memory area allocated to the transmission-side process during system initialization and held by the transmission-side process. A shared memory in which at least data can be written from the sender process and at least data can be read from the receiver process, and when the sender process and the receiver process communicate data, A transmission / reception queue in which information indicating the location of communication target data written in the shared memory is copied from the transmission side memory area and transmitted from the transmission side process to the reception side process; and the transmission / reception queue is transmitted to the reception side process. And a reception completion notifying means for notifying this when the processing is performed, and arranged on the receiving side process side. When the reception completion notifying unit notifies that the transmission of the transmission / reception queue has been completed, information indicating the location of the data to be communicated is taken out of the transmission / reception queue and a response is made from the shared memory based on the extracted information. An inter-process communication system, comprising: data reading means for reading data.
【請求項3】 前記共有メモリに送信側プロセスから書
き込まれるデータは可変長であり、前記通信対象となる
データの所在を示す情報は前記共有メモリに格納された
そのデータの一端を示すアドレスとデータ量からなるこ
とを特徴とする請求項1または請求項2記載のプロセス
間通信システム。
3. The data written from the transmitting process to the shared memory has a variable length, and the information indicating the location of the data to be communicated is an address and data indicating one end of the data stored in the shared memory. 3. The inter-process communication system according to claim 1, wherein the communication system comprises an amount.
【請求項4】 前記共有メモリに送信側プロセスから書
き込まれるデータは固定長であり、前記通信対象となる
データの所在を示す情報は前記共有メモリに格納された
そのデータの一端を示すアドレスからなることを特徴と
する請求項1または請求項2記載のプロセス間通信シス
テム。
4. The data written from the transmitting process to the shared memory has a fixed length, and the information indicating the location of the data to be communicated comprises an address indicating one end of the data stored in the shared memory. The inter-process communication system according to claim 1 or 2, wherein:
【請求項5】 前記受信完了通知手段は2値のいずれか
の状態で送信の完了を示すフラグであることを特徴とす
る請求項1〜請求項3記載のプロセス間通信システム。
5. The inter-process communication system according to claim 1, wherein said reception completion notifying means is a flag indicating transmission completion in one of two states.
JP20551996A 1996-07-17 1996-07-17 Inter-process communication system Pending JPH1031616A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP20551996A JPH1031616A (en) 1996-07-17 1996-07-17 Inter-process communication system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP20551996A JPH1031616A (en) 1996-07-17 1996-07-17 Inter-process communication system

Publications (1)

Publication Number Publication Date
JPH1031616A true JPH1031616A (en) 1998-02-03

Family

ID=16508229

Family Applications (1)

Application Number Title Priority Date Filing Date
JP20551996A Pending JPH1031616A (en) 1996-07-17 1996-07-17 Inter-process communication system

Country Status (1)

Country Link
JP (1) JPH1031616A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002189607A (en) * 2000-12-22 2002-07-05 Nec Corp Memory managing method and information processor
KR100356919B1 (en) * 1999-07-19 2002-10-19 한국전자통신연구원 An interprocess communication method utilizing message queue combined with shared memory
JP2006285576A (en) * 2005-03-31 2006-10-19 Nec Corp Distributed processing system, and distributed processing method
JP2011193297A (en) * 2010-03-15 2011-09-29 Kyocera Mita Corp Data processing apparatus, and data processing program

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100356919B1 (en) * 1999-07-19 2002-10-19 한국전자통신연구원 An interprocess communication method utilizing message queue combined with shared memory
JP2002189607A (en) * 2000-12-22 2002-07-05 Nec Corp Memory managing method and information processor
JP2006285576A (en) * 2005-03-31 2006-10-19 Nec Corp Distributed processing system, and distributed processing method
JP2011193297A (en) * 2010-03-15 2011-09-29 Kyocera Mita Corp Data processing apparatus, and data processing program

Similar Documents

Publication Publication Date Title
US6115803A (en) Parallel computer which verifies direct data transmission between local memories with a send complete flag
JPH01277928A (en) Printer
CN107453845B (en) Response confirmation method and device
JPS5897944A (en) Data transfer system among microprocessors
JPH08241186A (en) Unit and method for buffer memory management
KR20080101636A (en) System and method for bridging file systems between two different processors in mobile phone
JPH1031616A (en) Inter-process communication system
JPH0196750A (en) Data processing system
CN109992560B (en) Communication method and communication system
JP3189269B2 (en) Network printer
JP3756215B2 (en) Interface controller and method
JPH087738B2 (en) Endian conversion method
JPH0546565A (en) Data processor
JP2853607B2 (en) Communication system between jobs
JPH05314061A (en) Bus interface control system
JP3056169B2 (en) Data transmission / reception method and method
JPH02230345A (en) Inter-device communication/cache coincidence processing system
JPH05233328A (en) Infoamation processing system for inter-process communication processing
JPH0115100B2 (en)
JPH06149703A (en) Message transfer controller
JPH10154115A (en) Information processor provided with lan controller having cache
JPH0359752A (en) Connection control device
JP2752834B2 (en) Data transfer device
JPH0817401B2 (en) LAN connection system
JPH0440551A (en) Data transfer system