JPH0793169A - Inter-process communication system - Google Patents

Inter-process communication system

Info

Publication number
JPH0793169A
JPH0793169A JP23930593A JP23930593A JPH0793169A JP H0793169 A JPH0793169 A JP H0793169A JP 23930593 A JP23930593 A JP 23930593A JP 23930593 A JP23930593 A JP 23930593A JP H0793169 A JPH0793169 A JP H0793169A
Authority
JP
Japan
Prior art keywords
data
message
buffer
processing
serial number
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.)
Granted
Application number
JP23930593A
Other languages
Japanese (ja)
Other versions
JP2926630B2 (en
Inventor
Takakazu Komori
尊和 小森
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.)
PFU Ltd
Original Assignee
PFU 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 PFU Ltd filed Critical PFU Ltd
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

Abstract

PURPOSE:To perform the processing of requested data in real time and to quickly return a state to the one to process the data in real time by interrupting futile processing even when a large number of messages reside due to an unknown factor in a message queue. CONSTITUTION:This system is constituted in such a way that a buffer 2 provided at every client process 1 in which each client process 1 sets data and a consecutive number, and the message queue to connect the leading address of the data overwritten on the buffer 2 to the message 31 on which the consecutive number is set are provided at shared space, and processing to fetch the data from the buffer 2 is performed only when the consecutive number of the message 31 taken out from the forefront of the message queue 3 by a server process 4 is not equal to that of the data in the buffer 2 at the leading address, and the next processing is started by interrupting the processing when noncoincidence is obtained between them.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、プロセス間で通信を行
なうプロセス間通信方式に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an interprocess communication system for communicating 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 single process and a processing request is made, as shown in FIG. 7, a message queue for connecting messages in a shared space and data to be processed are provided. A buffer for writing and passing is provided, and each process asynchronously writes data to the buffer and connects the message to the message queue to request processing. The process for performing the process repeatedly takes out the message from the head of the message queue, reads the data from the corresponding buffer, and performs the process. The configuration and operation of FIG. 7 will be briefly described below.

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

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

【0005】プロセスDは、プロセスA、B、Cから処
理依頼を受けたデータをバッファA、B、Cからそれぞ
れ読み出して処理(例えば表示処理)を行なうものであ
って、空間Dに設けたものである。
The process D reads data from each of the buffers A, B, and C for which processing has been requested by the processes A, B, and C, and performs processing (for example, display processing). The process D is provided in the space D. Is.

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

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

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

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

【0010】以上のように、プロセスA、B、Cが非同
期にデータをバッファA、B、Cに書込み、プロセスD
がバッファA、B、Cから順次データを取り出して処理
(例えば表示処理)を行なうようにしていた。
As described above, the processes A, B, and C asynchronously write data in the buffers A, B, and C, and the process D.
In this case, the data is sequentially fetched from the buffers A, B and C and processed (for example, display processing).

【0011】[0011]

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

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

【0013】[0013]

【課題を解決するための手段】図1を参照して課題を解
決するための手段を説明する。図1において、クライア
ントプロセス1は、データの処理依頼するものである。
[Means for Solving the Problems] Means for solving the problems 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 an area provided in the shared space and in which 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 messages 31 and requests the server process 4 for processing. The server process 4 sequentially takes out the message 31 from the head of the message queue 3 and performs processing only when the serial number set in the message 31 and the serial number of the data in the buffer 2 at the set start address are equal. 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 into the buffer 2, and at the same time, a message 31 in which the start address of the buffer 2 and the serial number of the data are set is message queued. 3, the server process 4 sequentially fetches the message 31 from the head of the message queue 3, and the data from the buffer 2 is read only when the serial number in the fetched message 31 and the serial number of the data in the buffer 2 at the head address are equal. Is taken out and processed. If they are not equal, the process is stopped and the next process is performed.

【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 for which a serial number is set to the message queue 3, and the server process 4 extracts the serial number from the message 31 and the fixed start address. Only when the serial number of the data in the buffer 2 is the same, the data is taken out from the buffer 2 and the processing is performed. When they are not the same, the processing is stopped and the next processing is performed.

【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.
A message 31 having a serial number, a serial number, and a start address 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 serial number in the buffer 2 and sends the message 31.
A serial number is also set to connect to the message queue 3 to request processing, and the process is performed only when the serial number of the message 31 fetched from the message queue 3 by the server process 4 and the serial number of the data in the buffer 2 are equal, and are equal. By stopping the processing when there is no data, and processing only the latest data, the requested data is processed in real time, and even if many messages 31 remain in the message queue 3 for some reason, it is a wasteful processing. It is possible to stop the operation and quickly return to the state of processing the data in real time.

