JP2603013B2 - Ring buffer message management processing method - Google Patents

Ring buffer message management processing method

Info

Publication number
JP2603013B2
JP2603013B2 JP3250703A JP25070391A JP2603013B2 JP 2603013 B2 JP2603013 B2 JP 2603013B2 JP 3250703 A JP3250703 A JP 3250703A JP 25070391 A JP25070391 A JP 25070391A JP 2603013 B2 JP2603013 B2 JP 2603013B2
Authority
JP
Japan
Prior art keywords
message
tag
ring buffer
read
cpu
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
JP3250703A
Other languages
Japanese (ja)
Other versions
JPH0589010A (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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP3250703A priority Critical patent/JP2603013B2/en
Publication of JPH0589010A publication Critical patent/JPH0589010A/en
Application granted granted Critical
Publication of JP2603013B2 publication Critical patent/JP2603013B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Multi Processors (AREA)
  • Computer And Data Communications (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Description

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

【0001】[0001]

【産業上の利用分野】ネットワークから送られて来るメ
ッセージを記憶するリングバッファから、メッセージを
読取る際のリングバッファのメッセージ管理処理方式に
関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a ring buffer message management system for reading a message from a ring buffer for storing a message sent from a network.

【0002】[0002]

【従来の技術】図4はシステム構成図である。計算機5
0は、ネットワーク10に接続されており、当該計算機
50へ向けてネットワーク10より送られて来るメッセ
ージはリングバッファ20に一旦記憶される。
2. Description of the Related Art FIG. 4 is a system configuration diagram. Calculator 5
0 is connected to the network 10, and a message sent from the network 10 to the computer 50 is temporarily stored in the ring buffer 20.

【0003】図5は従来の読取り処理の説明図である。
計算機50が受信したメッセージは受信した順にリング
バッファに記憶される。例えば、メッセージA,メッセ
ージBの順に受信した時には図5に示す如くメッセージ
A,メッセージBの順に記憶される。リングバッファ管
理部25は、受信したメッセージのうちで一番最後のメ
ッセージの後の空き領域の先頭位置を「空き領域先頭位
置」(以下WPとする)として記憶しており、図5の場
合にはメッセージBの後の空き領域の先頭位置を記憶し
ている。メッセージBの後にメッセージCを受信した時
には、上記WPからメッセージCが書き込まれて、WP
がメッセージCの後の空き領域の先頭位置に更新され
る。また、リングバッファ20は、読取りの済んでいな
いメッセージのうち一番前にあるメッセージの先頭位置
を「メッセージ先頭位置」(以下RPとする)として記
憶しており、図5の場合にはメッセージAの先頭位置を
RPとして記憶している。メッセージの読取り命令が発
生すると、RPから読取りを開始して、メッセージAを
読取り、メッセージAの読取りが終わるとRPはメッセ
ージBの先頭位置に更新される。メッセージBについて
も同様に処理がなされる。
FIG. 5 is an explanatory diagram of a conventional reading process.
The messages received by the computer 50 are stored in the ring buffer in the order received. For example, when a message A and a message B are received in this order, they are stored in the order of the message A and the message B as shown in FIG. The ring buffer management unit 25 stores the head position of the free space after the last message among the received messages as “free space head position” (hereinafter referred to as WP). Stores the head position of the free area after message B. When message C is received after message B, message C is written from WP, and
Is updated to the head position of the empty area after the message C. Further, the ring buffer 20 stores the head position of the foremost message among the unread messages as a “message head position” (hereinafter referred to as RP), and in the case of FIG. Is stored as the RP. When a message reading instruction is issued, reading is started from the RP, the message A is read, and when the reading of the message A is completed, the RP is updated to the head position of the message B. The same processing is performed for message B.

【0004】[0004]

【発明が解決しようとする課題】従来の方式において
は、受信した順序にしか、メッセージの読取りを行なう
ことができなかった。
In the conventional system, messages can be read only in the order of reception.

【0005】本発明は、所望の順序でメッセージの読取
りを行なうことができるようにすることを目的とする。
[0005] It is an object of the present invention to enable messages to be read in a desired order.

【0006】[0006]

【課題を解決するための手段】図1は本発明の原理構成
図である。図1において、10はネットワーク、20は
リングバッファ、25はリングバッファ管理部、26は
空き領域先頭記憶部、27はタグ変更処理部、28はメ
ッセージ先頭記憶部、30はCPU、40はメモリ、5
0は計算機を表わす。
FIG. 1 is a block diagram showing the principle of the present invention. In FIG. 1, 10 is a network, 20 is a ring buffer, 25 is a ring buffer management unit, 26 is a free area head storage unit, 27 is a tag change processing unit, 28 is a message head storage unit, 30 is a CPU, 40 is a memory, 5
0 represents a computer.

【0007】リングバッファ20は、ネットワーク10
から受信するメッセージMiを、送られて来た順に記憶
する。メッセージMiは、タグTiが付与された状態で
送られてくる。
The ring buffer 20 is connected to the network 10
Are stored in the order in which they were sent. The message Mi is sent with the tag Ti attached.

【0008】リングバッファ管理部25は、空き領域先
頭記憶部26、タグ変更処理部27、メッセージ先頭記
憶部28を備えており、リングバッファ20の管理を行
なう。
The ring buffer management unit 25 includes a free area head storage unit 26, a tag change processing unit 27, and a message head storage unit 28, and manages the ring buffer 20.

【0009】空き領域先頭記憶部26は、受信したメッ
セージの後の空き領域の先頭位置を「空き領域先頭位
置」(以下WPとする)として記憶する。タグ変更処理
部27は読取りが済んだメッセージMiのタグTiを、
読取りの済んだことを表わす予め決められたタグに変更
する。
The free area head storage unit 26 stores the head position of the free area after the received message as "free area head position" (hereinafter referred to as WP). The tag change processing unit 27 replaces the tag Ti of the read message Mi with
Change to a predetermined tag indicating that reading has been completed.

【0010】メッセージ先頭記憶部28は、読取りの済
んでいないメッセージMiのうち一番前にあるメッセー
ジの先頭位置を記憶する。CPU30はリングバッファ
20に記憶されるメッセージの読取りを行ない、必要に
応じてその内容及びその処理結果をメモリ40へ格納す
る。
[0010] The message head storage unit 28 stores the head position of the first message among the unread messages Mi. The CPU 30 reads the message stored in the ring buffer 20 and stores the content and the processing result in the memory 40 as necessary.

【0011】[0011]

【作用】CPU30からタグの指定を伴ってメッセージ
の読取り命令が発せられると、リングバッファ管理部2
5はメッセージ先頭位置を起点に当該タグによって当該
メッセージを検索し、その内容をCPU30へ伝送す
る。また、タグ変更処理部27が、当該読取りの済んだ
メッセージのタグを読取りの済んだことを示すタグに変
更する。そこで、一番前にあるメッセージのタグが読取
りの済んだことを示すタグになった時には、メッセージ
先頭記憶部28が、上記RPを2Rのメッセージの先頭
位置に更新する。その結果、RPからWPまでの範囲外
となったメッセージの領域は空き領域となる。
When a message reading instruction is issued from the CPU 30 with the designation of a tag, the ring buffer management unit 2
5 retrieves the message by the tag starting from the message head position, and transmits the content to the CPU 30. Further, the tag change processing unit 27 changes the tag of the read message to a tag indicating that the message has been read. Therefore, when the tag of the message at the forefront becomes a tag indicating that the reading has been completed, the message head storage unit 28 updates the RP to the head position of the 2R message. As a result, the area of the message outside the range from the RP to the WP becomes a free area.

【0012】ネットワーク10からメッセージが送られ
て来ると、リングバッファ管理部25は、当該メッセー
ジを、上記WPから書き込み、その終了後に、WPを当
該送られて来たメッセージの後の空き領域の先頭位置に
更新する。
When a message is sent from the network 10, the ring buffer management unit 25 writes the message from the WP, and after the writing is completed, sets the WP at the beginning of the free area after the sent message. Update to position.

【0013】[0013]

【実施例】図2は本発明の実施例説明図である。図中、
符号20はリングバッファ、MSiは各メッセージのサ
イズ、Tiは各メッセージのタグ、WPは空き領域先頭
位置、RPはメッセージ先頭位置を表している。リング
バッファ20はメッセージ1から到着順にメッセージ4
まで記憶している。ここでは、タグTiは、当該メッセ
ージiのネットワークにおける発信者又は発信端末の識
別IDを示している。またタグがXXの場合には、当該
メッセージは読取りが済んだことを表わす。従って、例
えば、メッセージ1及び3は読取りが済んでおり、メッ
セージ2は識別IDがAAの発信者又は発信端末からの
メッセージであることがわかる。
FIG. 2 is an explanatory view of an embodiment of the present invention. In the figure,
Reference numeral 20 denotes a ring buffer, MSi denotes a size of each message, Ti denotes a tag of each message, WP denotes a free area start position, and RP denotes a message start position. Ring buffer 20 stores message 4 in the order of arrival from message 1
I remember until. Here, the tag Ti indicates the identification ID of the sender or the terminal of the message i in the network. If the tag is XX, it indicates that the message has been read. Therefore, for example, it is understood that the messages 1 and 3 have been read, and the message 2 is a message from the sender or the terminal having the identification ID of AA.

【0014】図3は、読取り時の処理フローを示す。図
中、WPおよびRPは図2に対応する。MPは処理する
メッセージの先頭位置、MSは処理するメッセージのサ
イズを表わす。
FIG. 3 shows a processing flow at the time of reading. In the figure, WP and RP correspond to FIG. MP indicates the head position of the message to be processed, and MS indicates the size of the message to be processed.

【0015】処理(10)では、タグの指定を伴って読
取り命令が発せられる。処理(20)では,RPをMP
に代入する。処理(30)では、もし、WPとMPとが
等しければ、WPとMPとが等しくなくなるまで待つ、
処理(40)ではMPの位置のメッセージのタグを読
む。処理(50)では当該タグがXXであるか否かを判
別する。XXである時には、処理(70)へ進む。処理
(70)では、MPとRPが等しいならばRPをRP+
MPに更新し、MPとRPとが等しくない時には、RP
を更新しないで処理(90)へ進む。処理(90)で
は、MPをMP+MSに更新して処理(30)へ進む。
処理(50)で、XXでない時には、処理(60)で、
当該メッセージが完全に到着するまで待つ。処理(8
0)では、当該メッセージのタグが上記指定タグである
か否かを判断し、指定タグである時には、当該メッセー
ジの読取りを実行し、当該メッセージのタグをXXにし
て終了する。また、タグが上記指定タグでない時には、
処理(90)で、MPをMP+MSに更新して処理(3
0)へ進む。
In the process (10), a read command is issued with designation of a tag. In processing (20), RP is set to MP
Substitute for In process (30), if WP and MP are equal, wait until WP and MP are not equal.
In the process (40), the tag of the message at the position of the MP is read. In the process (50), it is determined whether or not the tag is XX. If it is XX, the process proceeds to processing (70). In processing (70), if MP and RP are equal, RP is set to RP +
Update to MP, and when MP and RP are not equal, RP
Without updating the process (90). In the process (90), the MP is updated to MP + MS, and the process proceeds to the process (30).
When it is not XX in the process (50), in the process (60),
Wait for the message to arrive completely. Processing (8
In 0), it is determined whether or not the tag of the message is the specified tag. If the tag is the specified tag, the message is read, the tag of the message is set to XX, and the process ends. When the tag is not the above specified tag,
In processing (90), MP is updated to MP + MS and processing (3)
Go to 0).

【0016】次に、図2に示す場合において、タグがB
Bであるメッセージを読取る時の処理を図3に即して説
明する。処理(10)にて指定タグをBBとして読取り
命令が発せられる。処理(20)で、先ずメッセージ1
を処理メッセージとする。
Next, in the case shown in FIG.
The processing for reading the message B will be described with reference to FIG. In the process (10), a read command is issued with the designated tag being BB. In process (20), first, message 1
Is a processing message.

【0017】処理(50)でメッセージ1のタグがXX
であると判断し、処理(70)でMPとRPとが等しい
のでRPをメッセージ2の先頭に更新し、処理(90)
でMPをメッセージ2の先頭に更新する。即ち、処理メ
ッセージをメッセージ2に更新する。メッセージ2のタ
グがAAであるので処理(30),(40),(5
0),(60),(80)を経て処理(90)でMPが
更新されて、処理メッセージがメッセージ3に更新され
る。メッセージ3のタグがXXであるので処理(3
0),(50)を経て処理(70)へ進むが、この時に
は、MPとRPとは等しくないので、RPを更新しない
で、処理(90)でMPを更新し、処理メッセージをメ
ッセージ4に更新する。メッセージ4のタグは指定タグ
のBBであるので処理(100)で読取りを実行してタ
グをXXとする。
In process (50), the tag of message 1 is XX
Is determined, and since MP and RP are equal in the process (70), the RP is updated to the beginning of the message 2 and the process (90)
To update the MP to the beginning of message 2. That is, the processing message is updated to the message 2. Since the tag of message 2 is AA, processing (30), (40), (5)
The MP is updated in process (90) via (0), (60), and (80), and the processed message is updated to message 3. Since the tag of message 3 is XX, processing (3
0) and (50), the process proceeds to the process (70). At this time, since the MP and the RP are not equal, the MP is updated in the process (90) without updating the RP. Update. Since the tag of the message 4 is the designated tag BB, the reading is executed in the process (100) and the tag is set to XX.

【0018】本実施例では、読取りの済んだメッセージ
のタグはXXとなり、当該メッセージは次の読取り要求
以降まで、リングバッファにそのまま保持される。即
ち、そのメッセージの開放(そのメッセージがRPから
WPまでの範囲外になり、空き領域に属するようになる
こと)は、次の読取り要求以降になる。ところで、コピ
ーバックのキャッシュメモリを持った計算機がリングバ
ッファを使用する場合には、メッセージが到着するまえ
に、その領域をインバリデート(データがキャッシュメ
モリのその領域に存在するときには、そのデータを無効
化すること)する必要がある。しかし、本実施例では、
メッセージの開放が行なわれるまで、そのメッセージの
領域に新しいメッセージが到着することはない。従っ
て、リングバッファの開放されていない領域については
開放される直前に、その領域に対応するキャッシュメモ
リの領域をインバリデートするようにすれば、効率よく
キャッシュメモリを利用できる。リングバッファの開放
されていないメッセージ領域に対応するキャッシュメモ
リの領域をリングバッファ以外の処理に用いることがで
きるからである。
In this embodiment, the tag of the read message is XX, and the message is held in the ring buffer as it is until the next read request. That is, the release of the message (that the message goes out of the range from RP to WP and belongs to a free area) is after the next read request. By the way, when a computer having a copy-back cache memory uses a ring buffer, invalidate the area before the message arrives (if the data exists in that area of the cache memory, the data is invalidated). It is necessary to make it. However, in this embodiment,
Until the message is released, no new message arrives in the message area. Therefore, if an area of the ring buffer that is not released is invalidated immediately before the area is released, the cache memory can be used efficiently if the area of the cache memory corresponding to the area is invalidated. This is because the area of the cache memory corresponding to the message area where the ring buffer is not released can be used for processing other than the ring buffer.

【0019】[0019]

【発明の効果】以上説明した如く、本発明によれば、所
望の順序でメッセージの読取りを行なうことができるよ
うになる。
As described above, according to the present invention, messages can be read in a desired order.

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

【図1】本発明の原理構成図である。FIG. 1 is a principle configuration diagram of the present invention.

【図2】本発明の実施例説明図である。FIG. 2 is an explanatory view of an embodiment of the present invention.

【図3】読取り時の処理フローを示す。FIG. 3 shows a processing flow at the time of reading.

【図4】システム構成図である。FIG. 4 is a system configuration diagram.

【図5】従来の読取り処理の説明図である。FIG. 5 is an explanatory diagram of a conventional reading process.

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

10 ネットワーク 20 リングバッファ 25 リングバッファ管理部 26 空き領域先頭記憶部 27 タグ変更処理部 28 メッセージ先頭記憶部 30 CPU 40 メモリ 50 計算機 DESCRIPTION OF SYMBOLS 10 Network 20 Ring buffer 25 Ring buffer management part 26 Free area head storage part 27 Tag change processing part 28 Message head storage part 30 CPU 40 Memory 50 Computer

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 ネットワーク(10)から送られて来る
メッセージ(Mi)を記憶するリングバッファ(20)
から、CPU(30)がメッセージ(Mi)を読取る際
の、リングバッファのメッセージ管理処理方式におい
て、 各メッセージ(Mi)は、ネットワークにおいて送信さ
れる時にタグ(Ti)を付与されるようにし、 リングバッファ(20)が記憶しているメッセージのう
ちで、読取りが済んだメッセージ(Mi)のタグ(T
i)を読取りの済んだことを表わす予め決められたタグ
に変更するタグ変更処理部(27)と、リングバッファ
(20)が記憶しており読取りの済んでいないイメッセ
ージのうち一番前にあるメッセージの先頭位置を記憶す
るメッセージ先頭記憶部(28)とを備えるリングバッ
ファ管理部(25)を設け、 当該リングバッファ管理部(25)が、CPU(30)
からタグの指定を伴って所望のメッセージを読取る命令
を受けた時に、上記メッセージ先頭位置を起点に、当該
所望のメッセージを当該指定タグによって検索し、その
内容をCPU(30)へ伝送するようにしたことを特徴
とするリングバッファのメッセージ管理処理方式。
1. A ring buffer (20) for storing a message (Mi) sent from a network (10).
In the message management processing method of the ring buffer when the CPU (30) reads the message (Mi), each message (Mi) is given a tag (Ti) when transmitted on the network, Among the messages stored in the buffer (20), the tag (T) of the read message (Mi) is read.
a tag change processing unit (27) for changing i) to a predetermined tag indicating that the message has been read, and a first message out of the unread messages stored in the ring buffer (20) A ring buffer management unit (25) including a message head storage unit (28) for storing a head position of a certain message; and the ring buffer management unit (25) includes a CPU (30).
When a command for reading a desired message with a tag designation is received from the CPU, the desired message is searched by the designated tag starting from the message head position, and the content is transmitted to the CPU (30). A ring buffer message management processing method.
JP3250703A 1991-09-30 1991-09-30 Ring buffer message management processing method Expired - Fee Related JP2603013B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3250703A JP2603013B2 (en) 1991-09-30 1991-09-30 Ring buffer message management processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3250703A JP2603013B2 (en) 1991-09-30 1991-09-30 Ring buffer message management processing method

