JP2926630B2 - Interprocess communication method - Google Patents

Interprocess communication method

Info

Publication number
JP2926630B2
JP2926630B2 JP23930593A JP23930593A JP2926630B2 JP 2926630 B2 JP2926630 B2 JP 2926630B2 JP 23930593 A JP23930593 A JP 23930593A JP 23930593 A JP23930593 A JP 23930593A JP 2926630 B2 JP2926630 B2 JP 2926630B2
Authority
JP
Japan
Prior art keywords
data
message
buffer
serial number
processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP23930593A
Other languages
Japanese (ja)
Other versions
JPH0793169A (en
Inventor
尊和 小森
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
PII EFU YUU KK
Original Assignee
PII EFU YUU KK
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 PII EFU YUU KK filed Critical PII EFU YUU KK
Priority to JP23930593A priority Critical patent/JP2926630B2/en
Publication of JPH0793169A publication Critical patent/JPH0793169A/en
Application granted granted Critical
Publication of JP2926630B2 publication Critical patent/JP2926630B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

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 for performing communication between processes.

【0002】[0002]

【従来の技術】従来、複数のプロセスからある1つのプ
ロセスにデータを非同期に渡して処理依頼する場合、図
7に示すように、共用空間内にメッセージをつなぐメッ
セージキューと、処理依頼するデータを書き込んで渡す
ためのバッファを設け、各プロセスが非同期に当該バッ
ファにデータを書き込むと共にメッセージをメッセージ
キューにつないで処理依頼する。処理を行なうプロセス
は、メッセージキューの先頭からメッセージを取り出し
て該当するバッファからデータを読み出し、処理を行な
うことを繰り返す。以下図7の構成および動作を簡単に
説明する。
2. Description of the Related Art Conventionally, when data is asynchronously transferred from a plurality of processes to a certain process and processing is requested, as shown in FIG. 7, a message queue for connecting messages in a shared space and a data to be processed are stored in a shared space. A buffer for writing and passing is provided, and each process asynchronously writes data to the buffer and connects a message to a message queue to request processing. The process that performs processing repeats taking out a message from the head of the message queue, reading data from the corresponding buffer, and performing processing. Hereinafter, the configuration and operation of FIG. 7 will be briefly described.

【0003】図7は、従来技術の説明図を示す。図7に
おいて、プロセスA、B、Cは、非同期にデータの処理
依頼を行なう空間A、B、C内のそれぞれのプロセスで
ある。
FIG. 7 shows an explanatory diagram of the prior art. In FIG. 7, processes A, B, and C are processes in the spaces A, B, and C that request data processing asynchronously.

【0004】バッファA、B、Cは、共用空間内に設
け、プロセスA、B、Cがそれぞれデータを書き込むた
めに割り当てたそれぞれのバッファである。このバッフ
ァA、B、Cには、プロセスA、B、Cがそれぞれ最新
のデータを非同期に上書きする。
[0004] Buffers A, B, and C are buffers provided in the shared space and assigned by processes A, B, and C for writing data. The processes A, B, and C asynchronously overwrite the buffers A, B, and C with the latest data, respectively.

【0005】プロセスDは、プロセスA、B、Cから処
理依頼を受けたデータをバッファA、B、Cからそれぞ
れ読み出して処理(例えば表示処理)を行なうものであ
って、空間Dに設けたものである。
A process D is for reading out data requested to be processed by the processes A, B, and C from the buffers A, B, and C, and performing a process (for example, a display process). It is.

【0006】メッセージキューは、プロセスA、B、C
がそれぞれ処理依頼する内容およびデータを書き込むバ
ッファA、B、Cの先頭アドレスを設定したメッセージ
をつないで、プロセスDに処理依頼するためのものであ
って、共用空間に設けたものである。プロセスDは、当
該メッセージキューの先頭から順次メッセージを取り出
し、処理を行なう。
The message queues are processes A, B, C
Are connected to a message in which the contents of the processing request and the head addresses of the buffers A, B, and C for writing the data are connected, and the processing is requested to the process D, and is provided in the shared space. The process D sequentially retrieves messages from the head of the message queue and performs processing.

【0007】バッファA、B、Cは、プロセスA、B、
Cがそれぞれデータを上書きする領域であって、共用空
間内に設けたものである。次に、動作を説明する。
The buffers A, B, and C are processes A, B,
C is an area for overwriting data, and is provided in the shared space. Next, the operation will be described.

【0008】(1) プロセスAが処理依頼するデータ
をバッファAに書き込むと共に自プロセスAおよびバッ
ファAの先頭アドレスを設定した処理依頼をメッセージ
に書き込んでメッセージキューにつなぐことを非同期に
行なう。同様に、他のプロセスB、Cもデータをバッフ
ァB、Cに書き込むと共に自プロセスB、Cおよびバッ
ファB、Cの先頭アドレスをそれぞれ設定した処理依頼
をメッセージに書き込んでメッセージキューにつなぐこ
とを非同期にそれぞれ行なう。
(1) The process A writes data requested to be processed to the buffer A, and writes a process request in which the start address of the process A and the buffer A are set to a message and connects the message to a message queue asynchronously. Similarly, the other processes B and C also write data into the buffers B and C and write a processing request in which the start addresses of the own processes B and C and the buffers B and C are respectively set to a message and connect them to the message queue. Respectively.

【0009】(2) プロセスDがメッセージキューの
先頭から1つメッセージを取り外し、当該メッセージで
指示された先頭アドレスのバッファA、B、Cのいずれ
からデータを取り出し、メッセージで指示された処理
(例えば表示処理)を行なうことを繰り返す。
(2) The process D removes one message from the head of the message queue, extracts data from any of the buffers A, B, and C at the head address specified by the message, and performs processing specified by the message (for example, Display processing) is repeated.

【0010】以上のように、プロセスA、B、Cが非同
期にデータをバッファA、B、Cに書込み、プロセスD
がバッファA、B、Cから順次データを取り出して処理
(例えば表示処理)を行なうようにしていた。
As described above, processes A, B, and C write data asynchronously to buffers A, B, and C,
Has been designed to sequentially extract data from buffers A, B, and C and perform processing (eg, display processing).

【0011】[0011]

【発明が解決しようとする課題】上述した図7の構成に
よるプロセスA、B、Cが非同期にデータをバッファ
A、B、Cに書き込み、プロセスDが順番に取り出して
処理を行っていたのでは、プロセスDのデータ処理が何
らかの原因により遅れた場合(例えば外部I/Oなどの
アクセス待ちにより処理が遅れた場合など)、メッセー
ジキューにつながれたメッセージを取り出して処理を行
なうことが遅れてしまい、プロセスA、B、Cから非同
期に送られてきたバッファA、B、C上のデータをリア
ルタイムに処理できない、例えば画面上に現時刻のデー
タをリアルタイムに表示できないという問題が発生し
た。また、プロセスDの処理が一度遅れてメッセージキ
ューにメッセージが数多く滞留してしまうと、メッセー
ジキューにつながれたメッセージの数がなかなか減少し
なくて当該プロセスDの負荷が大の時間が長時間続いて
しまい他の処理を行えないと共に、リアルタイムに処理
できるようになるまでに多くの時間が必要になってしま
う問題もあった。
The processes A, B, and C according to the configuration shown in FIG. 7 described above asynchronously write data to the buffers A, B, and C, and the process D takes out the data in order to perform the processing. If the data processing of the process D is delayed for some reason (for example, if the processing is delayed due to waiting for access from an external I / O or the like), it is delayed to take out the message connected to the message queue and perform the processing. There has been a problem that the data on the buffers A, B, and C sent asynchronously from the processes A, B, and C cannot be processed in real time, for example, the data at the current time cannot be displayed on the screen in real time. In addition, if the process D is once delayed and many messages are accumulated in the message queue, the number of messages connected to the message queue does not readily decrease, and the load of the process D is large and a long time continues. As a result, other processing cannot be performed, and a lot of time is required before the processing can be performed in real time.

【0012】本発明は、これらの問題を解決するため、
各クライアントプロセスがバッファにデータと通番を書
き込むと共にメッセージにも通番を設定してメッセージ
キューにつないで処理依頼し、サーバプロセスがメッセ
ージキューから取り出したメッセージの通番とバッファ
上のデータの通番とが等しい場合にのみ処理を行い、等
しくないときに処理中止して最新のデータのみの処理を
行ない、依頼を受けたデータの処理をリアルタイムに行
なうと共にたとえメッセージキューに多くのメッセージ
が何らかの原因で滞留しても無駄な処理を中止して速や
かにデータをリアルタイムに処理する状態に戻すことを
目的としている。
The present invention has been developed to solve these problems.
Each client process writes the data and serial number to the buffer, sets the serial number for the message, connects to the message queue, requests processing, and the serial number of the message retrieved from the message queue by the server process is equal to the serial number of the data on the buffer. Perform processing only in the case, stop processing when they are not the same, process only the latest data, process the requested data in real time, and even if many messages stay in the message queue for some reason It is also intended to stop useless processing and quickly return to a state where data is processed in real time.

【0013】[0013]

【課題を解決するための手段】図1を参照して課題を解
決するための手段を説明する。図1において、クライア
ントプロセス1は、データの処理依頼するものである。
Means for solving the problem will be described with reference to FIG. In FIG. 1, a client process 1 requests data processing.

【0014】バッファ2は、共用空間に設け、各クライ
アントプロセス1がデータを書き込む領域である。メッ
セージ31は、処理依頼するデータのバッファ2上の先
頭アドレスおよびデータの通番を設定するものである。
The buffer 2 is provided in a shared space, and is an area where each client process 1 writes data. The message 31 sets the start address of the data to be processed on the buffer 2 and the serial number of the data.

【0015】メッセージキュー3は、メッセージ31を
つないで、サーバプロセス4に処理依頼するためのもの
である。サーバプロセス4は、メッセージキュー3の先
頭からメッセージ31を順次取り出し、当該メッセージ
31に設定されていた通番と、設定されていた先頭アド
レスのバッファ2のデータの通番が等しい場合にのみ処
理を行なうものである。
The message queue 3 connects the message 31 and requests the server process 4 for processing. The server process 4 sequentially retrieves the message 31 from the head of the message queue 3 and performs processing only when the serial number set in the message 31 is equal to the serial number of the data of the buffer 2 at the set head address. It is.

【0016】[0016]

【作用】本発明は、図1に示すように、各クライアント
プロセス1がバッファ2にデータおよび当該データの通
番を書き込むと共に、当該バッファ2の先頭アドレスお
よびデータの通番を設定したメッセージ31をメッセー
ジキュー3につなぎ、サーバプロセス4がメッセージキ
ュー3の先頭からメッセージ31を順次取り出し、この
取り出したメッセージ31内の通番と、先頭アドレスの
バッファ2内のデータの通番とが等しい場合にのみバッ
ファ2からデータを取り出して処理を行ない、等しくな
い場合に処理中止して次の処理に進むようにしている。
According to the present invention, as shown in FIG. 1, each client process 1 writes data and a serial number of the data in a buffer 2 and sends a message 31 in which a head address of the buffer 2 and a serial number of the data are set to a message queue. 3, the server process 4 sequentially retrieves the message 31 from the head of the message queue 3, and only when the serial number in the retrieved message 31 is equal to the serial number of the data in the buffer 2 at the head address, the data is read from the buffer 2. Is taken out and the process is performed. If the values are not equal, the process is stopped and the process proceeds to the next process.

【0017】また、バッファ2の先頭アドレスが固定の
場合に、クライアントプロセス1が通番を設定したメッ
セージ31をメッセージキュー3につなぎ、サーバプロ
セス4がメッセージ31から取り出した通番と、固定の
先頭アドレスのバッファ2内のデータの通番とが等しい
場合にのみバッファ2からデータを取り出して処理を行
ない、等しくない場合に処理中止して次の処理に進むよ
うにしている。
When the start address of the buffer 2 is fixed, the client process 1 connects the message 31 to which the serial number has been set to the message queue 3, and the server process 4 extracts the serial number extracted from the message 31 and the fixed start address. Only when the serial number of the data in the buffer 2 is equal, the data is extracted from the buffer 2 and the processing is performed. When the serial numbers are not equal, the processing is stopped and the processing proceeds to the next processing.

【0018】また、クライアントプロセス1として複数
のプロセスを設け、これら各プロセスが自プロセスID
と通番、更に必要に応じて先頭アドレスを設定したメッ
セージ31をメッセージキュー3につなぐようにしてい
る。
A plurality of processes are provided as the client process 1, and each of these processes has its own process ID.
, And a message 31 in which a start address is set if necessary is connected to the message queue 3.

【0019】従って、各クライアントプロセス1がバッ
ファ2にデータと通番を書き込むと共にメッセージ31
にも通番を設定してメッセージキュー3につないで処理
依頼し、サーバプロセス4がメッセージキュー3から取
り出したメッセージ31の通番とバッファ2上のデータ
の通番とが等しい場合にのみ処理を行い、等しくないと
きに処理中止して最新のデータのみの処理を行なうこと
により、依頼を受けたデータの処理をリアルタイムに行
なうと共にたとえメッセージキュー3に多くのメッセー
ジ31が何らかの原因で滞留しても無駄な処理を中止し
て速やかにデータをリアルタイムに処理する状態に戻す
ことが可能となる。
Therefore, each client process 1 writes the data and the serial number in the buffer 2 and the message 31
The server process 4 performs processing only when the serial number of the message 31 retrieved from the message queue 3 and the serial number of the data in the buffer 2 are equal. If there is no message, the processing of the requested data is performed in real time by canceling the processing and processing only the latest data, and even if many messages 31 stay in the message queue 3 for some reason, the processing is useless. Can be stopped and the data can be immediately returned to a state where it is processed in real time.

【0020】[0020]

【実施例】次に、図1から図6を用いて本発明の実施例
の構成および動作を順次詳細に説明する。
Next, the structure and operation of an embodiment of the present invention will be sequentially described in detail with reference to FIGS.

【0021】図1は、本発明のシステム構成図を示す。
図1において、クライアントプロセス1は、データの処
理をサーバプロセス4に非同期に依頼するものであっ
て、ここでは、例えば図示のようにプロセスA、プロセ
スB、プロセスCなどであり、それぞれ空間A、空間
B、空間Cなどと別空間に存在するものである。クライ
アントプロセス1であるプロセスA、プロセスB、プロ
セスCはそれぞれ送信処理11などから構成されるもの
である。
FIG. 1 shows a system configuration diagram of the present invention.
In FIG. 1, a client process 1 asynchronously requests data processing to a server process 4, and here, for example, includes processes A, B, and C as shown in FIG. It exists in a space different from the space B, the space C, and the like. The process A, the process B, and the process C that are the client processes 1 each include a transmission process 11 and the like.

【0022】送信処理11は、データおよび当該データ
の通番をバッファ2に書き込んだり、あるいはデータ変
化に関係なく新たな通番をバッファ2に書き込んだり
し、データの通番およびバッファ2の先頭アドレスなど
を設定したメッセージ31をメッセージキュー3につな
いだりなどするものである。
The transmission processing 11 writes data and a serial number of the data into the buffer 2 or writes a new serial number into the buffer 2 irrespective of data change, and sets a data serial number and a head address of the buffer 2. The message 31 is connected to the message queue 3 or the like.

【0023】バッファ2は、共用空間に設けたものであ
って、クライアントプロセス1であるプロセスA、プロ
セスB、プロセスCがデータおよび通番を書き込むもの
である。ここでは、プロセスA、プロセスB、プロセス
C用のバッファ2として固定先頭アドレスを持つバッフ
ァA、バッファB、バッファCを設けている。これらバ
ッファA、バッファB、バッファCには、図示のよう
に、通番およびデータを上書し、常に最新の通番および
データを書き込むようにしている。
The buffer 2 is provided in the shared space, and is used by the processes A, B, and C as the client processes 1 to write data and serial numbers. Here, buffers A, B, and C having fixed start addresses are provided as buffers 2 for processes A, B, and C. As shown in the figure, the serial numbers and data are overwritten in the buffers A, B, and C, and the latest serial numbers and data are always written.

【0024】メッセージキュー3は、バッファ2の先頭
アドレスおよび通番を設定したメッセージ31を非同期
につなぎ、処理順を管理するものである。サーバプロセ
ス4は、メッセージキュー3の先頭からメッセージ31
を順次取り出して処理を行なうものであって、受信処理
41などから構成されるものである。
The message queue 3 manages the processing order by asynchronously connecting the message 31 in which the start address and serial number of the buffer 2 are set. The server process 4 sends the message 31 from the top of the message queue 3
Are sequentially extracted and the processing is performed, and includes a reception processing 41 and the like.

【0025】受信処理41は、メッセージキュー3の先
頭からメッセージ31を取り出し、この取り出したメッ
セージ31に設定されていた通番と、設定されていた先
頭アドレスのバッファ2のデータの通番が等しい場合に
のみ処理(例えば画面上にデータを表示する処理)を行
なうものである。従って、バッファ2内のデータが上書
きされているか否かに関係なく、通番が等しい最新のデ
ータを当該バッファ2から取り出して処理を行なうもの
である。
The receiving process 41 extracts the message 31 from the head of the message queue 3 and only when the serial number set in the extracted message 31 is equal to the serial number of the data of the buffer 2 of the set head address. Processing (for example, processing for displaying data on a screen) is performed. Therefore, regardless of whether the data in the buffer 2 is overwritten, the latest data having the same serial number is taken out from the buffer 2 and processed.

【0026】以下順次詳細に説明する。図2は、本発明
のクライアントプロセスの送信処理フローチャートを示
す。図2において、S1は、バッファ2にデータをセッ
トする。これは、図1のクライアントプロセス1であ
る、例えばプロセスAの送信処理11が、サーバプロセ
ス4に処理依頼する対象のデータを、バッファ2内の当
該プロセスA用のバッファAに上書きする(セットす
る)。
The details will be sequentially described below. FIG. 2 shows a flowchart of the transmission process of the client process of the present invention. In FIG. 2, S1 sets data in the buffer 2. This is because, for example, the transmission process 11 of the process A, which is the client process 1 in FIG. 1, overwrites (sets) the data to be processed by the server process 4 in the buffer A for the process A in the buffer 2. ).