【0020】[0020]

【実施例】次に、図1から図6を用いて本発明の実施例
の構成および動作を順次詳細に説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Next, the construction and operation of an embodiment of the present invention will be 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, the client process 1 requests the server process 4 to process data asynchronously. Here, for example, as shown in the figure, the process A, the process B, the process C, etc. 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, which are the client processes 1, are each composed of the transmission process 11 and the like.

【0022】送信処理11は、データおよび当該データ
の通番をバッファ2に書き込んだり、あるいはデータ変
化に関係なく新たな通番をバッファ2に書き込んだり
し、データの通番およびバッファ2の先頭アドレスなど
を設定したメッセージ31をメッセージキュー3につな
いだりなどするものである。
The transmission process 11 writes the data and the serial number of the data to the buffer 2, or writes a new serial number to the buffer 2 regardless of the data change, and sets the data serial number and the start 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 the processes A, B, and C which are the client processes 1 write data and serial numbers. Here, as the buffers 2 for the process A, the process B, and the process C, the buffer A, the buffer B, and the buffer C having a fixed start address are provided. 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 messages 31 in which the start address and the serial number of the buffer 2 are set. The server process 4 receives the message 31 from the head of the message queue 3.
Are sequentially taken out and processed, and are composed of a reception process 41 and the like.

【0025】受信処理41は、メッセージキュー3の先
頭からメッセージ31を取り出し、この取り出したメッ
セージ31に設定されていた通番と、設定されていた先
頭アドレスのバッファ2のデータの通番が等しい場合に
のみ処理(例えば画面上にデータを表示する処理)を行
なうものである。従って、バッファ2内のデータが上書
きされているか否かに関係なく、通番が等しい最新のデ
ータを当該バッファ2から取り出して処理を行なうもの
である。
The receiving process 41 takes out 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 at the set start address. Processing (for example, processing of displaying data on the screen) is performed. Therefore, regardless of whether the data in the buffer 2 has been 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 transmission processing flowchart of the client process of the present invention. In FIG. 2, S1 sets data in the buffer 2. This is the client process 1 of FIG. 1, for example, the transmission process 11 of the process A 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 S2, the serial number of data is set in the buffer 2. This is, for example, after the transmission processing 11 of the process A sets data in the buffer A in S1,
The serial number of the 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 shown in FIG.
Message 31 in which the data processing request (type), A (transmission source process ID), the buffer start address, and the data serial number are set.

【0029】S4は、メッセージ送信する(メッセージ
キュー3につなぐ)。これは、S3で作成したメッセー
ジ31を、メッセージキュー3の末尾につなぐ(エンキ
ューする)。これにより、メッセージ31を送信依頼し
たこととなる。
In S4, the 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. As a result, 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 data to be requested by the transmission processing 11 and the serial number of the data are overwritten in the buffer 2, the start 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 latest data and the serial number of the data are always overwritten in the buffer 2, and the message 3 at the time of overwriting is written in the message queue 3.
1 is 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 in FIG. Here, the area of the predetermined size L from the start address a is the area of the buffer A (buffer 2 for the process A), and the serial number a of the data and the data are overwritten as shown in the figure. Similarly, from the start addresses b and c to a predetermined size L
Area is an area of buffers B and C (buffers 2 for processes B and C), and data serial numbers b and c as shown in the figure.
And overwrite the data respectively. Where size L
May be set individually.

【0032】図4は、本発明のメッセージ内容例を示
す。これは、図1の共用空間に設けたメッセージキュー
3につなぐメッセージ31の例である。ここでは、図示
の下記のような情報を設定する。
FIG. 4 shows an example of message contents of the present invention. This is an example of the message 31 connected to the message queue 3 provided in the shared space in 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 shows a reception process flowchart of the server process of the present invention.

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