Publications (2)

Publication Number Publication Date
JPH0589010A JPH0589010A (en) 1993-04-09
JP2603013B2 true JP2603013B2 (en) 1997-04-23

Family

ID=17211791

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3250703A Expired - Fee Related JP2603013B2 (en) 1991-09-30 1991-09-30 Ring buffer message management processing method

Country Status (1)

Country Link
JP (1) JP2603013B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08137773A (en) * 1994-11-11 1996-05-31 Nippon Denki Ido Tsushin Kk Data transmission/reception system for mobile communication system

Also Published As

Publication number Publication date
JPH0589010A (en) 1993-04-09

Similar Documents

Publication Publication Date Title
US7664900B2 (en) Multiprocessor system and method for processing memory access
JPH08241186A (en) Unit and method for buffer memory management
JP2603013B2 (en) Ring buffer message management processing method
JPH11259370A (en) Data writing device and method therefor
JP3296240B2 (en) Bus connection device
EP1296249A2 (en) Method and controller for copying chain buffers from a system memory to a local memory
JPH11502340A (en) Apparatus and method for processing digital signals and processing apparatus constituted thereby
JP2570753B2 (en) Data transfer control device
US7555624B2 (en) Program, an apparatus and a method for guaranteeing a data storage order in an ISAM file
JPH0546565A (en) Data processor
JPS6035692B2 (en) Buffer management method
JPH0612388A (en) Access system for decentralized file
JP3251198B2 (en) Data transfer device
JPH0740240B2 (en) Information processing apparatus and information processing system
JPH0192863A (en) Inter-processor message transmission/reception control system
JP2517851B2 (en) Parallel priority control method
JPH0486923A (en) Task management controlling system
JPS5842546B2 (en) Store control method
JPH0535593A (en) Cache memory control system
JPS5990130A (en) Data buffer control system
JPH03241442A (en) Store buffer control system
JPS63311548A (en) Cache memory controlling system
JPS60214058A (en) Memory access control circuit
JPH0512120A (en) Data cache control system
JPS6115248A (en) Memory access control system

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 19961203

LAPS Cancellation because of no payment of annual fees