【0027】S2は、バッファ2にデータの通番をセッ
トする。これは、S1で、例えばプロセスAの送信処理
11がバッファAにデータをセットしたことに続いて、
当該バッファAにデータの通番を上書きする(セットす
る)。
In step S2, a data serial number is set in the buffer 2. This is because, in S1, for example, after the transmission processing 11 of the process A sets data in the buffer A,
The serial number of data is overwritten (set) in the buffer A.

【0028】S3は、メッセージ作成(データ処理要
求)する。これは、例えばプロセスAが、後述する図4
のメッセージ31に示すように、データ処理要求(種
別)、A(送信元プロセスID)、バッファの先頭アド
レス、およびデータの通番を設定したメッセージ31を
作成する。
In step S3, a message is created (data processing request). This is because, for example, the process A is performed as shown in FIG.
As shown in the message 31, the message 31 in which the data processing request (type), A (source process ID), the head address of the buffer, and the serial number of the data are set.

【0029】S4は、メッセージ送信する(メッセージ
キュー3につなぐ)。これは、S3で作成したメッセー
ジ31を、メッセージキュー3の末尾につなぐ(エンキ
ューする)。これにより、メッセージ31を送信依頼し
たこととなる。
In step S4, a message is transmitted (connected to the message queue 3). This connects (enqueues) the message 31 created in S3 to the end of the message queue 3. Thus, the transmission of the message 31 is requested.