【0036】S12は、メッセージ31中のデータの通
番Xを取得する。これは、S11で取り出したメッセー
ジ31中のデータの通番Xを取得する(図4参照)。S
13は、メッセージ31で指定されたバッファ2中のデ
ータの通番を取得する。これは、S11で取り出したメ
ッセージ31中に設定されていた先頭アドレスのバッフ
ァ2の位置からデータの通番Yを取得する。
In step S12, the serial number X of the data in the message 31 is acquired. This acquires the serial number X of the data in the message 31 extracted in S11 (see FIG. 4). S
13 acquires the serial number of the data in the buffer 2 designated by the message 31. This acquires the serial number Y of data from the position of the buffer 2 of 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 step S14, it is determined whether X = Y. In the case of YES, since 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 found that the message 31 is the latest data, the data in the buffer 2 is acquired in S15, and this acquisition is performed in S16. The processed data is processed (for example, displayed on the screen as shown in FIG. 6 described later). On the other hand, in the case of NO in S14, it is found that the message 31 is not the latest data, so the process returns to S11, the next message 31 is taken out from the message queue 3, and S12 and subsequent steps are repeated.

【0038】以上によって、サーバプロセス4中の受信
処理41がメッセージキュー3の先頭からメッセージ3
1を取り出し、このメッセージ31に設定されていた通
番と、設定されていた先頭アドレスのバッファ2のデー
タの通番とを比較して一致したときに最新のデータと判
明したので、当該データの処理を行い、一方、一致しな
かったときに古いデータと判明したのでデータの処理を
中止して次のメッセージ31の受信処理に進む。これら
により、古いメッセージ31の処理を中止して次のメッ
セージ31の処理に進み、最新のデータの処理のみを行
ない、データ処理のリアルタイム性を大幅に向上させる
ことが可能となった。
As described above, the reception process 41 in the server process 4 starts the message 3 from the head of the message queue 3.
1 is taken out, and the serial number set in this message 31 is compared with the serial number of the data of the buffer 2 at the set start address, and when they match, the latest data is found. On the other hand, when they do not match, it is determined that the data is old data, so the processing of the data is stopped and the process proceeds to the reception process of the next message 31. As a result, the processing of the old message 31 is stopped and the processing of the next message 31 is started, only the latest data is processed, and the real-time property of 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 of objects, the number of people, etc. change as time passes.
Also, the process of requesting the server process 4 using the message queue 3 and displaying the number and the number of the server process 4 on the screen is schematically shown. 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 changes in the number of objects and the number of objects detected by the client process 1 in FIG. Here, since the data changed as: time t1: 10 time t2: 15 time t3: 20 is detected, when these data are detected, the buffer 2 is immediately overwritten and the serial number is set, and the serial number is set for each time. Then, the message 31 in which the top address of the buffer 2 is set is connected to the message queue 3 and 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 time at which the actual data in (a) of FIG. 6 is detected is t1, t
2 and t3. FIG. 6C shows the conventional processing (processing by the process D in FIG. 7). In the conventional processing by the process D of FIG. 7, 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, regarding the data "15" at time t2, the processing of another message 31 connected to the message queue 3 is performed. Since it has been performed, the relevant “15” can be displayed as shown in the figure with a delay of Δt 2. Further, regarding the data “20” at the time t3,
Other message 3 connected to message queue 3
Since the process 1 is performed, the "20" is displayed as shown in the figure with a large delay from Δt3, and 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, the data “10” at the time t1 is the first time, so that “1” is set at the same time as the real time.
If the message 31 at the time t2 is taken out from the message queue 3 just after the time t3, the data and the serial number of the buffer 2 at the time t3 are displayed. The data "1" at the time t2 is overwritten by the data.
The display process of 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 in the buffer 2 and the serial number are at the time t.
Since they are No. 3 and match, the display processing of the data “20” at the time t3 can be performed and the real-time processing (display) can be performed as shown in.