【0030】以上によって、クライアントプロセス1に
おいて、送信処理11が処理依頼しようとするデータお
よび当該データの通番をバッファ2に上書きした後、当
該バッファ2の先頭アドレスおよびデータの通番をメッ
セージ31に設定してメッセージキュー3の末尾につな
ぎ、送信依頼する。これらにより、バッファ2には、常
に最新のデータおよび当該データの通番を上書きし、メ
ッセージキュー3には、上書きしたときのメッセージ3
1を順次メッセージキュー3の末尾につないで送信依頼
することとなる。
As described above, in the client process 1, after the transmission process 11 overwrites the data to be processed and the serial number of the data in the buffer 2, the head address of the buffer 2 and the serial number of the data are set in the message 31. To the end of the message queue 3 to request transmission. As a result, the buffer 2 always overwrites the latest data and the serial number of the data, and the message queue 3 stores the message 3
1 are sequentially connected to the end of the message queue 3 to request transmission.

【0031】図3は、本発明のバッファ内容例を示す。
これは、図1の共用空間に設けたバッファ2の例であ
る。ここでは、先頭アドレスaから所定サイズLの領域
がバッファA(プロセスA用のバッファ2)の領域であ
って、図示のようにデータの通番aおよびデータを上書
きする。同様に、先頭アドレスb、cから所定サイズL
の領域がバッファB、C(プロセスB、C用のバッファ
2)の領域であって、図示のようにデータの通番b、c
およびデータをそれぞれ上書きする。ここで、サイズL
は任意にそれぞれ設定してもよい。
FIG. 3 shows an example of the buffer contents of the present invention.
This is an example of the buffer 2 provided in the shared space of FIG. Here, an area of a predetermined size L from the start address a is an area of the buffer A (buffer 2 for the process A), and the data serial number a and the data are overwritten as shown in the figure. Similarly, a predetermined size L from the start addresses b and c
Are areas of buffers B and C (buffer 2 for processes B and C), and data serial numbers b and c as shown in the figure.
And data are overwritten respectively. Where size L
May be set arbitrarily.