【0043】尚、対象物としては、入場者数、交通量、
予約状況、温度、その他(数字などで監視できる物)が
あり、これらの対象物の数量や人数などをリアルタイム
に表示などする。
The objects include the number of visitors, traffic volume,
There are reservation status, temperature, etc. (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 the data and serial number in the buffer 2, sets a serial number also 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 1 and the serial number of the data in the buffer 2 are equal, and when they are not equal, the processing is stopped and only the latest data is processed.
The requested data can be processed in real time, and even if many messages 31 are retained in the message queue 3 for some reason, useless processing can be stopped and the data can be quickly returned to the real-time processing state. .

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

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

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

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

【図4】本発明のメッセージ内容例である。FIG. 4 is an example of message contents of 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

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】プロセス間で通信を行なうプロセス間通信
方式において、 処理依頼する各クライアントプロセス(1)がデータを
上書きするおよび当該データを上書きする毎に変えた通
番を設定する各クライアントプロセス(1)毎に設けた
バッファ(2)と、 このバッファ(2)に上書きしたデータの先頭アドレス
および上記通番を設定したメッセージ(31)をつなぐ
メッセージキュー(3)とを共用空間に設け、 依頼された処理を行なうサーバプロセス(4)が上記メ
ッセージキュー(3)の先頭から取り出したメッセージ
(31)の通番と、設定されていた先頭アドレスのバッ
ファ(2)内のデータの通番とが等しい場合にのみ当該
バッファ(2)からデータを取り出して処理を行ない、
等しくない場合に処理中止して次の処理に進むように構
成したことを特徴とするプロセス間通信方式。
1. In an inter-process communication method for communicating between processes, each client process (1) requesting processing overwrites data and each client process (1) sets a different serial number each time the data is overwritten. ), A buffer (2) provided for each of them, and a message queue (3) connecting the message (31) with the start address of the data overwritten in the buffer (2) and the serial number set in the shared space are requested. Only when the serial number of the message (31) fetched from the head of the message queue (3) by the server process (4) performing the processing is equal to the serial number of the data in the buffer (2) at the set head address. Data is taken out from the buffer (2) and processed,
An inter-process communication method characterized by being configured to stop processing and proceed to the next processing when they are not equal.
【請求項2】請求項1において、バッファ(2)の先頭
アドレスが固定の場合に、上記通番を設定したメッセー
ジ(31)をメッセージキュー(3)につなぐように構
成したことを特徴とするプロセス間通信方式。
2. The process according to claim 1, wherein the message (31) having the serial number set therein is connected to the message queue (3) when the head address of the buffer (2) is fixed. Inter-communication method.
【請求項3】上記クライアントプロセス(1)は複数の
プロセスからなり、これら各プロセスが自プロセスID
と通番、更に必要に応じて先頭アドレスを設定したメッ
セージ(31)を上記メッセージキュー(3)につなぐ
ように構成したことを特徴とする請求項1および請求項
2記載のプロセス間通信方式。
3. The client process (1) comprises a plurality of processes, and each of these processes has its own process ID.
The interprocess communication system according to claim 1 or 2, wherein a message (31) having a serial number, a serial number, and a start address set as necessary is connected to the message queue (3).
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 true JPH0793169A (en) 1995-04-07
JP2926630B2 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)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
KR100551171B1 (en) * 1999-03-15 2006-02-13 유티스타콤코리아 유한회사 Method for processig reception of packet in inter-processor packet communication for digital mobile communication system
JP2010511255A (en) * 2006-11-29 2010-04-08 クゥアルコム・インコーポレイテッド Method, system, and apparatus for activation of objects across protected area boundaries

Cited By (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
JP2010511255A (en) * 2006-11-29 2010-04-08 クゥアルコム・インコーポレイテッド Method, system, and apparatus for activation of objects across protected area boundaries

Also Published As

Publication number Publication date
JP2926630B2 (en) 1999-07-28

Similar Documents

Publication Publication Date Title
US7529915B2 (en) Context switching processor with multiple context control register sets including write address register identifying destination register for waiting context to store returned data from external source
RU2182356C2 (en) Method and device for maintaining sequencing of transactions and solving conflict situations in bridge circuit of buses
US6124868A (en) Method and apparatus for multiple co-processor utilization of a ring buffer
JP3271125B2 (en) Method and apparatus for transferring data and apparatus for interleaving data transfer
US6631462B1 (en) Memory shared between processing threads
JPH06187296A (en) Multiprocessor system
CN101196912A (en) Method and apparatus for application state synchronization
US20050138230A1 (en) Method, apparatus and program product for low latency I/O adapter queuing in a computer system
US6766386B2 (en) Method and interface for improved efficiency in performing bus-to-bus read data transfers
KR20040104467A (en) Most eligible server in a common work queue environment
JPH07210519A (en) Data transfer control method and transmission/reception controller
JP2978519B2 (en) Document data display method and system
EP3872642B1 (en) Caching device, cache, system, method and apparatus for processing data, and medium
JPH0793169A (en) Inter-process communication system
JP2792866B2 (en) Buffer pool pre-expansion device
JP2002251373A (en) Network system and network terminal
US6643756B1 (en) System and method for accessing video data using a translation client
US6633928B2 (en) Fast process context switching buffer
JPH07319829A (en) Method for transferring data
JP2002024035A (en) Device and method for inter-process communication
US20050071505A1 (en) High-speed scheduler
JPH0962633A (en) Network control unit
JP2961542B2 (en) Data processing system
JPH03174645A (en) Inter-cpu message communication device
JPH11282745A (en) Queue management system

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