【0032】図4は、本発明のメッセージ内容例を示
す。これは、図1の共用空間に設けたメッセージキュー
3につなぐメッセージ31の例である。ここでは、図示
の下記のような情報を設定する。
FIG. 4 shows an example of message contents according to the present invention. This is an example of the message 31 connected to the message queue 3 provided in the shared space of FIG. Here, the following information shown in the figure is set.

【0033】 ・種別:例えば“処理要求”、“ステータス通知” ・送信元プロセスID:例えばプロセスAの場合には
“A” ・バッファの先頭アドレス:例えばプロセスAの場合に
は、先頭アドレスa(図3参照)。
• Type: For example, “Processing request”, “Status notification” • Source process ID: For example, “A” for process A • Start address of buffer: For example, for process A, start address a ( (See FIG. 3).

【0034】データの通番:例えばプロセス毎のシーケ
ンシャル番号(1、2、3・・・) 図5は、本発明のサーバプロセスの受信処理フローチャ
ートを示す。
Data serial number: for example, a sequential number for each process (1, 2, 3,...) FIG. 5 is a flowchart showing the receiving process of the server process of the present invention.

【0035】図5において、S11は、メッセージを受
信する。これは、図1のサーバプロセス4の受信処理4
1がメッセージキュー3の先頭からメッセージ31を1
つ取り出す。
In FIG. 5, S11 receives a message. This is the reception process 4 of the server process 4 in FIG.
1 is the message 31 from the top of the message queue 3
Take out one.

【0036】S12は、メッセージ31中のデータの通
番Xを取得する。これは、S11で取り出したメッセー
ジ31中のデータの通番Xを取得する(図4参照)。S
13は、メッセージ31で指定されたバッファ2中のデ
ータの通番を取得する。これは、S11で取り出したメ
ッセージ31中に設定されていた先頭アドレスのバッフ
ァ2の位置からデータの通番Yを取得する。
At S12, the serial number X of the data in the message 31 is obtained. This acquires the serial number X of the data in the message 31 extracted in S11 (see FIG. 4). S
13 obtains the serial number of the data in the buffer 2 specified by the message 31. That is, the data serial number Y is obtained from the position of the buffer 2 at the head address set in the message 31 extracted in S11.

【0037】S14は、X=Yか判別する。YESの場
合には、メッセージ31中の通番Xとバッファ2中のデ
ータの通番Yとが等しく最新のデータに対するメッセー
ジ31と判明したので、S15でバッファ2中のデータ
を取得し、S16でこの取得したデータの処理を行なう
(例えば後述する図6に示すように、画面上に表示す
る)。一方、S14のNOの場合には、最新のデータに
対するメッセージ31でないと判明したので、S11に
戻り、メッセージキュー3から次のメッセージ31を取
り出し、S12以降を繰り返す。
In S14, it is determined whether X = Y. In the case of YES, the serial number X in the message 31 and the serial number Y of the data in the buffer 2 are equal, and it is determined that the message 31 is for the latest data. Therefore, the data in the buffer 2 is obtained in S15, and the obtained data is obtained in S16. The data is processed (for example, displayed on a screen as shown in FIG. 6 described later). On the other hand, in the case of NO in S14, it is determined that the message is not the message 31 for the latest data, so the process returns to S11, retrieves the next message 31 from the message queue 3, and repeats S12 and subsequent steps.

【0038】以上によって、サーバプロセス4中の受信
処理41がメッセージキュー3の先頭からメッセージ3
1を取り出し、このメッセージ31に設定されていた通
番と、設定されていた先頭アドレスのバッファ2のデー
タの通番とを比較して一致したときに最新のデータと判
明したので、当該データの処理を行い、一方、一致しな
かったときに古いデータと判明したのでデータの処理を
中止して次のメッセージ31の受信処理に進む。これら
により、古いメッセージ31の処理を中止して次のメッ
セージ31の処理に進み、最新のデータの処理のみを行
ない、データ処理のリアルタイム性を大幅に向上させる
ことが可能となった。
As described above, the reception process 41 in the server process 4 starts from the top of the message queue 3
1 is taken out, the serial number set in the message 31 is compared with the serial number of the data in the buffer 2 of the set start address, and when they match, it is determined that the data is the latest data. On the other hand, when they do not match, it is determined that the data is old, so the data processing is stopped and the process proceeds to the reception processing of the next message 31. As a result, the processing of the old message 31 is stopped, the processing of the next message 31 is proceeded, only the latest data is processed, and the real-time performance of the data processing can be greatly improved.

【0039】図6は、本発明の応用例を示す。これは、
対象物が時間の経過に従い、個数や人数などが変化する
データをクライアントプロセス1が非同期にバッファ2
およびメッセージキュー3を用いてサーバプロセス4に
処理依頼し、サーバプロセス4が画面上にその個数や人
数を表示する様子を模式的に表したものである。横軸が
時間軸である。
FIG. 6 shows an application example of the present invention. this is,
The client process 1 asynchronously buffers the data in which the number or the number of objects changes with the passage of time.
And a process request to the server process 4 by using the message queue 3 and the server process 4 displaying the number and the number of people on the screen. The horizontal axis is the time axis.

【0040】図6の(a)は、実データを示す。これ
は、図1のクライアントプロセス1が対象物について検
出した対象物の個数や人数などの変化を示す。ここで
は、 ・時刻t1:10 ・時刻t2:15 ・時刻t3:20 と変化したデータを検出したので、これらのデータを検
出した時に即座にバッファ2に上書きおよび通番を設定
してその毎に通番とバッファ2の先頭アドレスを設定し
たメッセージ31をメッセージキュー3につないで順次
送信依頼する。
FIG. 6A shows actual data. This indicates a change in the number or number of objects detected by the client process 1 in FIG. Here, the following data is detected: time t1: 10, time t2: 15, time t3: 20. When such data is detected, the data is immediately overwritten in the buffer 2 and a serial number is set. And the message 31 in which the head address of the buffer 2 is set is connected to the message queue 3 and the transmission is sequentially requested.

【0041】図6の(b)は、実時間を示す。これは、
図6の(a)の実データを検出した実時間がt1、t
2、t3であることを表す。図6の(c)は、従来処理
(図7のプロセスDによる処理)を示す。この従来の図
7のプロセスDによる処理では、時刻t1のデータ“1
0”については最初であるので、実時間と同じ時間のと
きに“10”として表示できる。しかし、時刻t2のデ
ータ“15”については、メッセージキュー3につなが
れていた他のメッセージ31の処理を行っていたため
に、Δt2だけ遅れて当該“15”が図示のように表示
できる。更に、時刻t3のデータ“20”については、
メッセージキュー3につながれていた他のメッセージ3
1の処理を行っていたために、Δt3と大幅に遅れて当
該“20”が図示のように表示されることとなり、特に
時刻t3のデータ“20”は、リアルタイムに表示され
ているとは言えなくなる。
FIG. 6B shows the real time. this is,
The actual times at which the actual data of FIG.
2, t3. FIG. 6C shows conventional processing (processing by the process D in FIG. 7). In the conventional process D of FIG. 7, the data “1” at time t1
Since “0” is the first time, it can be displayed as “10” at the same time as the real time.However, for data “15” at time t2, the processing of the other messages 31 connected to the message queue 3 is not performed. Since the operation has been performed, the “15” can be displayed as shown in the figure with a delay of Δt 2. Further, as for the data “20” at the time t3,
Other messages 3 connected to message queue 3
Since the processing of No. 1 has been performed, "20" is displayed as shown in the figure, which is significantly delayed from Δt3. In particular, the data "20" at time t3 cannot be said to be displayed in real time. .

【0042】図6の(d)は、本発明の処理(サーバプ
ロセス4による処理)を示す。この本発明のサーバプロ
セス4による処理では、時刻t1のデータ“10”につ
いては最初であるので、実時間と同じ時間のときに“1
0”として表示できる。続いて他のメッセージ31の処
理を終わり、時刻t3を若干経過した時点でメッセージ
キュー3から時刻t2のメッセージ31を取り出した場
合、バッファ2中のデータおよび通番が時刻t3のもの
に上書きされているので、当該時刻t2のデータ“1
5”の表示処理を中止し、次の処理に進む。そして、メ
ッセージキュー3から時刻t3のメッセージ31を取り
出した場合、バッファ2中のデータおよび通番が時刻t
3のものであって、一致するので、当該時刻t3のデー
タ“20”の表示処理を行い、に示すようにリアルタ
イム処理(表示)できる。
FIG. 6D shows the processing of the present invention (processing by the server process 4). In the processing by the server process 4 of the present invention, since the data “10” at the time t1 is the first, the “1” at the same time as the real time
0 ". When the processing of the other message 31 is completed and the message 31 at the time t2 is taken out of the message queue 3 a little after the time t3, the data and the serial number in the buffer 2 are changed to the time t3. Since the data "1" has been overwritten, the data "1"
5 "is stopped, and the process proceeds to the next process. When the message 31 at the time t3 is taken out from the message queue 3, the data and the serial number in the buffer 2 are changed to the time t.
3 and coincide with each other, the display processing of the data “20” at the time t3 is performed, and the real-time processing (display) can be performed as shown in FIG.

【0043】尚、対象物としては、入場者数、交通量、
予約状況、温度、その他(数字などで監視できる物)が
あり、これらの対象物の数量や人数などをリアルタイム
に表示などする。
The objects include the number of visitors, traffic volume,
There are reservation status, temperature, and others (things that can be monitored by numbers etc.), and the quantity and number of these objects are displayed in real time.

【0044】[0044]

【発明の効果】以上説明したように、本発明によれば、
各クライアントプロセス1がバッファ2にデータと通番
を書き込むと共にメッセージ31にも通番を設定してメ
ッセージキュー3につないで処理依頼し、サーバプロセ
ス4がメッセージキュー3から取り出したメッセージ3
1の通番とバッファ2上のデータの通番とが等しい場合
にのみ処理を行い、等しくないときに処理中止して最新
のデータのみの処理を行なう構成を採用しているため、
依頼を受けたデータの処理をリアルタイムに行なうと共
にたとえメッセージキュー3に多くのメッセージ31が
何らかの原因で滞留しても無駄な処理を中止して速やか
にデータをリアルタイムに処理する状態に戻すことがで
きる。
As described above, according to the present invention,
Each client process 1 writes data and a serial number in the buffer 2, sets a serial number in the message 31, connects to the message queue 3 and requests processing, and the server process 4 retrieves the message 3 from the message queue 3.
Since the processing is performed only when the serial number of No. 1 and the serial number of the data on the buffer 2 are equal, and when the serial numbers are not equal, the processing is stopped and only the latest data is processed.
The requested data is processed in real time, and even if many messages 31 stay in the message queue 3 for some reason, useless processing can be stopped and the data can be promptly returned to the real time processing state. .

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

【図1】本発明のシステム構成図である。FIG. 1 is a system configuration diagram of the present invention.

【図2】本発明のクライアントプロセスの送信処理フロ
ーチャートである。
FIG. 2 is a transmission flowchart of a client process of the present invention.

【図3】本発明のバッファ内容例である。FIG. 3 is an example of buffer contents according to the present invention.

【図4】本発明のメッセージ内容例である。FIG. 4 is an example of a message content according to the present invention.

【図5】本発明のサーバプロセスの受信処理フローチャ
ートである。
FIG. 5 is a reception processing flowchart of a server process of the present invention.

【図6】本発明の応用例である。FIG. 6 is an application example of the present invention.

【図7】従来技術の説明図である。FIG. 7 is an explanatory diagram of a conventional technique.

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

1:クライアントプロセス 11:送信処理 2:バッファ 3:メッセージキュー 31:メッセージ 4:サーバプロセス 41:受信処理 1: client process 11: transmission process 2: buffer 3: message queue 31: message 4: server process 41: reception process

───────────────────────────────────────────────────── フロントページの続き (58)調査した分野(Int.Cl.6,DB名) G06F 9/46 G06F 15/16 G06F 15/00 G06F 11/30 G06F 11/32 G06F 3/14 G06F 12/00 G06F 13/00 G09G 5/00 ──────────────────────────────────────────────────の Continued on the front page (58) Fields surveyed (Int.Cl. 6 , DB name) G06F 9/46 G06F 15/16 G06F 15/00 G06F 11/30 G06F 11/32 G06F 3/14 G06F 12 / 00 G06F 13/00 G09G 5/00

Claims (3)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】プロセス間で通信を行うプロセス間通信方
式において、 処理依頼する各クライアントプロセスがデータを上書き
するおよび当該データを上書きする毎に変えた通番を設
定する各クライアントプロセス毎に設けたバッファと、 このバッファに上書きしたデータの先頭アドレスおよび
上記通番を設定したメッセージをつなぐメッセージキュ
ーとを共用空間に設け、 依頼された処理を行なうサーバプロセスが上記メッセー
ジキューの先頭から取り出したメッセージの通番と、設
定されていた先頭アドレスのバッファ内のデータの通番
とが等しい場合にのみ当該バッファからデータを取り出
して処理を行い、等しくない場合に処理中止して上記メ
ッセージキューから次の先頭のメッセージを取り出す
うに構成したことを特徴とするプロセス間通信方式。
An inter-process communication method for performing communication between processes, wherein a buffer provided for each client process in which each client process requesting processing overwrites data and sets a serial number changed each time the data is overwritten. And a message queue for connecting the head address of the data overwritten in this buffer and the message set with the serial number in the shared space, and the server process performing the requested processing sets the serial number of the message extracted from the head of the message queue. performs processing retrieves the data from the buffer only if equal and serial number of the data in the buffer start address has been set, the main treated discontinued when unequal
An inter-process communication method, wherein a next top message is retrieved from a message queue .
【請求項2】請求項1において、バッファの先頭アドレ
スが固定の場合に、上記通番を設定したメッセージをメ
ッセージキューにつなぐように構成したこを特徴とする
プロセス間通信方式。
2. The inter-process communication method according to claim 1, wherein the message set with the serial number is connected to a message queue when the head address of the buffer is fixed.
【請求項3】上記クライアントプロセスは複数のプロセ
スからなり、これら各プロセスが自プロセスIDと通
番、更に必要に応じて先頭アドレスを設定したメッセー
ジを上記メッセージキューにつなぐように構成したこと
を特徴とする請求項1あるいは請求項2記載のプロセス
間通信方式。
3. The method according to claim 1, wherein the client process comprises a plurality of processes, each of which is connected to the message queue with a message having its own process ID, a serial number, and, if necessary, a head address set. The inter-process communication method according to claim 1 or 2, wherein
JP23930593A 1993-09-27 1993-09-27 Interprocess communication method Expired - Fee Related JP2926630B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP23930593A JP2926630B2 (en) 1993-09-27 1993-09-27 Interprocess communication method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP23930593A JP2926630B2 (en) 1993-09-27 1993-09-27 Interprocess communication method

Publications (2)

Publication Number Publication Date
JPH0793169A JPH0793169A (en) 1995-04-07
JP2926630B2 true JP2926630B2 (en) 1999-07-28

Family

ID=17042747

Family Applications (1)

Application Number Title Priority Date Filing Date
JP23930593A Expired - Fee Related JP2926630B2 (en) 1993-09-27 1993-09-27 Interprocess communication method

Country Status (1)

Country Link
JP (1) JP2926630B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100551171B1 (en) * 1999-03-15 2006-02-13 유티스타콤코리아 유한회사 Method for processig reception of packet in inter-processor packet communication for digital mobile communication system
KR100464910B1 (en) * 2001-12-26 2005-01-05 유티스타콤코리아 유한회사 A telecommunication apparatus among the data process in a dispersive process circumstances and a telecommunicational method thereof
US8332866B2 (en) * 2006-11-29 2012-12-11 Qualcomm Incorporated Methods, systems, and apparatus for object invocation across protection domain boundaries

Also Published As

Publication number Publication date
JPH0793169A (en) 1995-04-07

Similar Documents

Publication Publication Date Title
US6810470B1 (en) Memory request interlock
DE69625826T2 (en) MECHANISM FOR DYNAMIC TRANSFERRED TRANSACTIONS
JPH10504665A (en) Method and apparatus for maintaining transaction order and supporting delayed response in a bus bridge
JPH086855A (en) Memory
JP3010400B2 (en) Shared memory control method and shared memory control device
US20040221075A1 (en) Method and interface for improved efficiency in performing bus-to-bus read data transfers
CN112099970A (en) Video data processing method, device, equipment and storage medium
KR20040104467A (en) Most eligible server in a common work queue environment
US7155492B2 (en) Method and system for caching network data
JP2926630B2 (en) Interprocess communication method
JPH07210519A (en) Data transfer control method and transmission/reception controller
US6430646B1 (en) Method and apparatus for interfacing a processor with a bus
JPH07239808A (en) Distributed data managing system
US5706513A (en) System and method for queuing an retrieving data objects to and from a shared storage medium
JP2792866B2 (en) Buffer pool pre-expansion device
US5706512A (en) Computer program product for queuing and retrieving data objects to and from a shared storage medium
JP2002251373A (en) Network system and network terminal
JP3016788B2 (en) Device communication / cache matching processing method
JP2002024035A (en) Device and method for inter-process communication
JPH07168789A (en) Sending system for event message
JP3307331B2 (en) Network file system data transfer method
JPH09259023A (en) Backup method for on-line data base system
JPS62209611A (en) Display system for crt screen
JPH06214533A (en) High-speed screen display system
JP3251198B2 (en) Data transfer device

Legal Events

Date Code Title Description
S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313532

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees