JP2003345611A - System, method, and program for queue control - Google Patents

System, method, and program for queue control

Info

Publication number
JP2003345611A
JP2003345611A JP2002152227A JP2002152227A JP2003345611A JP 2003345611 A JP2003345611 A JP 2003345611A JP 2002152227 A JP2002152227 A JP 2002152227A JP 2002152227 A JP2002152227 A JP 2002152227A JP 2003345611 A JP2003345611 A JP 2003345611A
Authority
JP
Japan
Prior art keywords
segment
queue
data
entry
registration
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
JP2002152227A
Other languages
Japanese (ja)
Other versions
JP3823878B2 (en
Inventor
Yoshihisa Suzuki
良尚 鈴木
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 JP2002152227A priority Critical patent/JP3823878B2/en
Publication of JP2003345611A publication Critical patent/JP2003345611A/en
Application granted granted Critical
Publication of JP3823878B2 publication Critical patent/JP3823878B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

<P>PROBLEM TO BE SOLVED: To provide a system and a method that register data in and take data out of a queue consisting of a plurality of segments at a high speed and easily expand and shorten the queue. <P>SOLUTION: A registration pointer and an extraction pointer for data are held in a queue control information part and an entry to be processed is predetermined; when the queue is operated, the queue is accessed by using the pointers to eliminate the need to perform retrieval from the queue and re-chain entries, thereby registering and extracting data at a high speed. Further, an annular link among segments is updated by generating a new segment to easily expand the queue and the annular link is updated by erasing unused segments to shorten the queue. <P>COPYRIGHT: (C)2004,JPO

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、コンピュータシス
テムのキュー制御システム、キュー制御方法およびキュ
ー制御用プログラムに関し、特に、プロセス間通信に利
用して好適とされるキュー制御システム、キュー制御方
法およびキュー制御用プログラムに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a queue control system, a queue control method, and a queue control program for a computer system, and more particularly to a queue control system, a queue control method, and a queue which are suitable for use in inter-process communication. It relates to a control program.

【0002】[0002]

【従来の技術】従来より、非同期に発生するデータを、
例えばFIFO(先入れ先出し)方式で、順次に登録お
よび取り出すキュー制御システムとしては、キューの先
頭エントリおよび各エントリ内の順方向チェインポイン
タを有する片方向チェインや、インデックスキーを用い
たシステム、方法が知られている。キュー管理に関する
刊行物として以下のものが参照される。 (a)特開平4−130929号公報 (b)特開平4−259040号公報 (c)特開平11−184716号公報 (d)特開平6−68040号公報 上記刊行物(a)乃至(d)に記載されたシステムにつ
いて以下に概説する。
2. Description of the Related Art Conventionally, data generated asynchronously is
For example, as a queue control system that sequentially registers and retrieves data in a FIFO (first-in first-out) system, a one-way chain having a head entry of a queue and a forward chain pointer in each entry, a system and a method using an index key are known. ing. The following publications on queue management are referenced: (A) JP-A-4-130929 (b) JP-A-4-259040 (c) JP-A-11-184716 (d) JP-A-6-68040 The above publications (a) to (d) An overview of the system described in is provided below.

【0003】特開平4−130929号公報には、同じ
キー値のイベントをグループ化し、グループ対応にサー
チ可能な同一キーポインタを設けることにより、同一キ
ーポインタを用いることによりサーチ処理をスキップし
て行うスキップサーチ手段と、同一キー値を持つイベン
トの追加時には、新規にグループを構成し、すでにグル
ープが構成されている場合には、グループへのイベント
の追加を行う同一キーポインタ管理手段とを備えたキュ
ー管理方式が開示されている。同一キーポインタは、同
一キー値を持ったデータをグループ化し、サーチ処理が
可能となるようにデータをチェインするポインタであ
る。
Japanese Patent Application Laid-Open No. 4-130929 discloses that events having the same key value are grouped and the same key pointer that can be searched for the group is provided, so that the search process is skipped by using the same key pointer. A skip search unit and a same key pointer management unit that newly forms a group when an event having the same key value is added and adds an event to the group when a group is already formed are provided. A queue management scheme is disclosed. The same key pointer is a pointer that groups data having the same key value and chains the data so that a search process can be performed.

【0004】このような構成を有するキュー管理方式で
は、同一キー値のデータが数多く登録されている場合に
おいても、スキップサーチ手段により同一キーポインタ
を用いることでキー値の異なるデータのサーチをスキッ
プすることができ、サーチ処理を早く行うことができ
る。また、新たなデータを登録する際には、同一キーポ
インタ管理手段より、新規グループを構成したり、既存
グループへのデータ追加を行うことで、グループを構成
する全てのデータのキー値を等しく保つことができる。
In the queue management system having such a configuration, even when a large number of data having the same key value are registered, the search for data having different key values is skipped by using the same key pointer by the skip search means. And the search process can be performed quickly. When registering new data, the same key pointer management means forms a new group or adds data to an existing group, so that the key values of all data forming the group are kept equal. be able to.

【0005】特開平4−259040号公報には、環状
キューのキューイング状態を管理する環状キュー管理手
段の管理データを用いて、新たなキューブロックの獲得
の必要状態にあるのか否かを判断する判断手段と、判断
手段が獲得の必要状態にあると判断するときに、新たな
キューブロックを獲得する獲得手段と、獲得手段が新た
なキューブロックを環状キューにキューイングする設定
手段を備えたキュー管理手段を備え、環状キューのキュ
ーブロックの自動増設を実現する。
Japanese Patent Application Laid-Open No. 4-259040 discloses a method for determining whether or not a new queue block needs to be acquired by using management data of a circular queue management means for managing the queuing state of a circular queue. A queue comprising: a judging means; an acquiring means for acquiring a new queue block when the judging means judges that the acquisition is in a required state; and a setting means for setting the acquiring means to queue the new queue block in a circular queue. A management unit is provided to realize automatic addition of a queue block of a circular queue.

【0006】このような構成を有するキュー管理方式で
は、チェインされたキューのつなぎ換えを行うだけでキ
ュー管理を実行できることから、環状構成を採らないキ
ューに比べてキュー管理のための処理ステップが少なく
なり、キュー管理の高速化を図ることができる。また、
キューブロックの全てが使用状態になっている場合に、
新たなデータを登録すると、獲得手段により、新たなキ
ューブロックが獲得され、設定手段により獲得されたキ
ューブロックが環状キューにキューイングされること
で、環状キューのキューブロックの自動増設が実現でき
る。
In the queue management system having such a configuration, queue management can be executed only by changing the chain of queues, so that the number of processing steps for queue management is smaller than that of a queue without a ring configuration. Thus, the speed of queue management can be increased. Also,
If all of the cue blocks are in use,
When new data is registered, a new queue block is obtained by the obtaining unit, and the queue block obtained by the setting unit is queued in the circular queue, so that the queue block of the circular queue can be automatically added.

【0007】特開平11−184716号公報には、事
象キュー要素のキューイング処理及びキューイングアウ
ト処理を各々別々に実行するマルチタスクを備え、事象
キュー要素から構成される事象キューの常に先頭をポイ
ントする先頭ポインタと常に最終をポイントする最終ポ
インタをキューイング専用及びキューアウト専用の2対
備え、事象キュー要素内に、連続的に発生する事象キュ
ー要素を連結するための順方向チェインポインタと逆方
向チェインポインタを備えた構成のキュー管理方式が開
示されている。すなわち、キューイング処理用タスク
と、キューアウト処理用タスクと、確認型タスク間通知
手段と、キューバッファと、キューイング専用事象キュ
ーの先頭ポインタと、キューイング専用事象キューの最
終ポインタと、キューアウト専用事象キューの先頭ポイ
ンタと、キューアウト専用事象キューの最終ポインタ
と、キューイング専用事象キューと、キューアウト専用
事象キューと、事象キューを構成する個々の事象キュー
要素とから構成されている。また個々の事象キュー要素
は、それぞれ順方向チェインポインタと逆方向チェイン
ポインタを持っている。
Japanese Patent Application Laid-Open No. 11-184716 has a multitask for executing queuing processing and queuing-out processing of event queue elements separately, and always points to the head of an event queue composed of event queue elements. Two pairs of a start pointer and a final pointer that always points to the end are provided only for queuing and cue-out. A forward chain pointer and a backward direction for connecting successively occurring event queue elements within an event queue element are provided. A queue management system having a configuration including a chain pointer is disclosed. That is, a task for queuing processing, a task for queue-out processing, a confirmation type inter-task notification means, a queue buffer, a head pointer of a queue-only event queue, a final pointer of a queue-only event queue, It comprises a head pointer of a dedicated event queue, a final pointer of a queue-out dedicated event queue, a queuing-dedicated event queue, a queue-out dedicated event queue, and individual event queue elements constituting the event queue. Each event queue element has a forward chain pointer and a backward chain pointer.

【0008】このような構成を有するキュー管理方式で
は、キューにデータを登録する場合は、キューイング処
理用タスクが動作し、キューイング専用先頭ポインタの
先にデータを登録し、前後の事象キュー要素内の順方向
チェインポインタと逆方向チェインポインタを張り直
す。キューからデータを取り出す場合には、キューアウ
ト処理用タスクが動作し、キューアウト専用最終ポイン
タの先からデータを取り出し、前後の事象キュー要素内
の順方向チェインポインタと逆方向チェインポインタを
張り直す。このように、キューイング時はキューイング
専用の先頭ポインタのポイント先へデータを登録し、キ
ューアウト時はキューアウト専用の最終ポインタのポイ
ント先からデータを取り出すため、キューサーチが不要
となり高速なキュー処理が可能となる。
In the queue management system having such a configuration, when data is registered in the queue, a queuing processing task is operated to register the data at the end of the queuing-dedicated head pointer, and to execute the event queue elements before and after. The forward chain pointer and the backward chain pointer are re-established. To retrieve data from the queue, the queue-out processing task operates, retrieves data from the end of the final pointer dedicated to queue-out, and re-stretches the forward and backward chain pointers in the preceding and following event queue elements. In this way, during queuing, data is registered at the point of the first pointer dedicated to queuing, and at cue-out, data is extracted from the point of the final pointer dedicated to cue-out. Processing becomes possible.

【0009】また、キューアウト処理用タスクの動作中
にデータ登録要求があった場合、キューイング処理用タ
スクはもう1つ別の事象キューを作成して処理を行い、
確認型タスク間通知手段をタイミングにして事象キュー
の切り替えを行う。このため1つの事象キューに対して
キューイング処理およびキューアウト処理が同時に発生
せず、マルチタスクでもメモリ排他制御の必要がなくな
り効率の良いキュー処理が可能となる。
When a data registration request is issued during the operation of the queue-out processing task, the queuing processing task creates another event queue and performs processing.
The event queue is switched with the confirmation type inter-task notification means as the timing. For this reason, the queuing process and the queue-out process do not occur at the same time for one event queue, and there is no need for memory exclusion control even in multitasking, and efficient queue processing becomes possible.

【0010】特開平6−68040号公報には、リング
バッファ方式の通信キューを使用するキュー制御方式が
記載されている。同様に、特開平1−129345号公
報(発明の名称:「マルチプロセッサ・システム」)、
特開昭60−116064号公報(発明の名称:「分散
処理プロセッサー間通信方式」)、および特開昭58−
501740号公報(発明の名称:「データ処理システ
ムにおけるホスト、周辺制御プロセッサのような対にな
ったプロセッサのインターフェース機構」)等にも、プ
ロセッサ間通信用キューとしてリングバッファ方式のも
のを採用して通信制御を行う技術が記載されている。
Japanese Patent Laid-Open Publication No. 6-68040 describes a queue control system using a communication queue of a ring buffer system. Similarly, Japanese Patent Application Laid-Open No. 1-129345 (Title of Invention: "Multiprocessor System"),
JP-A-60-116064 (title of the invention: "communication system between distributed processing processors") and JP-A-58-16064
Japanese Patent Application Laid-Open No. 501740 (the title of the invention: "Interface mechanism of a paired processor such as a host and a peripheral control processor in a data processing system") and the like employ a ring buffer type queue for inter-processor communication. A technique for performing communication control is described.

【0011】特開平6−68040号公報は、プロセッ
サ間での送信時、通信用キューのライトポインタの指す
場所へ送信データであるリソース番号を書き込み、受信
時には、リードポインタの指す場所より受信データであ
るリソース番号を取り出す構成のプロセッサ間通信用の
キュー制御方式が開示されている。通信用キューは受信
用リードポインタと、送信用ライトポインタと、通信用
リソースとから構成されている。
Japanese Patent Application Laid-Open No. Hei 6-68040 discloses that when transmitting data between processors, a resource number, which is transmission data, is written to a location pointed to by a write pointer in a communication queue. A queue control method for inter-processor communication configured to extract a certain resource number is disclosed. The communication queue includes a reception read pointer, a transmission write pointer, and a communication resource.

【0012】このような構成を有するキュー制御方式で
は、データの登録時はライトポインタのポイント先へデ
ータを書き込み、ライトポインタを更新する。データの
取り出し時はリードポインタのポイント先からデータを
取り出し、リードポインタを更新する。このため、チェ
ーン方式に比べ、通信用キューの処理時間を早めること
ができ、また通信用キューの制御を簡易にすることがで
きる。
In the queue control system having such a configuration, at the time of data registration, data is written to the point of the write pointer and the write pointer is updated. When data is taken out, data is taken out from the point point of the read pointer and the read pointer is updated. Therefore, the processing time of the communication queue can be shortened and the control of the communication queue can be simplified as compared with the chain method.

【0013】しかしながら、上記刊行物等に記載されて
いる従来のシステムは、以下のような問題点を有してい
る。
However, the conventional systems described in the above publications have the following problems.

【0014】第1の問題点として、チェイン方式のキュ
ー管理方式では、データの登録およびデータの取り出し
時に前後のキューエントリの順方向チェインポインタあ
るいは逆方向チェインポインタを設定しなおさねばなら
ず、処理が遅くなるということである。
As a first problem, in the queue management system of the chain system, the forward chain pointer or the backward chain pointer of the queue entry before and after must be reset when registering and retrieving data. That is to be late.

【0015】その理由は、各キューエントリをチェイン
ポインタで連結することでキュー管理を行っているため
である。
The reason is that queue management is performed by linking each queue entry with a chain pointer.

【0016】第2の問題点は、リングバッファ方式のキ
ュー管理方式では、任意の時点でのキューの拡張ができ
ない、ということである。
The second problem is that the queue management method of the ring buffer method cannot expand the queue at an arbitrary time.

【0017】その理由は、リングバッファ方式では、バ
ッファの末尾と先頭を繋いだ形で管理し、末尾まで行く
と先頭に戻るというように無終端方式で連続して使用さ
れるが、バッファの途中に他の領域を挿入することはで
きないためである。バッファの末尾を拡張することでキ
ューを拡張することはできるが、その方式では任意の時
点でのキューの拡張は不可能である。
The reason is that in the ring buffer system, the end of the buffer and the head are managed in a connected manner, and the buffer is used continuously in an endless manner such as returning to the head when the end is reached. This is because it is not possible to insert another area into the. The queue can be extended by extending the end of the buffer, but it is not possible to extend the queue at any time.

【0018】第3の問題点は、プロセス間通信にキュー
を利用する場合に、データの登録時に空きエントリがな
い場合や、データの取り出し時に登録されているデータ
がない場合、それらの待ち合わせ制御を利用者自身が行
わなければならず、利用者の負担が大きい、ということ
である。
The third problem is that when a queue is used for inter-process communication, if there is no empty entry at the time of registering data, or if there is no data registered at the time of data retrieval, the queuing control for these is performed. This means that the user has to do it himself, which places a heavy burden on the user.

【0019】その理由は、従来のキュー管理方式では、
データの登録や取り出しを待ち合わせる機能がないため
である。
The reason is that in the conventional queue management system,
This is because there is no function to wait for data registration and retrieval.

【0020】[0020]

【発明が解決しようとする課題】したがって、本発明
は、上記問題点に鑑みて創案されたものであって、その
目的は、キューへのデータ登録およびキューからのデー
タ取り出しを高速に行うことができるキュー制御システ
ムを提供することにある。
SUMMARY OF THE INVENTION Accordingly, the present invention has been made in view of the above problems, and an object of the present invention is to register data in a queue and retrieve data from the queue at high speed. It is an object of the present invention to provide a queue control system.

【0021】本発明の他の目的は、登録されるデータの
数が一時的に多くなった場合に自動的にキューを拡張
し、データの数が減ったらキューを縮退することで、効
率良く資源を利用できるキュー制御システムを提供する
ことにある。
Another object of the present invention is to efficiently expand a queue when the number of data to be registered temporarily increases, and to degenerate the queue when the number of data is reduced, so that resources can be efficiently used. It is an object of the present invention to provide a queue control system that can use the above.

【0022】本発明のさらに他の目的は、データや空き
エントリの待ち合わせを行いプロセス間通信を容易に実
現できるキュー制御システムを提供することにある。
Still another object of the present invention is to provide a queue control system which can wait for data and empty entries and can easily realize inter-process communication.

【0023】[0023]

【課題を解決するための手段】前記目的の少なくとも1
つを達成する本発明の1つのアスペクトに係るキュー制
御システムは、キューとして用いるセグメントであっ
て、該セグメント中にキューの制御情報を格納するキュ
ー制御情報部と、データが登録されるエントリよりなる
データ部とを有する複数のセグメントを生成し、前記各
セグメントに環状のリンクを設定し、環状にリンクされ
た複数のセグメントのうちの1つのセグメント(「第1
セグメント」という)のキュー制御情報部に初期値を設
定するキュー生成手段を備え、前記第1セグメントのキ
ュー制御情報部には、データの登録先のエントリ及び取
り出しエントリを指す登録ポインタ及び取り出しポイン
タが少なくとも保持され、前記第1セグメントのキュー
制御情報部の登録ポインタが指すエントリに、データを
登録するデータ登録手段と、前記第1セグメントのキュ
ー制御情報部の取り出しポインタが指すエントリからデ
ータを取り出すデータ取り出し手段と、キューの排他制
御を行うキュー排他手段と、を備えている。
At least one of the above objects is attained.
A queue control system according to one aspect of the present invention, which achieves one of the above aspects, comprises a segment used as a queue, a queue control information section storing queue control information in the segment, and an entry in which data is registered. A plurality of segments having a data portion are generated, an annular link is set for each segment, and one of the plurality of annularly linked segments (“first
Segment)), the queue control information section of the first segment includes a registration pointer and a retrieval pointer indicating an entry of a data registration destination and a retrieval entry. Data registration means for registering data in at least the entry pointed to by the registration pointer of the queue control information section of the first segment, and data for extracting data from the entry pointed to by the extraction pointer of the queue control information section of the first segment There is provided a take-out unit and a queue exclusion unit for performing exclusive control of the queue.

【0024】より詳しくは、キューセグメント中にキュ
ーの制御情報を格納するキュー制御情報部と、データが
登録されるデータ部とを備え、複数のキューセグメント
を生成し、各セグメントに環状のリンクを設定し、キュ
ー制御情報部に初期値を設定するキュー初期化手段と、
キュー生成手段と、キュー制御情報部の登録ポインタが
指すエントリにデータを登録するデータ登録手段と、キ
ュー制御情報部の取り出しポインタが指すエントリから
データを取り出すデータ取り出し手段と、キュー制御情
報部の登録ポインタが指すエントリの直前のエントリか
らデータを取り出すデータ逆取り出し手段と、複数のプ
ロセスから同時に使用できないようにキューを排他する
キュー排他手段と、キューを停止状態とし、以降のデー
タ登録およびデータ取り出しを抑止するキュー停止手段
と、キューセグメントを消去するキュー消去手段と、前
記キュー停止手段により停止状態となったキューのキュ
ー制御情報部を再初期化し、再度キューを使用できるよ
うにするキュー再初期化手段とを備え、利用者プログラ
ムからの要求により、キューを生成や消去を行い、キュ
ーへのデータ登録およびキューからのデータ取り出しを
高速に行うよう動作する。
More specifically, a queue control information section for storing queue control information in a queue segment and a data section for registering data are provided, a plurality of queue segments are generated, and a circular link is provided for each segment. Queue initialization means for setting and setting an initial value in the queue control information section;
Queue generating means, data registering means for registering data in the entry pointed to by the registration pointer of the queue control information section, data retrieving means for retrieving data from the entry pointed to by the retrieval pointer of the queue control information section, and registration of the queue control information section Data reverse fetching means for fetching data from the entry immediately before the entry pointed by the pointer, queue exclusion means for exclusion of the queue so that it cannot be used simultaneously by a plurality of processes, and stopping the queue to perform subsequent data registration and data fetching Queue stopping means for suppressing, queue erasing means for erasing queue segments, and queue re-initialization for re-initializing the queue control information section of the queue stopped by the queue stopping means so that the queue can be used again. Means, upon request from the user program. Performs generation and erasure cue, it operates to perform the data retrieval from the data register and queue to the queue at a high speed.

【0025】また、本発明のキュー制御システムは、デ
ータの登録時に空きエントリがない場合、キューとして
利用する新たなセグメントを生成しセグメント間のリン
クを設定し直すキュー拡張手段と、データの取り出し時
に、使用していないセグメントを削除しセグメント間の
リンクを設定し直すキュー縮退手段とを備え、登録され
るデータの数が一時的に多くなった場合に自動的にキュ
ーを拡張し、データの数が減ったらキューを縮退するよ
う動作する。
The queue control system according to the present invention further comprises a queue expansion unit for generating a new segment to be used as a queue and re-establishing a link between segments when there is no empty entry at the time of data registration. Queue degeneration means for deleting unused segments and re-establishing links between segments. When the number of registered data temporarily increases, the queue is automatically expanded and the number of data It operates to degenerate the queue when decreases.

【0026】また、本発明のキュー制御システムは、デ
ータの登録時に空きエントリがない場合は、他プロセス
によりデータが取り出され空きエントリができるのを待
ち合わせ、さらに、データの取り出し時に登録されてい
るデータがない場合は、他プロセスによりデータが登録
されるのを待ち合わせる待ち合わせ手段を備え、データ
登録時に登録できるエントリがない場合や、データ取り
出し時に登録されているデータがない場合に、データの
登録やエントリの空きを待ち合わるよう動作する。
If there is no empty entry at the time of data registration, the queue control system of the present invention waits for data to be fetched by another process to create an empty entry, and further registers the data registered at the time of data fetching. If there is no entry, there is a waiting means to wait for data to be registered by another process. If there is no entry that can be registered at the time of data registration, or if there is no data registered at the time of data retrieval, data registration and entry It works to wait for space.

【0027】本発明の別のアスペクトに係るキュー制御
方法は、(a)キューとして用いるセグメントであっ
て、該セグメント中にキューの制御情報を格納するキュ
ー制御情報部と、データが登録されるエントリよりなる
データ部とを有する複数のセグメントを生成し、前記各
セグメントに環状のリンクを設定し、環状にリンクされ
た複数のセグメントのうちの1つのセグメント(「第1
セグメント」という)のキュー制御情報部に初期値を設
定するステップを有し、前記第1セグメントのキュー制
御情報部には、データの登録先のエントリ及び取り出し
エントリを指す登録ポインタ及び取り出しポインタが少
なくとも保持され、(b)前記第1セグメントのキュー
制御情報部の登録ポインタの示すエントリへデータを登
録するステップと、(c)前記第1セグメントのキュー
制御情報部の取り出しポインタの示すエントリからデー
タを取り出すステップと、(d)キューを排他制御する
ステップと、を含む。
According to another aspect of the present invention, there is provided a queue control method comprising: (a) a segment used as a queue, a queue control information section for storing queue control information in the segment, and an entry in which data is registered. A plurality of segments each having a data portion comprising a plurality of segments, a ring link is set for each of the segments, and one of the plurality of segments linked in a ring ("first
Setting an initial value in the queue control information section of the first segment. The queue control information section of the first segment includes at least a registration pointer and a retrieval pointer indicating an entry of a data registration destination and a retrieval entry. (B) registering data in an entry indicated by a registration pointer of the queue control information section of the first segment; and (c) retrieving data from an entry indicated by an extraction pointer of the queue control information section of the first segment. And (d) exclusive control of the queue.

【0028】本発明の他のアスペクトに係るプログラム
は、キューの管理をコンピュータで行わせるプログラム
であって、キューとして用いるセグメントであって、該
セグメント中にキューの制御情報を格納するキュー制御
情報部と、データが登録されるエントリよりなるデータ
部とを有する複数のセグメントを生成し、前記各セグメ
ントに環状のリンクを設定し、環状にリンクされた複数
のセグメントのうちの1つのセグメント(「第1セグメ
ント」という)のキュー制御情報部に初期値を設定する
処理を有し、前記第1セグメントのキュー制御情報部に
は、データの登録先のエントリ及び取り出しエントリを
指す登録ポインタ及び取り出しポインタが少なくとも保
持され、前記第1セグメントのキュー制御情報部の登録
ポインタが指すエントリにデータを登録する処理と、前
記第1セグメントのキュー制御情報部の取り出しポイン
タが指すエントリからデータを取り出す処理と、キュー
を排他制御する処理と、を前記コンピュータに実行させ
るためのプログラムよりなる。
A program according to another aspect of the present invention is a program for causing a computer to manage a queue, a segment used as a queue, and a queue control information section for storing queue control information in the segment. And a plurality of segments each having a data portion composed of an entry in which data is registered. An annular link is set for each of the segments, and one of the annularly linked segments (" 1). The queue control information section of the first segment includes a registration pointer and a retrieval pointer indicating the entry of the data registration destination and the retrieval entry. At least the data held by the registration pointer of the queue control information section of the first segment. A program for causing the computer to execute a process of registering data in the bird, a process of retrieving data from an entry pointed to by a retrieval pointer of the queue control information section of the first segment, and a process of exclusively controlling a queue. .

【0029】[0029]

【発明の実施の形態】次に、本発明の実施の形態につい
て図面を参照して詳細に説明する。図1は、本発明の一
実施の形態の構成を示す図である。図1を参照すると、
本発明の第1の実施の形態に係るシステムは、プログラ
ム制御により動作する計算機システム100と、キュー
制御システム110と、キューセグメント130と、利
用者プログラム140と、を備えて構成されている。
Next, embodiments of the present invention will be described in detail with reference to the drawings. FIG. 1 is a diagram showing a configuration of an embodiment of the present invention. Referring to FIG.
The system according to the first embodiment of the present invention includes a computer system 100 that operates under program control, a queue control system 110, a queue segment 130, and a user program 140.

【0030】キュー制御システム110は、キュー生成
手段111と、キュー停止手段112と、キュー消去手
段113と、キュー再初期化手段114と、データ登録
手段115と、データ取り出し手段116と、データ逆
取り出し手段117と、キュー排他手段118とを含
む。
The queue control system 110 includes a queue generation unit 111, a queue stop unit 112, a queue deletion unit 113, a queue reinitialization unit 114, a data registration unit 115, a data extraction unit 116, and a data reverse extraction. Means 117 and a queue exclusion means 118.

【0031】キューセグメント130は、キュー制御情
報部131と、キューデータ部132とを含む。
The queue segment 130 includes a queue control information section 131 and a queue data section 132.

【0032】これらの手段はそれぞれ概略つぎのように
動作する。
Each of these means operates as follows.

【0033】キュー生成手段111は、複数のキューセ
グメントを生成し各セグメントに環状のリンクを設定す
る。
The queue generating means 111 generates a plurality of queue segments and sets a circular link to each segment.

【0034】また、キュー生成手段111は、生成した
キューセグメントにキュー制御情報部を設け、初期値を
設定する。
The queue generating means 111 provides a queue control information section in the generated queue segment and sets an initial value.

【0035】キュー停止手段112は、キューを停止状
態とし、以降のデータの登録および取り出しを禁止す
る。
The queue stop unit 112 stops the queue, and prohibits subsequent registration and retrieval of data.

【0036】キュー消去手段113は、キュー停止手段
112により停止状態となったキューの各キューセグメ
ントを消去する。
The queue erasing means 113 erases each queue segment of the queue stopped by the queue stopping means 112.

【0037】キュー再初期化手段114は、キュー停止
手段112によって停止状態となったキューのキュー制
御情報部131を再初期化する。その後、キュー再初期
化手段114は、該キューを使用中状態とし、再度キュ
ーを使用できるようにする。
The queue reinitializing means 114 reinitializes the queue control information section 131 of the queue which has been stopped by the queue stopping means 112. Thereafter, the queue re-initialization unit 114 sets the queue to a busy state, and enables the queue to be used again.

【0038】データ登録手段115は、利用者プログラ
ム140からの要求により、キュー制御情報部131の
登録ポインタが示すエントリに、利用者プログラム14
0より渡されたデータを登録する。
In response to a request from the user program 140, the data registration means 115 stores the user program 14 in the entry indicated by the registration pointer of the queue control information section 131.
Register the data passed from 0.

【0039】データ取り出し手段116は、利用者プロ
グラム140からの要求により、キュー制御情報部13
1の取り出しポインタが示すエントリからデータを取り
出し利用者プログラム140に返却する。
The data fetching means 116 receives the request from the user program 140 and
The data is retrieved from the entry indicated by the retrieval pointer of No. 1 and returned to the user program 140.

【0040】データ逆取り出し手段117は、利用者プ
ログラム140からの要求により、キュー制御情報部1
31の登録ポインタが示すエントリの1つ前のエントリ
からデータを取り出し利用者プログラム140に返却す
る。
The data reverse fetching means 117 receives the request from the user program 140, and
The data is retrieved from the entry immediately before the entry indicated by the registration pointer 31 and returned to the user program 140.

【0041】キュー排他手段118は、キュー制御シス
テム110の各手段111〜117から使用され、キュ
ーセグメントが他のプロセスから参照・更新されないよ
うに、排他制御を行う。
The queue exclusion unit 118 is used by each of the units 111 to 117 of the queue control system 110 and performs exclusion control so that the queue segment is not referred to or updated by another process.

【0042】キュー制御システム110におけるキュー
生成手段111、キュー停止手段112、キュー消去手
段113、キュー再初期化手段114、データ登録手段
115、データ取り出し手段116、データ逆取り出し
手段117、キュー排他手段118は、コンピュータ上
で実行されるプログラムによりそれぞれの機能・処理が
実現される。
In the queue control system 110, the queue generating means 111, the queue stopping means 112, the queue erasing means 113, the queue reinitializing means 114, the data registering means 115, the data fetching means 116, the data reverse fetching means 117, and the queue exclusion means 118 , Each function and processing is realized by a program executed on a computer.

【0043】次に、図1、図2、図3、および図4乃至
図11のフローチャートを参照して本実施の形態の全体
の動作について詳細に説明する。図2は、本発明の第1
の実施の形態におけるキューセグメントを模式的に示す
図である。図3は、キュー制御情報部の一例を示す図で
ある。図4は、本発明の第1の実施の形態におけるキュ
ー生成手段11の動作の一例を説明するための流れ図で
ある。
Next, the overall operation of this embodiment will be described in detail with reference to FIGS. 1, 2, 3, and 4 to 11. FIG. 2 shows the first embodiment of the present invention.
It is a figure which shows the queue segment in embodiment of 1st typically. FIG. 3 is a diagram illustrating an example of the queue control information unit. FIG. 4 is a flowchart for explaining an example of the operation of the queue generating unit 11 according to the first embodiment of the present invention.

【0044】まず、利用者プログラム140はキューを
使用するために、キュー生成手段111を用いて、キュ
ーセグメント130を生成する。
First, the user program 140 generates the queue segment 130 using the queue generating means 111 in order to use the queue.

【0045】利用者プログラム140は、キュー生成手
段111には、セグメント数やデータ長などの情報を伝
える。
The user program 140 transmits information such as the number of segments and the data length to the queue generating means 111.

【0046】キュー生成手段111は、まず利用者プロ
グラム140から伝えられた初期セグメント数を取得す
る(図4のステップS11)。
The queue generating means 111 first obtains the initial number of segments transmitted from the user program 140 (step S11 in FIG. 4).

【0047】次に、キュー生成手段111は、初期セグ
メント数分のセグメントを生成し(ステップS12)、
生成した各セグメント間に環状のリンクを設定する(ス
テップS13)。
Next, the queue generating means 111 generates segments for the number of initial segments (step S12).
An annular link is set between the generated segments (step S13).

【0048】キューセグメントは、図2のように、セグ
メント毎に、環状にリンクされた構造となる。
As shown in FIG. 2, the queue segments have a ring-shaped structure for each segment.

【0049】続いて、キュー生成手段111は、第1の
セグメントのキュー制御情報部131に初期値を設定し
(ステップS14)、排他用セマフォや通知用セマフォ
といったセマフォを取得して、キュー制御情報部131
に格納する(ステップS15)。
Subsequently, the queue generating means 111 sets an initial value in the queue control information section 131 of the first segment (step S14), acquires a semaphore such as an exclusive semaphore or a notification semaphore, and acquires the queue control information. Part 131
(Step S15).

【0050】最後に、キュー生成手段111は、図示さ
れない、状態フラグを、”使用中”状態に設定し(ステ
ップS16)、第1セグメントのアドレスを、利用者プ
ログラム140に返却する(ステップS17)。なお、
状態フラグは、図1のキュー制御システムを構成するコ
ンピュータにおいて、書き換え可能なメモリ、レジスタ
等、任意の記憶装置に設定され、キューの状態(例えば
使用、停止等の状態)が設定される。
Finally, the queue generating means 111 sets a status flag (not shown) to the "in use" status (step S16), and returns the address of the first segment to the user program 140 (step S17). . In addition,
The status flag is set in an arbitrary storage device such as a rewritable memory and a register in the computer constituting the queue control system in FIG. 1, and the status of the queue (for example, the status of use or stop) is set.

【0051】以降、利用者プログラム140がキューを
操作する際には、返却された第1セグメントのアドレス
をキュー制御システム110に伝える。すなわち、第1
セグメントのアドレスをキーとして用いる。
Thereafter, when the user program 140 operates the queue, the address of the returned first segment is transmitted to the queue control system 110. That is, the first
Use the segment address as a key.

【0052】また、図3に示すように、キュー制御情報
部131に情報が格納されるのは、第1セグメントのみ
であり、第2セグメント以降では、次セグメントのアド
レスのみを保持している。すなわち図3に示すように、
セグメント1は、登録ポインタ、取り出しポインタ、デ
ータ長、データ数、次セグメント、使用セグメント数、
初期セグメント数、最大セグメント数、排他セマフォ、
通知セマフォ、待ち合わせ数の各欄よりなり、セグメン
ト1の次セグメントの欄にはセグメント2、セグメント
2の次セグメントの欄にはセグメント3、セグメント3
の次セグメントの欄にはセグメント1が初期設定されて
おいる。セグメント2、3のキュー制御情報部には、次
セグメントの欄のみが設定されている。
As shown in FIG. 3, information is stored in the queue control information section 131 only in the first segment, and after the second segment, only the address of the next segment is held. That is, as shown in FIG.
Segment 1 includes a registration pointer, a retrieval pointer, a data length, the number of data, a next segment, a number of used segments,
Initial segment count, maximum segment count, exclusive semaphore,
Each column of the notification semaphore and the number of waits is provided. The segment of the segment next to the segment 1 is the segment 2, the column of the segment next to the segment 2 is the segment 3, the segment 3
In the next segment column, segment 1 is initialized. In the queue control information section of the segments 2 and 3, only the column of the next segment is set.

【0053】図5は、本発明の第1の実施の形態におけ
るキュー停止手段112の動作の一例を説明するための
流れ図である。利用者プログラム140が、キューの使
用を終了する場合は、キュー停止手段112を使用し
て、キュー停止状態にし、その後、キュー消去手段11
3を使用してキューセグメント130を消去する。ま
た、キューの停止後に、キュー再初期化手段114を使
用することで、再度キューを使用することもできる。
FIG. 5 is a flow chart for explaining an example of the operation of the queue stopping means 112 according to the first embodiment of the present invention. When the user program 140 terminates the use of the queue, the queue is stopped by using the queue stopping means 112, and then the queue deleting means 11 is used.
3 to erase the queue segment 130. Further, after the queue is stopped, the queue can be used again by using the queue reinitialization unit 114.

【0054】キュー停止手段112は、まず、キュー排
他手段118を使用して、他のプロセスから同時に使用
されないように、キューを排他する(図5のステップS
21)。
The queue stopping unit 112 first excludes the queue using the queue exclusion unit 118 so that other processes do not use the queue at the same time (step S in FIG. 5).
21).

【0055】次に、キュー停止手段112は、キューの
状態を示す状態フラグをチェックし、状態が”使用中”
である場合には(ステップS22でYES)、状態フラ
グを、”停止”状態に設定する。
Next, the queue stopping means 112 checks the status flag indicating the status of the queue, and the status is "in use".
Is satisfied (YES in step S22), the status flag is set to a "stop" status.

【0056】最後に、キュー停止手段112は、キュー
排他手段118を使用してキューの排他を解除する(ス
テップS24)。
Finally, the queue stopping unit 112 releases the exclusion of the queue by using the queue exclusion unit 118 (step S24).

【0057】また、状態フラグが”使用中”でない場合
(ステップS22でNO)は、停止できない状態である
ため、停止失敗となる(ステップS25)。
If the status flag is not "in use" (NO in step S22), the stop is not possible, and the stop fails (step S25).

【0058】図6は、本発明の第1の実施の形態におけ
るキュー消去手段113の動作の一例を説明するための
流れ図である。キュー消去手段113は、まず、キュー
排他手段118を使用して、キューを排他する(図6の
ステップS31)。
FIG. 6 is a flow chart for explaining an example of the operation of the queue erasing means 113 according to the first embodiment of the present invention. The queue erasing unit 113 first excludes the queue using the queue exclusion unit 118 (step S31 in FIG. 6).

【0059】次に、キュー消去手段113は、状態フラ
グをチェックし、状態が”停止”状態である場合には
(ステップS32でYES)、使用しているキューセグ
メントを全て消去する(ステップS33)。
Next, the queue erasing means 113 checks the status flag, and if the status is "stop" (YES in step S32), erases all the queue segments used (step S33). .

【0060】次に、キュー消去手段113は、キュー排
他手段118を使用してキューの排他を解除し(ステッ
プS34)、セマフォを解放し(ステップS35)、終
了する。
Next, the queue erasing means 113 releases the exclusion of the queue by using the queue exclusion means 118 (step S34), releases the semaphore (step S35), and ends.

【0061】状態フラグが”停止”状態でない場合(ス
テップS32でNO)、消去できない状態であるため消
去失敗となり(ステップS36)、キュー排他手段11
8により、キューの排他を解除して(ステップS3
7)、終了する。
If the status flag is not "stop" (NO in step S32), the erasure fails because the erasure cannot be performed (step S36).
8 to release the exclusion of the queue (step S3
7), end.

【0062】図7は、本発明の第1の実施の形態におけ
るキュー再初期化手段114の動作の一例を説明するた
めの流れ図である。キュー再初期化手段114は、ま
ず、キュー排他手段118を使用してキューを排他する
(図7のステップS41)。
FIG. 7 is a flowchart for explaining an example of the operation of the queue reinitializing means 114 according to the first embodiment of the present invention. The queue reinitialization unit 114 first excludes the queue using the queue exclusion unit 118 (step S41 in FIG. 7).

【0063】次に、キュー再初期化手段114は、状態
フラグをチェックし、状態が”停止”状態である場合に
は(ステップS42でYES)、第1セグメントのキュ
ー制御情報部131に、初期値を設定する(ステップS
43)。キュー再初期化手段114が、第1セグメント
のキュー制御情報部131において、初期値に設定する
領域は、キューの使用により、値が更新される領域のみ
である。
Next, the queue re-initialization means 114 checks the status flag, and if the status is "stop" (YES in step S42), the queue re-initialization means 114 stores the initial status in the queue control information section 131 of the first segment. Set the value (Step S
43). In the queue control information section 131 of the first segment, the area that the queue reinitialization unit 114 sets to the initial value is only the area whose value is updated by using the queue.

【0064】続いて、キュー再初期化手段114は、状
態フラグを、”使用中”状態に設定する(ステップS4
4)。
Subsequently, the queue re-initializing means 114 sets the status flag to the "in use" status (step S4).
4).

【0065】最後に、キュー再初期化手段114は、キ
ュー排他手段118によりキューの排他を解除して(ス
テップS45)終了する。
Finally, the queue re-initialization means 114 releases the exclusion of the queue by the queue exclusion means 118 (step S45) and ends.

【0066】また、状態フラグのチェックにおいて、状
態フラグが”停止”状態でない場合(ステップS42で
NO)、キュー再初期化手段114による再初期化がで
きない状態であるため、再初期化失敗となる(ステップ
S46)。
If the status flag is not "stop" in the status flag check (NO in step S42), the reinitialization by the queue reinitialization means 114 cannot be performed, and the reinitialization fails. (Step S46).

【0067】利用者プログラム140が、キューにデー
タを登録する場合、データ登録手段115を使用する。
また、利用者プログラム140が、キューからデータを
取り出す場合は、データ取り出し手段116、あるいは
データ逆取り出し手段117を使用する。ここで、利用
者プログラム140が、LILO(Last InLa
st Out)方式でデータを取り出す場合には、デー
タ取り出し手段116を使用し、LIFO(Last
In First Out)方式でデータを取り出す場
合はデータ逆取り出し手段117を使用する。
When the user program 140 registers data in the queue, the data registration means 115 is used.
When the user program 140 retrieves data from the queue, the data retrieval unit 116 or the data reverse retrieval unit 117 is used. Here, the user program 140 is LILO (Last InLa).
When data is taken out by the (st Out) method, the data taking out means 116 is used, and the LIFO (Last
In the case of taking out data by the (In First Out) method, the data reverse taking out means 117 is used.

【0068】図8は、本発明の第1の実施の形態におけ
るデータ登録手段115の動作の一例を説明するための
流れ図である。データ登録手段115は、まず、キュー
排他手段118を使用してキューを排他する(図8のス
テップS51)。
FIG. 8 is a flow chart for explaining an example of the operation of the data registration means 115 according to the first embodiment of the present invention. The data registration unit 115 first excludes the queue using the queue exclusion unit 118 (step S51 in FIG. 8).

【0069】次に、データ登録手段115は、状態フラ
グをチェックし、状態が”使用中”状態である場合(ス
テップS52でYES)、続いてエントリのチェックを
行う。キュー制御情報部131の登録ポインタの指すエ
ントリ(「登録エントリ」という)がセグメント内の最
終エントリではない場合(ステップS53でNO)、次
登録ポインタに登録エントリの次のエントリを設定する
(ステップS54)。登録エントリの次のエントリは、
登録ポインタのセグメント内オフセットにキュー制御情
報部131のデータ長の値を加算することで容易に求め
られる。
Next, the data registration means 115 checks the status flag, and if the status is "in use" (YES in step S52), checks the entry. If the entry pointed to by the registration pointer of the queue control information section 131 (referred to as “registration entry”) is not the last entry in the segment (NO in step S53), the next entry of the registration entry is set in the next registration pointer (step S54). ). The next entry after the registration entry is
It is easily obtained by adding the value of the data length of the queue control information section 131 to the offset within the segment of the registration pointer.

【0070】また、データ登録手段115は、登録エン
トリがセグメント内の最終エントリである場合(ステッ
プS53でYES)、次登録ポインタに次セグメントの
先頭エントリを設定する(ステップS55)。尚、次登
録ポインタは、データ登録手段115のみで使用する作
業用の領域である。
When the registered entry is the last entry in the segment (YES in step S53), data registration means 115 sets the next entry pointer to the first entry of the next segment (step S55). The next registration pointer is a work area used only by the data registration unit 115.

【0071】次に、次登録ポインタが指すエントリがキ
ュー制御情報部131の取り出しポインタの指すエント
リと同じではない場合には(ステップS56でNO)、
データ登録手段115は、データの登録が可能であると
判断し、利用者プログラム140から伝えられたデータ
を登録エントリへ移送する(ステップS57)。
Next, if the entry pointed to by the next registration pointer is not the same as the entry pointed to by the extraction pointer of the queue control information section 131 (NO in step S56),
The data registration unit 115 determines that data registration is possible, and transfers the data transmitted from the user program 140 to the registration entry (step S57).

【0072】続いて、データ登録手段115は、次登録
ポインタの指すエントリを指すようにキュー制御情報部
131の登録ポインタを更新し(ステップS58)、キ
ュー制御情報部131のデータ数に1を加算する(ステ
ップS59)。
Subsequently, the data registration means 115 updates the registration pointer of the queue control information section 131 so as to point to the entry pointed to by the next registration pointer (step S58), and adds 1 to the number of data of the queue control information section 131. (Step S59).

【0073】最後に、データ登録手段115は、キュー
排他手段118を使用してキューの排他を解除し(ステ
ップS60)、終了する。
Finally, the data registration unit 115 releases the exclusion of the queue using the queue exclusion unit 118 (step S60), and ends.

【0074】また、次登録ポインタの指すエントリがキ
ュー制御情報部131の取り出しポインタの指すエント
リと同じである場合(ステップS56でYES)、登録
ポインタが取り出しポインタに追いつくということであ
り、次に登録できるエントリがない状態である。この場
合、空きエントリがないため、データ登録失敗とする
(ステップS61)。
If the entry pointed to by the next registration pointer is the same as the entry pointed to by the extraction pointer of the queue control information section 131 (YES in step S56), the registration pointer catches up with the extraction pointer. There are no entries available. In this case, since there is no empty entry, data registration fails (step S61).

【0075】また、状態フラグのチェックにおいて、状
態フラグが”使用中”状態でない場合(ステップS52
でNO)、データの登録ができない状態であるため登録
失敗となる(ステップS62)。
When checking the status flag, if the status flag is not "in use" (step S52)
NO), registration fails because data cannot be registered (step S62).

【0076】図9は、本発明の第1の実施の形態におけ
るデータ取り出し手段116の動作の一例を説明するた
めの流れ図である。データ取り出し手段116は、ま
ず、キュー排他手段118を使用してキューを排他する
(図9のステップS71)。
FIG. 9 is a flow chart for explaining an example of the operation of the data extracting means 116 according to the first embodiment of the present invention. First, the data extracting unit 116 excludes the queue using the queue exclusive unit 118 (step S71 in FIG. 9).

【0077】次に、データ取り出し手段116は、状態
フラグをチェックし、状態が”使用中”状態であるなら
ば(ステップS72でYES)、次に登録されているデ
ータの数をチェックする。キュー制御情報部131のデ
ータ数が0より大きい場合(ステップS73でYE
S)、データが存在するということであり、キュー制御
情報部131の取り出しポインタの指すエントリ(「取
り出しエントリ」)から、利用者プログラム140から
伝えられたデータ返却領域へデータを移送する(ステッ
プS74)。
Next, the data extracting means 116 checks the status flag, and if the status is "in use" (YES in step S72), checks the number of data registered next. When the number of data in the queue control information section 131 is larger than 0 (YE in step S73)
S), that is, the data exists, and the data is transferred from the entry (“fetch entry”) pointed to by the take pointer of the queue control information section 131 to the data return area transmitted from the user program 140 (step S74). ).

【0078】次に、データ取り出し手段116は、キュ
ー制御情報部131のデータ数から1を減算する(ステ
ップS75)。
Next, the data extracting means 116 subtracts 1 from the number of data in the queue control information section 131 (step S75).

【0079】続いて、取り出しエントリがセグメント内
の最終エントリではない場合(ステップS76でN
O)、データ取り出し手段116は、取り出しエントリ
の次のエントリを指すようにキュー制御情報部131の
データ取り出しポインタを更新する(ステップS7
7)。
Subsequently, when the fetched entry is not the last entry in the segment (N in step S76)
O), the data fetching unit 116 updates the data fetch pointer of the queue control information unit 131 so as to point to the entry next to the fetch entry (step S7).
7).

【0080】また、取り出しエントリがセグメント内の
最終エントリである場合(ステップS76でYES)、
データ取り出し手段116は、次セグメントの先頭エン
トリを指すようにデータ取り出しポインタを更新する
(ステップS78)。
If the extracted entry is the last entry in the segment (YES in step S76),
The data fetching unit 116 updates the data fetch pointer to point to the first entry of the next segment (step S78).

【0081】最後に、データ取り出し手段116は、キ
ュー排他手段118を使用してキューの排他を解除し
(ステップS79)、終了する。
Finally, the data fetching means 116 releases the exclusion of the queue using the queue exclusion means 118 (step S79), and ends.

【0082】また、データ数が0である場合は(ステッ
プS73でNO)、登録されているデータがないため、
データ取り出し失敗となる(ステップS80)。
If the number of data is 0 (NO in step S73), since there is no registered data,
Data retrieval fails (step S80).

【0083】また、状態フラグのチェックにおいて、状
態フラグが”使用中”状態でない場合(ステップS72
でNO)、データの取り出しができない状態であるた
め、取り出し失敗となる(ステップS81)。
When checking the status flag, if the status flag is not in the "in use" state (step S72).
(NO in step S81), the data cannot be retrieved, and the retrieval fails (step S81).

【0084】図10は、本発明の第1の実施の形態にお
けるデータ逆取り出し手段117の動作の一例を説明す
るための流れ図である。データ逆取り出し手段117
は、まず、キュー排他手段118を使用してキューを排
他する(図10のステップS91)。
FIG. 10 is a flowchart for explaining an example of the operation of the data reverse extracting means 117 according to the first embodiment of the present invention. Data reverse retrieval means 117
First excludes the queue using the queue exclusion means 118 (step S91 in FIG. 10).

【0085】次に、データ逆取り出し手段117は、状
態フラグをチェックし、状態が”使用中”状態であるな
らば(ステップS92でYES)、次に登録されている
データの数をチェックする。
Next, the data retrieving means 117 checks the status flag, and if the status is "in use" (YES in step S92), checks the number of data registered next.

【0086】キュー制御情報部131のデータ数が0よ
り大きい場合(ステップS93でYES)、キューセグ
メント中に登録データが存在するということである。
If the number of data in the queue control information section 131 is larger than 0 (YES in step S93), it means that registered data exists in the queue segment.

【0087】キュー制御情報部131の登録ポインタの
指すエントリ(登録エントリ)がセグメント内の先頭エ
ントリではない場合(ステップS94でNO)、データ
逆取り出し手段117は、登録エントリの1つ前のエン
トリを指すように登録ポインタを更新する(ステップS
95)。
If the entry (registration entry) pointed to by the registration pointer of the queue control information section 131 is not the first entry in the segment (NO in step S94), the reverse data fetching means 117 deletes the entry immediately before the registration entry. Update the registration pointer to point (step S
95).

【0088】登録エントリの1つ前のエントリは、登録
ポインタのセグメント内オフセットから、キュー制御情
報部131のデータ長の値を減算することで容易に求め
ることができる。
The entry immediately before the registration entry can be easily obtained by subtracting the data length value of the queue control information section 131 from the offset within the segment of the registration pointer.

【0089】また、登録エントリがセグメント内の先頭
エントリである場合には(ステップS94でYES)、
データ逆取り出し手段117は、登録ポインタが指すセ
グメントの1つ前のセグメントを求め(ステップS9
6)、そのセグメントの最終エントリを指すように登録
ポインタを更新する(ステップS97)。
If the registered entry is the first entry in the segment (YES in step S94),
The data reverse fetching unit 117 obtains the segment immediately before the segment indicated by the registration pointer (step S9).
6) Update the registration pointer to point to the last entry of the segment (step S97).

【0090】ここで、セグメントのキュー制御情報部1
31には、前セグメントへのリンクは存在しないが、キ
ューを構成する各セグメントは環状にリンクされている
ため、データ逆取り出し手段117は、次セグメントへ
のリンクを辿ることで、1つ前のセグメントに到達する
ことができる。
Here, the queue control information section 1 of the segment
31 does not have a link to the previous segment, but since the segments constituting the queue are linked in a ring, the data reverse fetch unit 117 traces the link to the next segment to The segment can be reached.

【0091】続いて、データ逆取り出し手段117は、
更新した登録ポインタの指すエントリから、利用者プロ
グラム140から伝えられたデータ返却領域へデータを
移送する(ステップS98)。
Subsequently, the data reverse extracting means 117
Data is transferred from the entry pointed to by the updated registration pointer to the data return area transmitted from the user program 140 (step S98).

【0092】次に、データ逆取り出し手段117は、キ
ュー制御情報部131のデータ数から「1」を減算する
(ステップS99)。
Next, the data reverse extracting means 117 subtracts "1" from the number of data in the queue control information section 131 (step S99).

【0093】最後に、データ逆取り出し手段117は、
キュー排他手段118を使用してキューの排他を解除し
(ステップS100)、終了する。
Finally, the data reverse extracting means 117
The exclusion of the queue is released using the queue exclusion unit 118 (step S100), and the process ends.

【0094】また、データ数が「0」である場合は(ス
テップS93でNO)、登録されているデータがないた
め、データ取り出し失敗となる(ステップS101)。
If the number of data is "0" (NO in step S93), there is no registered data, so that data extraction fails (step S101).

【0095】また、状態フラグのチェックにおいて、状
態フラグが”使用中”状態でない場合(ステップS92
でNO)、データの登録ができない状態であるため、登
録失敗となる(ステップS102)。
When checking the status flag, if the status flag is not "in use" (step S92)
NO), the registration fails because the data cannot be registered (step S102).

【0096】次に、本実施の形態の作用効果について説
明する。
Next, the operation and effect of this embodiment will be described.

【0097】本実施の形態では、データ登録時には、登
録ポインタの指すエントリにデータを移送し、登録ポイ
ンタを次のエントリを指すように更新し、データの取り
出し時には、取り出しポインタの指すエントリからデー
タを取り出し、取り出しポインタを次のエントリを指す
ように更新する、というように構成されているため、デ
ータ登録とデータ取り出し時における、キューの検索や
順方向チェインの張り替えが不要となり、高速にデータ
の登録および取り出しを行うことができる。
In this embodiment, at the time of data registration, the data is transferred to the entry pointed to by the registration pointer, and the registration pointer is updated so as to point to the next entry. Retrieval and retrieval pointers are updated to point to the next entry, so there is no need to search for queues or change forward chains during data registration and data retrieval, and register data at high speed. And take out can be done.

【0098】また、本実施の形態では、さらに、データ
の取り出し手段として、順方向に取り出す手段と、逆方
向に取り出す手段の2つ有しているため、FIFO方
式、およびLIFO方式の混在が可能となっている。こ
れにより、通常は、FIFO方式を用いて一度登録した
データを取り消す場合に、LIFO方式を用いることも
できる。
Further, in this embodiment, since there are two means for fetching data, a means for fetching data in the forward direction and a means for fetching data in the reverse direction, it is possible to mix the FIFO method and the LIFO method. It has become. As a result, usually, when canceling data once registered using the FIFO method, the LIFO method can be used.

【0099】また、本実施の形態では、さらに、利用者
プログラムからの要求により、キューを生成し、第1セ
グメントのアドレスをキーとして、以降のキュー操作を
行うよう構成されているため、1つの利用者プログラム
から、複数のキューを利用することができる。
Further, in the present embodiment, a queue is generated in response to a request from the user program, and subsequent queue operations are performed using the address of the first segment as a key. Multiple queues can be used from a user program.

【0100】また、本実施の形態では、さらに、使用を
終了したキューの消去や、再利用が可能となる構成され
ているため、メモリ資源を効率良く利用することができ
る。
Further, in this embodiment, since the queue which has been used can be deleted and reused, the memory resources can be used efficiently.

【0101】[0101]

【実施例】次に、具体的な実施例を用いて本実施の形態
の動作を説明する。
Next, the operation of this embodiment will be described with reference to specific examples.

【0102】利用者プログラム140がキューを使用を
開始するとき、キュー生成手段111に対し、データ長
48バイト、初期セグメント数3、最大セグメント数1
0としてキューの生成を要求する。
When the user program 140 starts using the queue, the queue generating means 111 is instructed to send a data length of 48 bytes, an initial segment number of 3, and a maximum segment number of 1.
Requests queue generation as 0.

【0103】キュー生成手段111では、初期セグメン
ト数の「3」を取得し(図4のステップS11)、3枚
のセグメントを生成する(ステップS12)。
The queue generating means 111 obtains the initial segment number "3" (step S11 in FIG. 4) and generates three segments (step S12).

【0104】続いて生成したセグメント間に環状のリン
クをリンクを設定する(ステップS13)。
Subsequently, a ring-shaped link is set between the generated segments (step S13).

【0105】セグメントは、図2のように”次セグメン
ト”領域によって環状に連結される。続いて、第1セグ
メント(図2のセグメント1)のキュー制御情報部13
1に初期値を設定する(ステップS14)。
The segments are connected in a ring by a "next segment" region as shown in FIG. Subsequently, the queue control information section 13 of the first segment (segment 1 in FIG. 2)
An initial value is set to 1 (step S14).

【0106】キュー制御情報部131は、図3に示す内
容で構成されており、登録ポインタおよび取り出しポイ
ンタの初期値は、セグメント1の先頭エントリを指すよ
うに設定する。
The queue control information section 131 has the contents shown in FIG. 3, and the initial values of the registration pointer and the extraction pointer are set so as to point to the first entry of the segment 1.

【0107】データ長には、利用者プログラム140か
ら伝えられた”48バイト”を設定し、データ数には”
0”を設定する。
The data length is set to “48 bytes” transmitted from the user program 140, and the number of data is set to “48 bytes”.
Set "0".

【0108】また、次セグメント領域は、先ほど環状リ
ンクを設定しているので、ここでは設定しない。
The next segment area is not set here because the ring link has been set previously.

【0109】また、初期セグメント数および最大セグメ
ント数には、利用者プログラムから伝えられた値であ
る”3”および”10”そのまま設定し、使用セグメン
ト数には現在の使用セグメント数、すなわち初期セグメ
ント数の”3”を設定する。
The initial segment number and the maximum segment number are set as they are “3” and “10” transmitted from the user program, and the used segment number is the current used segment number, that is, the initial segment number. Set the number “3”.

【0110】排他セマフォ、通知セマフォにはヌル(n
ull)値を設定し、待ち合わせプロセス数は”0”を
設定する。
The exclusive semaphore and the notification semaphore are null (n
(ull) value is set, and the number of waiting processes is set to “0”.

【0111】次に、キュー生成手段111は、排他セマ
フォおよび通知セマフォを取得し、キュー制御情報部1
31に格納する(ステップS15)。
Next, the queue generation means 111 acquires the exclusive semaphore and the notification semaphore, and
31 (step S15).

【0112】続いて、キュー生成手段111は、状態フ
ラグを”使用中”と設定し、セグメント1のアドレスA
を利用者プログラム140に返却する。
Subsequently, the queue generating means 111 sets the status flag to "in use", and sets the address A of the segment 1 to "in use".
Is returned to the user program 140.

【0113】これで、キューの生成が完了し、以降、利
用者プログラム140は、返却された第1セグメントの
アドレスAを用いて、このキューの操作を行うことがで
きる。
Thus, the creation of the queue is completed, and thereafter, the user program 140 can operate the queue using the returned address A of the first segment.

【0114】次に、データを登録する場合の動作を説明
する。
Next, the operation for registering data will be described.

【0115】図2および図3に示すような、登録ポイン
タが”セグメント1のエントリ4”を、取り出しポイン
タが”セグメント2のエントリ6”を指しており、登録
されているデータ数が”9”である場合に、新たなデー
タの登録を要求すると、データ登録手段115は、まず
キューを排他し(図8のステップS51)、状態フラグ
をチェックすると、状態は”使用中”である(ステップ
S52でYES)。
As shown in FIGS. 2 and 3, the registration pointer points to “entry 4 of segment 1”, the extraction pointer points to “entry 6 of segment 2”, and the number of registered data is “9”. In this case, when registration of new data is requested, the data registration unit 115 first excludes the queue (step S51 in FIG. 8), and when the status flag is checked, the status is "in use" (step S52). YES).

【0116】ここで、図2に示すように、セグメント1
にはエントリ1〜エントリ6があり、登録エントリは、
エントリ4であるため、セグメント1内の最終エントリ
ではない(ステップS53でNO)。よって、作業領域
の次登録ポインタに、”セグメント1のエントリ5”を
設定する(ステップS54)。
Here, as shown in FIG.
Has entries 1 to 6, and the registered entry is
Since this is entry 4, it is not the last entry in segment 1 (NO in step S53). Therefore, “entry 5 of segment 1” is set as the next registration pointer of the work area (step S54).

【0117】また、取り出しポインタは,”セグメント
2のエントリ5”であるため、次登録ポインタとは異な
る(ステップS56でNO)。
Since the extraction pointer is “entry 5 of segment 2”, it is different from the next registration pointer (NO in step S56).

【0118】そこで、データ登録手段115は、”セグ
メント1のエントリ4”に、登録データを移送し(ステ
ップS57)、登録ポインタに、”セグメント1のエン
トリ5”を設定し(ステップS58)、データ数に”
1”を加算して”10”とする(ステップS59)。
Then, the data registration means 115 transfers the registration data to “entry 4 of segment 1” (step S57), sets “entry 5 of segment 1” to the registration pointer (step S58), To the number
"1" is added to "10" (step S59).

【0119】最後に、データ登録手段115は、キュー
の排他を解除する(ステップS60)。これで、新たな
データの登録が完了する。
Lastly, the data registration means 115 releases the exclusion of the queue (step S60). This completes the registration of new data.

【0120】次に、データを取り出す場合の動作を説明
する。
Next, the operation for extracting data will be described.

【0121】図2および図3に示すような、登録ポイン
タが”セグメント1のエントリ4”を、取り出しポイン
タが”セグメント2のエントリ6”を指しており、登録
されているデータ数が”9”である場合に、FIFO方
式でのデータの取り出しを要求すると、データ取り出し
手段116は、まずキューを排他し(図9のステップS
71)、状態フラグをチェックすると、状態は”使用
中”である(ステップS72でYES)。また、データ
数は”9”であるため(ステップS73でYES)、セ
グメント2のエントリ6からデータ返却領域へデータを
移送し(ステップS74)、データ数から”1”を減算
して”8”とする(ステップS75)。
As shown in FIGS. 2 and 3, the registration pointer points to “entry 4 of segment 1”, the extraction pointer points to “entry 6 of segment 2”, and the number of registered data is “9”. , And when a request to retrieve data by the FIFO method is made, the data retrieval unit 116 first excludes the queue (step S in FIG. 9).
71), when the status flag is checked, the status is "in use" (YES in step S72). Since the number of data is "9" (YES in step S73), the data is transferred from the entry 6 of the segment 2 to the data return area (step S74), and "1" is subtracted from the number of data to "8". (Step S75).

【0122】ここで、図2に示すように、セグメント2
にはエントリ1〜エントリ6があり、取り出しエントリ
は、エントリ6であるため、セグメント2内の最終エン
トリである(ステップS76でYES)。そこで、キュ
ー制御情報部の取り出しポインタに”セグメント3のエ
ントリ1”を設定する(ステップS78)。
Here, as shown in FIG.
Has entry 1 to entry 6, and since the entry to be taken is entry 6, it is the last entry in segment 2 (YES in step S76). Therefore, “entry 1 of segment 3” is set as the extraction pointer of the queue control information section (step S78).

【0123】最後に、データ取り出し手段116は、キ
ューの排他を解除する(ステップS79)。これで、F
IFO方式でデータを取り出すことができた。
Finally, the data retrieving means 116 releases the exclusion of the queue (step S79). Now, F
Data could be taken out by the IFO method.

【0124】同様に、図2および図3に示すような、登
録ポインタが”セグメント1のエントリ4”を、取り出
しポインタが”セグメント2のエントリ6”を指してお
り、登録されているデータ数が”9”である場合に、L
IFO方式でのデータの取り出しを要求すると、データ
逆取り出し手段117は、まずキューを排他し(図10
のステップS91)、状態フラグをチェックすると、状
態は”使用中”である(ステップS92でYES)。ま
た、データ数は”9”である(ステップS93でYE
S)。ここで、図2のように、セグメント1にはエント
リ1〜エントリ6があり、登録エントリはエントリ4で
あるため、セグメント1内の先頭エントリはない(ステ
ップS94でNO)。
Similarly, as shown in FIGS. 2 and 3, the registration pointer points to “entry 4 of segment 1”, the takeout pointer points to “entry 6 of segment 2”, and the number of registered data points If “9”, L
When requesting data retrieval by the IFO method, the data reverse retrieval unit 117 first excludes the queue (FIG. 10).
When the status flag is checked, the status is "in use" (YES in step S92). The number of data is “9” (YE in step S93).
S). Here, as shown in FIG. 2, since segment 1 has entries 1 to 6, and the registered entry is entry 4, there is no leading entry in segment 1 (NO in step S94).

【0125】そこで、データ逆取り出し手段117は、
登録エントリの1つ前のエントリである”セグメント1
のエントリ3”(最後に登録されたエントリ)を、登録
ポインタに設定し(ステップS95)、”セグメント1
のエントリ3”から、データ返却領域へデータを移送し
(ステップS98)、データ数から「1」を減算して”
8”とする(ステップS99)。
Therefore, the data reverse fetching means 117
"Segment 1" which is the entry before the registration entry
Entry 3 ”(the last registered entry) is set as a registration pointer (step S95), and“ Segment 1 ”is set.
Is transferred from the entry 3 "to the data return area (step S98), and" 1 "is subtracted from the number of data to"
8 "(step S99).

【0126】最後に、データ逆取り出し手段117は、
キューの排他を解除する(ステップS100)。これ
で、LIFO方式でデータを取り出すことができた。
Finally, the data reverse extracting means 117
The exclusion of the queue is released (step S100). Thus, data could be extracted by the LIFO method.

【0127】次に、本発明の第2の実施の形態につい
て、図面を参照して詳細に説明する。図11は、本発明
の第2の実施の形態の構成を示す図である。この実施の
形態は、図1に示した前記実施の形態の構成に、キュー
拡張手段219と、キュー縮退手段220を追加したも
のである。
Next, a second embodiment of the present invention will be described in detail with reference to the drawings. FIG. 11 is a diagram showing a configuration of the second exemplary embodiment of the present invention. In this embodiment, a queue expansion unit 219 and a queue reduction unit 220 are added to the configuration of the embodiment shown in FIG.

【0128】図11を参照すると、本発明の第2の実施
の形態は、プログラム制御により動作する計算機システ
ム200と、キュー制御システム210と、キューセグ
メント230と、利用者プログラム240と、を備えて
構成されている。
Referring to FIG. 11, the second embodiment of the present invention includes a computer system 200 that operates under program control, a queue control system 210, a queue segment 230, and a user program 240. It is configured.

【0129】キュー制御システム210は、キュー生成
手段211と、キュー停止手段212と、キュー消去手
段213と、キュー再初期化手段214と、データ登録
手段215と、データ取り出し手段216と、データ逆
取り出し手段217と、キュー排他手段218と、キュ
ー拡張手段219と、キュー縮退手段220とを含む。
The queue control system 210 includes a queue generation unit 211, a queue stop unit 212, a queue deletion unit 213, a queue reinitialization unit 214, a data registration unit 215, a data extraction unit 216, and a data reverse extraction unit. Means 217, queue exclusion means 218, queue expansion means 219, and queue degeneration means 220.

【0130】キューセグメント230は、キュー制御情
報部231と、キューデータ部232とを含む。
[0130] The queue segment 230 includes a queue control information section 231 and a queue data section 232.

【0131】これらの手段はそれぞれ概略つぎのように
動作する。ここでは、第1の実施の形態と動作が異なる
動作について説明する。
Each of these means operates roughly as follows. Here, an operation different from the first embodiment will be described.

【0132】キュー再初期化手段214は、キュー停止
手段212により停止状態となったキューのキュー制御
情報部を再初期化し、また、キューセグメントの数を初
期セグメント数になるようにセグメントを消去し環状リ
ンクを再設定する。その後、キュー再初期化手段214
はキューを使用中状態とし、再度キューを使用できるよ
うにする。
The queue reinitializing means 214 reinitializes the queue control information section of the queue which has been stopped by the queue stopping means 212, and deletes the queue segments so that the number of queue segments becomes the initial number of segments. Reconfigure the ring link. Then, the queue re-initialization means 214
Puts the queue in use and makes the queue available again.

【0133】データ登録手段215は、利用者プログラ
ム240からの要求により、キュー制御情報部231の
登録ポインタが示すエントリに利用者プログラム240
より渡されたデータを登録する。また、データ登録手段
215は、データの登録時にセグメントが不足する場合
は、キュー拡張手段219を使用して新たなセグメント
を生成しキューを拡張する。
In response to a request from the user program 240, the data registration means 215 stores the user program 240 in the entry indicated by the registration pointer of the queue control information section 231.
Register the passed data. If there is a shortage of segments at the time of data registration, the data registration unit 215 generates a new segment using the queue expansion unit 219 to expand the queue.

【0134】データ取り出し手段216は、利用者プロ
グラム240からの要求により、キュー制御情報部23
1の取り出しポインタが示すエントリからデータを取り
出し利用者プログラムに返却する。また、データ取り出
し手段216は、キュー縮退手段220を使用してデー
タが登録されていないセグメントを消去する。
The data retrieving means 216 receives the request from the user program 240 and
Data is retrieved from the entry indicated by the retrieval pointer of No. 1 and returned to the user program. Further, the data fetching unit 216 uses the queue degenerating unit 220 to delete the segment in which no data is registered.

【0135】データ逆取り出し手段217は、利用者プ
ログラム240からの要求により、キュー制御情報部1
31の登録ポインタが示すエントリの1つ前のエントリ
からデータを取り出し、利用者プログラム240に返却
する。また、データ逆取り出し手段217は、キュー縮
退手段220を使用して、データが登録されていないセ
グメントを消去する。
The data reverse fetching means 217 receives the request from the user program 240, and
The data is extracted from the entry immediately before the entry indicated by the registration pointer 31 and returned to the user program 240. In addition, the data reverse fetching unit 217 uses the queue degenerating unit 220 to delete the segment in which the data is not registered.

【0136】キュー拡張手段219は、新たにセグメン
トを1枚生成し、前セグメントの”次セグメント”に生
成したセグメントを設定し、生成したセグメントの”次
セグメント”には、元々、前セグメントに設定されてい
たセグメントを設定することで、キューセグメントを追
加し、キューを拡張する。
The queue expansion means 219 generates one new segment, sets the generated segment as the “next segment” of the previous segment, and sets the generated “next segment” as the previous segment. By setting the segment that has been set, a queue segment is added and the queue is extended.

【0137】キュー縮退手段220は、セグメントを1
枚消去し、消去したセグメントの”次セグメント”に設
定されていたセグメントを、前セグメントの”次セグメ
ント”に設定することで、キューセグメントを減らし、
キューを縮退させる。
The queue shrinking means 220 sets the segment to 1
The number of queue segments is reduced by setting the segment that was set as the “next segment” of the erased segment to the “next segment” of the previous segment,
Degenerate the queue.

【0138】キュー制御システム210におけるキュー
生成手段211、キュー停止手段212、キュー消去手
段213、キュー再初期化手段214、データ登録手段
215、データ取り出し手段216、データ逆取り出し
手段217、キュー排他手段218、キュー拡張手段2
19、キュー縮退手段220は、コンピュータ上で実行
されるプログラムによりそれぞれの機能・処理が実現さ
れる。
In the queue control system 210, the queue generating means 211, the queue stopping means 212, the queue erasing means 213, the queue reinitializing means 214, the data registering means 215, the data extracting means 216, the data reverse extracting means 217, and the queue exclusion means 218. , Queue expansion means 2
19. The functions and processes of the queue reduction means 220 are realized by a program executed on a computer.

【0139】次に、図11および図14〜図19のフロ
ーチャートを参照して本実施の形態の全体の動作につい
て詳細に説明する。ここでは、第1の実施の形態と動作
が異なる手段について説明する。
Next, the overall operation of the present embodiment will be described in detail with reference to FIG. 11 and the flowcharts of FIGS. Here, means different from the first embodiment in operation will be described.

【0140】図14は、本発明の第2の実施の形態にお
けるキュー再初期化手段214の動作の一例を説明する
ための流れ図である。キュー再初期化手段214にて、
キューを再初期化する場合において、キュー制御情報部
231の使用セグメント数と初期セグメント数を比較
し、使用セグメント数>初期セグメント数である場合
(図14のステップS113でYES)は、キューが拡
張されているということであり、初期状態に戻す処理を
実行する。
FIG. 14 is a flow chart for explaining an example of the operation of the queue reinitialization means 214 according to the second embodiment of the present invention. In the queue reinitialization means 214,
When the queue is reinitialized, the number of used segments in the queue control information unit 231 is compared with the number of initial segments, and if the number of used segments is larger than the number of initial segments (YES in step S113 in FIG. 14), the queue is expanded. That is, the process of returning to the initial state is executed.

【0141】まず、キュー再初期化手段214は、拡張
したセグメント数、すなわち(使用セグメント数-初期
セグメント数)分のセグメントを、第2セグメント以降
から削除する(ステップS114)。
First, the queue re-initializing means 214 deletes the number of segments that have been expanded, that is, (the number of used segments−the number of initial segments) from the second segment onward (step S114).

【0142】次に、キュー再初期化手段214は、残っ
たセグメント間の環状リンクを再設定する(ステップS
115)。こうして、キューセグメントの状態が、初期
状態となる。
Next, the queue re-initializing means 214 resets the circular link between the remaining segments (step S).
115). Thus, the state of the queue segment becomes the initial state.

【0143】また、使用セグメント数≦初期セグメント
数である場合(ステップS113でNO)は、キューは
拡張されていないため、初期状態に戻す処理(ステップ
S114,S115)は不要である。
When the number of used segments ≦ the number of initial segments is satisfied (NO in step S113), the queue is not expanded, and the process of returning to the initial state (steps S114 and S115) is unnecessary.

【0144】図15は、本発明の第2の実施の形態にお
けるデータ登録手段215の動作の一例を説明するため
の流れ図である。
FIG. 15 is a flow chart for explaining an example of the operation of the data registration means 215 according to the second embodiment of the present invention.

【0145】利用者プログラム240がキューにデータ
を登録する場合において、データ登録手段215では、
キュー制御情報部231の登録ポインタの指すエントリ
(「登録エントリ」という)がセグメント内の最終エン
トリである場合(図15のステップS123でYE
S)、登録ポインタの指すセグメント(以降、登録セグ
メント)の次セグメントが、取り出しポインタが指して
いるセグメントであり(ステップS125でYES)、
使用セグメントが増加しても最大セグメント数を超えな
い場合、すなわち”使用セグメント数+1≦最大セグメ
ント数”である場合(ステップS126でYES)は、
キュー拡張手段219に登録セグメントを指定してキュ
ーを拡張する(ステップS127)。
In the case where the user program 240 registers data in the queue, the data registration means 215
When the entry pointed to by the registration pointer of the queue control information section 231 (referred to as “registration entry”) is the last entry in the segment (YE in step S123 in FIG. 15).
S), the segment next to the segment pointed to by the registration pointer (hereinafter, the registered segment) is the segment pointed to by the extraction pointer (YES in step S125),
If the number of used segments does not exceed the maximum number of segments even if the number of used segments increases, that is, if “number of used segments + 1 ≦ maximum number of segments” (YES in step S126),
The queue is expanded by designating the registration segment in the queue expansion unit 219 (step S127).

【0146】キュー拡張手段219は、新しいセグメン
トを1枚生成し(図18のステップS181)、指定さ
れたセグメント、ここでは登録セグメントの次セグメン
トが生成したセグメントとなるように、環状リンクを再
設定し(ステップS182)、使用セグメント数に1を
加算する(ステップS183)。
The queue expanding means 219 generates one new segment (step S181 in FIG. 18) and resets the circular link so that the designated segment, here the next segment of the registered segment, becomes the generated segment. Then, 1 is added to the number of used segments (step S183).

【0147】これで、データ登録手段215において、
登録セグメントの次セグメントとして新しいキューセグ
メントが追加された。
Thus, in the data registration means 215,
A new queue segment has been added as the next segment after the registered segment.

【0148】続いて、”次登録ポインタ”に次セグメン
ト、すなわち追加したセグメントの先頭エントリを設定
し(ステップS128)、以降の処理を行う。
Subsequently, the next segment, that is, the first entry of the added segment is set in the "next registration pointer" (step S128), and the subsequent processing is performed.

【0149】尚、登録セグメントの次セグメントが取り
出しポインタが指しているセグメントはない場合(ステ
ップS125でNO)、データが1つも登録されいない
セグメントが1枚以上あるということであり、その時点
での拡張の必要はないため新たなセグメントは生成しな
い。
If there is no segment pointed to by the extraction pointer to the segment next to the registered segment (NO in step S125), it means that there is at least one segment in which no data has been registered. No new segment is generated because there is no need for expansion.

【0150】また、”使用セグメント数+1>最大セグ
メント数”となる場合(ステップS126でNO)、生
成時に指定された最大セグメント数を超えてしまうため
新たなセグメントは生成しない。
When "the number of used segments + 1> the maximum number of segments" is satisfied (NO in step S126), the number of segments exceeds the maximum number of segments specified at the time of generation, so that a new segment is not generated.

【0151】図16は、本発明の第2の実施の形態にお
けるデータ取り出し手段216の動作の一例を説明する
ための流れ図である。
FIG. 16 is a flow chart for explaining an example of the operation of the data extracting means 216 according to the second embodiment of the present invention.

【0152】利用者プログラム240がキューからFI
FO方式でデータを取り出す場合において、データ取り
出し手段216では、キュー制御情報部231の取り出
しポインタの指すエントリがセグメント内の最終エント
リである場合(図16のステップS146でYES)、
次セグメントの先頭エントリを指すようにデータ取り出
しポインタを更新する(ステップS148)。
When the user program 240 sends the FI
When fetching data by the FO method, the data fetching unit 216 determines that the entry pointed to by the fetch pointer of the queue control information unit 231 is the last entry in the segment (YES in step S146 in FIG. 16).
The data fetch pointer is updated to point to the first entry of the next segment (step S148).

【0153】ここで、登録ポインタが指すセグメントが
データを取り出したセグメント(以降、「取り出しセグ
メント」という)でない場合であって(ステップS14
9でNO)、取り出しセグメントが第1セグメントでは
なく(ステップS150でNO)、過去にキューの拡張
を行っておりセグメントを削除しても、初期セグメント
数を下回らない、すなわち ”使用セグメント数−1≧初期セグメント数” である場合(ステップS151でYES)、キュー縮退
手段220に、取り出しセグメントを指定してキューを
縮退する(ステップS152)。
Here, the case where the segment pointed to by the registration pointer is not the segment from which the data was extracted (hereinafter, referred to as “extracted segment”) (step S14)
9), the fetched segment is not the first segment (NO in step S150), and even if the queue has been expanded in the past and the segment has been deleted, the number of segments does not fall below the initial number of segments, that is, “the number of used segments−1”. If ≧ initial number of segments ”(YES in step S151), the queue is degenerated by designating a fetch segment to the queue degeneration means 220 (step S152).

【0154】キュー縮退手段220は、指定されたセグ
メント、ここでは取り出しセグメントを消去し(図19
のステップS191)、指定されたセグメントの前セグ
メントが次セグメントを指すように環状リンクを再設定
し(ステップS192)、使用セグメント数から1を減
算する(ステップS193)。
The queue shrinking means 220 deletes the designated segment, here, the fetched segment (FIG. 19).
Step S191), the circular link is reset so that the previous segment of the designated segment points to the next segment (Step S192), and 1 is subtracted from the number of used segments (Step S193).

【0155】尚、登録ポインタの指すセグメントが取り
出しセグメントである場合(ステップS149でYE
S)は、取り出しセグメント中に他のデータが存在する
状態であるためセグメントを削除しない。取り出しセグ
メントが第1セグメントのとき(ステップS150でY
ES)、第1セグメントは利用者プログラム240にキ
ーとして使用されるセグメントであり、また制御情報が
格納されているセグメントであるため、削除しない。
If the segment pointed to by the registration pointer is a fetch segment (YE in step S149)
S) does not delete the segment because other data exists in the fetch segment. When the extraction segment is the first segment (Y in step S150)
ES), the first segment is a segment used as a key in the user program 240 and is a segment in which control information is stored.

【0156】また、”使用セグメント数−1<初期セグ
メント数”である場合(ステップS151でNO)は、
初期状態のセグメント数を下回ってしまうため、セグメ
ントを削除しない。
When “the number of used segments−1 <the number of initial segments” is satisfied (NO in step S151),
Do not delete segments because the number of segments is less than the initial number of segments.

【0157】図17は、本発明の第2の実施の形態にお
けるデータ逆取り出し手段217の動作の一例を説明す
るための流れ図である。
FIG. 17 is a flowchart for explaining an example of the operation of the data reverse extracting means 217 according to the second embodiment of the present invention.

【0158】利用者プログラム240がキューからLI
FO方式でデータを取り出す場合において、データ逆取
り出し手段217では、キュー制御情報部231の登録
ポインタが指すエントリが、セグメント内の先頭エント
リである場合(図17のステップS164でYES)、
前セグメントの最終エントリを指すように、登録ポイン
タを更新する(図17のステップS166、S16
7)。
When the user program 240 sends the LI from the queue
When fetching data by the FO method, the data reverse fetch unit 217 determines that the entry pointed to by the registration pointer of the queue control information unit 231 is the first entry in the segment (YES in step S164 in FIG. 17).
The registration pointer is updated to point to the last entry of the previous segment (steps S166 and S16 in FIG. 17).
7).

【0159】ここで、更新前の登録ポインタが指してい
たセグメント(以降、元セグメント)が取り出しポイン
タの指すセグメントではない場合であって(ステップS
168でNO)、元セグメントが第1セグメントではな
く(ステップS169でNO)、過去にキューの拡張が
起こっており、 ”使用セグメント数−1≧初期セグメント数” である場合(ステップS170でYES)には、キュー
縮退手段220に元セグメントを指定してキューを縮退
する(ステップS171)。キュー縮退手段220によ
り、元セグメントは消去される。
In this case, the segment pointed to by the registration pointer before the update (hereinafter, the original segment) is not the segment pointed to by the extraction pointer (step S
168), the original segment is not the first segment (NO in step S169), and queue expansion has occurred in the past, and “the number of used segments−1 ≧ the number of initial segments” is satisfied (YES in step S170). In step S171, the original segment is specified to the queue reduction unit 220 to reduce the queue. The original segment is deleted by the queue degeneration means 220.

【0160】尚、更新前の登録ポインタが指していたセ
グメント(「元セグメント」という)が取り出しポイン
タの指すセグメントの場合には(ステップS168でY
ES)、元セグメント中に他のデータが存在する状態で
あるため、セグメントを削除しない。
If the segment pointed to by the registration pointer before updating (referred to as “original segment”) is the segment pointed to by the extraction pointer (Y in step S168)
ES), because other data exists in the original segment, the segment is not deleted.

【0161】元セグメントが第1セグメントの場合(ス
テップS169でYES)、第1セグメントは削除しな
い。
If the original segment is the first segment (YES in step S169), the first segment is not deleted.

【0162】また、”使用セグメント数−1<初期セグ
メント数”となる場合(ステップS170でNO)は、
初期状態のセグメント数を下回ってしまうため、セグメ
ントを削除しない。
When “the number of used segments−1 <the number of initial segments” is satisfied (NO in step S170),
Do not delete segments because the number of segments is less than the initial number of segments.

【0163】次に、本実施の形態の作用効果について説
明する。
Next, the operation and effect of this embodiment will be described.

【0164】本発明の形態では、データの登録時におい
て、エントリが不足しそうな場合にセグメントを追加
し、データの取り出し時に、データが存在しないセグメ
ントを検出したらセグメントを消去するように構成され
ているため、データの数が一時的に多くなった場合に自
動的にキューを拡張し、データの数が減ったらキューを
縮退することができ、メモリ資源を効率良く利用するこ
とができる。
In the embodiment of the present invention, when data is registered, a segment is added when entries are likely to be insufficient, and when data is taken out, a segment is deleted when a segment having no data is detected. Therefore, when the number of data temporarily increases, the queue can be automatically expanded, and when the number of data decreases, the queue can be reduced, and the memory resources can be used efficiently.

【0165】また、本実施の形態では、さらに、データ
の登録時に、登録ポインタと取り出しポインタが同じセ
グメントを指すとき、すなわち登録ポインタが取り出し
ポインタに追いつきエントリ不足となる可能性が発生し
た場合にセグメントを追加する構成となっているため、
エントリ不足となる前に事前にキューを拡張することが
できる。
Further, in the present embodiment, when registering data, when the registration pointer and the retrieval pointer point to the same segment, that is, when the registration pointer catches up with the retrieval pointer and there is a possibility that the number of entries becomes insufficient, the segment Is added, so
The queue can be expanded in advance before running out of entries.

【0166】次に、具体的な実施例を用いて本実施の形
態の動作を説明する。
Next, the operation of this embodiment will be described using a specific example.

【0167】キューが図2および図3に示すように、登
録ポインタが”セグメント1のエントリ4”を、取り出
しポインタが”セグメント2のエントリ6”を指してお
り、登録されているデータ数が”9”、使用セグメント
数3、初期セグメント数3、最大セグメント数10であ
るとする。ここで利用者プログラムよりデータが2つ登
録されると、登録ポインタは”セグメント1のエントリ
6”を指し、データ数は11となる。この状態で、さら
にデータの登録が要求された場合、登録エントリはエン
トリ6でセグメント1の最終エントリであり(図15の
ステップS123でYES)、取り出しポインタの指す
セグメントは”セグメント2”であり、”セグメント
1”の次セグメントである(ステップS125でYE
S)。
As shown in FIG. 2 and FIG. 3, the registration pointer points to “entry 4 of segment 1”, the takeout pointer points to “entry 6 of segment 2”, and the number of registered data is “ 9 ”, the number of used segments is 3, the number of initial segments is 3, and the maximum number of segments is 10. Here, when two pieces of data are registered from the user program, the registration pointer points to “entry 6 of segment 1”, and the number of data becomes 11. In this state, if further data registration is requested, the registration entry is entry 6, which is the last entry of segment 1 (YES in step S123 in FIG. 15), the segment pointed to by the extraction pointer is "segment 2", This is the next segment of “segment 1” (YE in step S125)
S).

【0168】また、 使用セグメント数+1=4≦10 であるため(ステップS126でYES)、データ登録
手段215は、キュー拡張手段219により、セグメン
ト1の次セグメントとして、セグメント4を追加する
(ステップS127)。
Further, since the number of used segments + 1 = 4 ≦ 10 (YES in step S126), the data registering unit 215 adds the segment 4 as the next segment of the segment 1 by the queue expanding unit 219 (step S127). ).

【0169】このように、キューは拡張され、図12お
よび図13に示す状態となる。
As described above, the queue is expanded to the state shown in FIG. 12 and FIG.

【0170】次に、キューが図12および図13に示す
ように、登録ポインタが”セグメント4のエントリ1”
を、取り出しポインタが”セグメント2のエントリ6”
を指しており、登録されているデータ数が”13”、使
用セグメント数4、初期セグメント数=3、最大セグメ
ント数=10であるとする。
Next, as shown in FIGS. 12 and 13, when the queue has a registration pointer of "entry 1 of segment 4".
And the extraction pointer is “entry 6 of segment 2”
It is assumed that the number of registered data is “13”, the number of used segments is 4, the initial number of segments is 3, and the maximum number of segments is 10.

【0171】この状態で、FIFO方式でのデータの取
り出しを要求する場合、データ取り出し手段216は、
取り出しエントリは、エントリ6で、セグメント2の最
終エントリであるため(図16のステップS146)、
取り出しポインタに、”セグメント3のエントリ1”を
設定する(ステップS148)。
In this state, when requesting data fetching by the FIFO method, the data fetching means 216
Since the fetched entry is entry 6 and is the last entry of segment 2 (step S146 in FIG. 16),
“Entry 1 of segment 3” is set to the extraction pointer (step S148).

【0172】ここで、登録ポインタの指すセグメント
は”セグメント4”であり、”セグメント2”ではなく
(ステップS149でNO)、”セグメント2”は第1
セグメントではない(ステップS150でNO)。
Here, the segment pointed to by the registration pointer is “segment 4”, not “segment 2” (NO in step S149), and “segment 2” is the first segment.
It is not a segment (NO in step S150).

【0173】また、 使用セグメント数−1=3≧3 であるため(ステップS151でYES)、データ取り
出し手段216は、キュー縮退手段220によりセグメ
ント2を消去する(ステップS152)。
Further, since the number of used segments −1 = 3 ≧ 3 (YES in step S151), the data extracting unit 216 deletes the segment 2 by the queue degenerating unit 220 (step S152).

【0174】このように、キューが縮退され、セグメン
ト2の代わりにセグメント4となった図12および図1
3の状態となる。
As described above, the queue is degenerated and becomes the segment 4 instead of the segment 2 in FIGS.
State 3 is reached.

【0175】同様に、キューが、図12および図13に
示すように、登録ポインタが”セグメント4のエントリ
1”を、取り出しポインタが”セグメント2のエントリ
6”を指しており、登録されているデータ数が”1
3”、使用セグメント数が”4”、初期セグメント数
が”3”、最大セグメント数が”10”であるとする。
Similarly, as shown in FIGS. 12 and 13, the queue is registered with the registration pointer pointing to “entry 1 of segment 4” and the takeout pointer pointing to “entry 6 of segment 2”. The number of data is "1"
Assume that the number of segments is "3", the number of segments used is "4", the number of initial segments is "3", and the maximum number of segments is "10".

【0176】この状態で、LIFO方式でのデータの取
り出しを要求する場合、データ逆取り出し手段217
は、登録ポインタの指すエントリはセグメント4の先頭
エントリであるため(図17のステップS164でYE
S)、登録ポインタにセグメント1のエントリ6を設定
する(ステップS166、S167)。
In this state, when requesting data extraction by the LIFO method, the data reverse extraction means 217
Indicates that the entry pointed to by the registration pointer is the head entry of segment 4 (YE in step S164 in FIG. 17).
S), the entry 6 of the segment 1 is set as the registration pointer (steps S166 and S167).

【0177】ここで、取り出しポインタは、セグメント
4ではなく、セグメント2を指しており(ステップS1
68でNO)、セグメント4は、第1セグメントではな
く(ステップS169でNO)、 使用セグメント数−1=3≧3 であるため(ステップS170でYES)、データ逆取
り出し手段217は、キュー縮退手段220により、セ
グメント4を消去する(ステップS171)。このよう
に、キューのセグメント4が縮退され、図2および図3
の状態となる。
Here, the extraction pointer points to segment 2 instead of segment 4 (step S1).
68, NO), the segment 4 is not the first segment (NO in step S169), and the number of used segments −1 = 3 ≧ 3 (YES in step S170). By 220, the segment 4 is erased (step S171). In this way, the segment 4 of the queue is degenerated, and FIG. 2 and FIG.
State.

【0178】次に、本発明の第3の実施の形態について
図面を参照して詳細に説明する。
Next, a third embodiment of the present invention will be described in detail with reference to the drawings.

【0179】図20を参照すると、本発明の第3の実施
の形態は、プログラム制御により動作する計算機システ
ム300と、キュー制御システム310と、キューセグ
メント330と、利用者プログラム340と、利用者プ
ログラム341とから構成されている。
Referring to FIG. 20, in the third embodiment of the present invention, a computer system 300 operated by program control, a queue control system 310, a queue segment 330, a user program 340, a user program 341.

【0180】キュー制御システム310は、キュー生成
手段311と、キュー停止手段312と、キュー消去手
段313と、キュー再初期化手段314と、データ登録
手段315と、データ取り出し手段316と、データ逆
取り出し手段317と、キュー排他手段318と、キュ
ー拡張手段319と、キュー縮退手段320と、待ち合
わせ手段321とを含む。
The queue control system 310 includes a queue generation unit 311, a queue stop unit 312, a queue deletion unit 313, a queue re-initialization unit 314, a data registration unit 315, a data extraction unit 316, and a data reverse extraction unit. Means 317, queue exclusion means 318, queue expansion means 319, queue degeneration means 320, and queuing means 321.

【0181】キューセグメント330は、キュー制御情
報部331と、キューデータ部332とを含む。
[0181] The queue segment 330 includes a queue control information section 331 and a queue data section 332.

【0182】これらの手段はそれぞれ概略つぎのように
動作する。ここでは、第1、第2の実施の形態と動作が
異なる手段について説明する。
Each of these means operates roughly as follows. Here, means different from those of the first and second embodiments in operation will be described.

【0183】キュー停止手段312は、待ち合わせ手段
321を使用してデータあるいはエントリを待ち合わせ
ているプロセスを起動し、キューを停止状態として以降
のデータの登録および取り出しを禁止する。
The queue stopping unit 312 starts a process waiting for data or entry by using the waiting unit 321 to put the queue in a stopped state and prohibits the subsequent registration and retrieval of data.

【0184】データ登録手段315は、利用者プログラ
ム(340/341)からの要求により、キュー制御情
報部331の登録ポインタが示すエントリに利用者プロ
グラムより渡されたデータを登録する。
The data registration means 315 registers the data passed from the user program in the entry indicated by the registration pointer of the queue control information section 331 in response to a request from the user program (340/341).

【0185】このとき、データの登録を待ち合わせてい
るプロセスが存在する場合は、待ち合わせ手段321を
使用して待ち合わせているプロセスを起動する。すなわ
ち、データの登録を待ち合わせ数が1以上である場合、
通知セマフォに対して通知を行い、待ち合わせを解除す
る。また、データの登録時に空きエントリがない場合
は、待ち合わせ手段321を使用してエントリが空くの
を待ち合わせる。
At this time, if there is a process waiting for data registration, the waiting process is started by using the waiting means 321. In other words, if the number of waiting for data registration is 1 or more,
Notify the notification semaphore and cancel the wait. If there is no empty entry at the time of data registration, the waiting means 321 waits for an empty entry.

【0186】データ取り出し手段316は、利用者プロ
グラムからの要求により、キュー制御情報部231の取
り出しポインタが示すエントリからデータを取り出し利
用者プログラムに返却する。このとき、エントリの空き
を待ち合わせているプロセスが存在する場合は、待ち合
わせ解除手段323を使用して待ち合わせているプロセ
スを起動する。すなわち、空きエントリの待ち合わせ数
が1以上である場合、通知セマフォに対して通知を行
い、待ち合わせを解除する。また、データの取り出し時
に登録されているデータがない場合は、待ち合わせ手段
321を使用してデータの登録を待ち合わせる。
The data fetching means 316 fetches data from the entry indicated by the fetch pointer of the queue control information section 231 and returns it to the user program in response to a request from the user program. At this time, if there is a process waiting for an empty entry, the waiting process is started using the wait canceling unit 323. In other words, when the number of queuing of empty entries is one or more, a notification is sent to the notification semaphore and the queuing is released. If there is no data registered at the time of data retrieval, the data is registered using the queuing means 321.

【0187】データ逆取り出し手段217は、利用者プ
ログラムからの要求により、キュー制御情報部331の
登録ポインタが示すエントリの1つ前のエントリからデ
ータを取り出し利用者プログラムに返却する。このと
き、エントリの空きを待ち合わせているプロセスが存在
する場合は、待ち合わせ手段321を使用して待ち合わ
せているプロセスを起動する。すなわち、待ち合わせ数
が1以上である場合、通知セマフォに対して通知を行
い、待ち合わせを解除する。また、データの取り出し時
に登録されているデータがない場合は、待ち合わせ手段
321を使用してデータの登録を待ち合わせる。
In response to a request from the user program, the data reverse extracting means 217 extracts data from the entry immediately before the entry indicated by the registration pointer of the queue control information section 331 and returns the data to the user program. At this time, if there is a process waiting for an empty entry, the waiting process is started by using the waiting means 321. That is, when the number of queuing is one or more, a notification is sent to the notification semaphore and the queuing is released. If there is no data registered at the time of data retrieval, the data is registered using the queuing means 321.

【0188】待ち合わせ手段321は、待ち合わせ数に
1を加算し、キュー排他手段318を使用してキューの
排他を解除した後に、通知セマフォを使用して待ち合わ
せ解除通知を待ち合わせる。通知が来たら、待ち合わせ
手段321は、キュー排他手段318を使用してキュー
の排他を行い、待ち合わせ数から1を減算する。
The queuing means 321 adds 1 to the number of queuing, releases the exclusion of the queue using the queue exclusion means 318, and waits for a queuing release notification using the notification semaphore. When the notification is received, the queuing unit 321 locks the queue using the queue exclusion unit 318, and subtracts 1 from the number of queuing.

【0189】キュー制御システム310におけるキュー
生成手段311、キュー停止手段312、キュー消去手
段313、キュー再初期化手段314、データ登録手段
315、データ取り出し手段316、データ逆取り出し
手段317、キュー排他手段318、キュー拡張手段3
19、キュー縮退手段320、待ち合わせ手段321
は、コンピュータ上で実行されるプログラムによりそれ
ぞれの機能・処理が実現される。
In the queue control system 310, the queue generating means 311, the queue stopping means 312, the queue erasing means 313, the queue reinitializing means 314, the data registering means 315, the data extracting means 316, the data reverse extracting means 317, and the queue exclusion means 318. , Queue expansion means 3
19. Queue reduction means 320, queuing means 321
, Each function and processing is realized by a program executed on a computer.

【0190】次に、図20および図23〜図27のフロ
ーチャートを参照して、本実施の形態の全体の動作につ
いて詳細に説明する。以下では、この実施の形態を、前
記第1、第2の実施の形態の動作と相違する点について
説明する。
Next, the overall operation of the present embodiment will be described in detail with reference to FIG. 20 and the flowcharts of FIGS. Hereinafter, points of this embodiment different from the operations of the first and second embodiments will be described.

【0191】図23は、本発明の第3の実施の形態にお
けるキュー停止手段312の動作の一例を説明するため
の流れ図である。キュー停止手段312にてキューの使
用が停止される場合、キュー停止手段312では、状態
フラグのチェック後に、第1セグメントのキュー制御情
報部331の待ち合わせ数を判断する。
FIG. 23 is a flow chart for explaining an example of the operation of the queue stopping means 312 according to the third embodiment of the present invention. When the use of the queue is stopped by the queue stop unit 312, the queue stop unit 312 determines the number of queues in the queue control information unit 331 of the first segment after checking the status flag.

【0192】第1セグメントのキュー制御情報部331
の待ち合わせ数が0より大きい場合(図23のステップ
S213でYES)は、通知を待ち合わせているプロセ
スが存在するということであるため、その数分の通知セ
マフォに対して通知を行い(ステップS214)、続い
て状態フラグを”停止”とする(ステップS215)。
Queue control information section 331 of first segment
If the number of waits is larger than 0 (YES in step S213 in FIG. 23), it means that there is a process waiting for the notification, and the notification is made to the notification semaphores for the number (step S214). Then, the status flag is set to "stop" (step S215).

【0193】これで待ち合わせているプロセスは、全て
起動され、各々処理を継続するが、その後の状態チェッ
クで、”使用中”ではないため、全て処理失敗となり、
キューが使用されることはない。尚、待ち合わせ数が0
の場合(ステップS213でNO)は、待ち合わせてい
るプロセスは存在しないため通知する必要はない。
Thus, all the waiting processes are started, and the respective processes are continued. However, in the subsequent state check, since they are not “in use”, all the processes fail.
No queue is used. Note that the number of waits is 0
In the case of (NO in step S213), there is no waiting process, so there is no need to notify.

【0194】図24は、本発明の第3の実施の形態にお
けるデータ登録手段315の動作の一例を説明するため
の流れ図である。
FIG. 24 is a flow chart for explaining an example of the operation of the data registration means 315 according to the third embodiment of the present invention.

【0195】利用者プログラム340がキューにデータ
を登録する場合において、データ登録手段315では、
設定した次登録ポインタの指すエントリがキュー制御情
報部331の取り出しポインタの指すエントリと同じで
ある場合には(図24のステップS229でYES)、
登録ポインタが取り出しポインタに追いつくということ
であり、次に登録できるエントリがない状態である。
When the user program 340 registers data in the queue, the data registration means 315
If the entry pointed to by the set next registration pointer is the same as the entry pointed to by the extraction pointer of the queue control information section 331 (YES in step S229 of FIG. 24),
This means that the registration pointer catches up with the retrieval pointer, and there is no entry that can be registered next.

【0196】この場合、データ登録手段315では、待
ち合わせ手段321を使用して、他プロセスが、データ
を取り出し、空きエントリができるのを待ち合わる(ス
テップS236)。
In this case, the data registration unit 315 uses the waiting unit 321 to wait for another process to retrieve data and create an empty entry (step S236).

【0197】図27は、本発明の第3の実施の形態にお
ける待ち合わせ手段の動作の一例を説明するための流れ
図である。待ち合わせ手段321は、第1セグメントの
キュー制御情報部331の待ち合わせ数に1を加算し
(図27のステップS281)、キュー排他手段を使用
してキューの排他を解除して(ステップS282)、キ
ュー制御情報部331の通知セマフォで待ち合わせを行
う(ステップ283)。
FIG. 27 is a flowchart for explaining an example of the operation of the queuing means according to the third embodiment of the present invention. The queuing unit 321 adds 1 to the number of queuing in the queue control information unit 331 of the first segment (Step S281 in FIG. 27), releases the exclusion of the queue using the queue exclusion unit (Step S282), and Waiting is performed using the notification semaphore of the control information unit 331 (step 283).

【0198】データ登録手段315、データ取り出し手
段316、データ逆取り出し手段317、あるいはデー
タ停止手段312からの通知により、待ち合わせが解除
される。
Waiting is canceled by a notification from the data registration unit 315, the data extraction unit 316, the data reverse extraction unit 317, or the data stop unit 312.

【0199】その後、待ち合わせ手段321は、キュー
排他手段によりキューを排他し(ステップS284)、
待ち合わせ数から1を減算し(ステップS285)、終
了する。
Thereafter, the queuing unit 321 excludes the queue by the queue exclusion unit (step S284).
One is subtracted from the waiting number (step S285), and the process ends.

【0200】データ登録手段315にて、待ちあわせが
解除された、すなわち空きエントリができたら、データ
登録手段315は、状態フラグのチェック(図24のス
テップS222)から処理を再実行する。
When the waiting is canceled by the data registration means 315, that is, when an empty entry is created, the data registration means 315 re-executes the processing from the check of the status flag (step S222 in FIG. 24).

【0201】また、データが登録できた場合であって
(ステップS232まで実行)、待ち合わせ数が0より
大きい場合には(ステップS233でYES)、データ
の登録を待ち合わせているプロセスが存在することを意
味する。
If the data has been registered (executed until step S232) and the number of waits is greater than 0 (YES in step S233), it is determined that there is a process waiting for data registration. means.

【0202】そこで、データ登録手段315は、通知セ
マフォに対し通知を行い(ステップS234)、待ち合
わせているプロセスを起動する。待ち合わせ数が0の場
合(ステップS233でNO)は、待ち合わせているプ
ロセスは存在しないため通知する必要はない。
Then, the data registration means 315 notifies the notification semaphore (step S234), and starts the waiting process. If the number of waits is 0 (NO in step S233), there is no waiting process, so there is no need to notify.

【0203】図26は、本発明の第3の実施の形態にお
けるデータ取り出し手段316の動作の一例を説明する
ための流れ図である。
FIG. 26 is a flowchart for explaining an example of the operation of the data extracting means 316 according to the third embodiment of the present invention.

【0204】利用者プログラム340がキューからFI
FO方式でデータを取り出す場合において、データ取り
出し手段316では、第1セグメントのキュー制御情報
部331のデータ数が0である場合(図25のステップ
S243でNO)、登録されているデータがない状態で
あるため、待ち合わせ手段321を使用して、他プロセ
スによるデータの登録を待ち合わせる(ステップS25
6)。
The user program 340 sends the FI
In the case where the data is retrieved by the FO method, the data retrieval unit 316 determines that there is no registered data when the number of data in the queue control information unit 331 of the first segment is 0 (NO in step S243 in FIG. 25). Therefore, using the queuing means 321 to wait for data registration by another process (step S25)
6).

【0205】待ちあわせが解除された際に、すなわちデ
ータが登録されたら、データ取り出し手段316は、状
態フラグのチェック(ステップS242)から処理を再
実行する。また、データを取り出し、ポインタの更新が
完了した場合(ステップS247まで実行)に、第1セ
グメントのキュー制御情報部331の待ち合わせ数が0
より大きい場合には(ステップS253でYES)、エ
ントリの空き待ち合わせているプロセスが存在すること
を意味する。
When the waiting is released, that is, when the data is registered, the data retrieving means 316 re-executes the processing from the state flag check (step S242). Further, when the data is taken out and the updating of the pointer is completed (executed until step S247), the waiting number of the queue control information section 331 of the first segment becomes 0.
If it is larger (YES in step S253), it means that there is a process waiting for an empty entry.

【0206】そこで、データ取り出し手段316は、第
1セグメントのキュー制御情報部331の通知セマフォ
に対し通知を行い(ステップS254)、待ち合わせて
いるプロセスを起動する。一方、第1セグメントのキュ
ー制御情報部331の待ち合わせ数が0の場合には(ス
テップS253でNO)、待ち合わせているプロセスは
存在しないため、通知する必要はない。
Therefore, the data extracting unit 316 notifies the notification semaphore of the queue control information unit 331 of the first segment (step S254), and starts the waiting process. On the other hand, if the number of queues in the queue control information unit 331 of the first segment is 0 (NO in step S253), there is no process waiting, so there is no need to notify.

【0207】図26は、本発明の第3の実施の形態にお
けるデータ逆取り出し手段の動作の一例を説明するため
の流れ図である。
FIG. 26 is a flow chart for explaining an example of the operation of the data reverse fetching means according to the third embodiment of the present invention.

【0208】利用者プログラム340がキューからLI
FO方式でデータを取り出す場合において、データ逆取
り出し手段317では、キュー制御情報部331のデー
タ数が0である場合は(図26のステップS263でN
O)、登録されているデータがない状態であるため、待
ち合わせ手段321を使用して、他プロセスによるデー
タの登録を待ち合わせる(ステップS277)。待ちあ
わせが解除された、すなわちデータが登録されたら、デ
ータ逆取り出し手段317は、状態フラグのチェック
(ステップS262)から処理を再実行する。また、デ
ータを取り出しが完了した場合(ステップS275まで
実行)、第1セグメントのキュー制御情報部331の待
ち合わせ数が0より大きい場合は(ステップS274で
YES)、エントリの空き待ち合わせているプロセスが
存在することを意味する。
When the user program 340 moves from the queue to the LI
In the case where the data is extracted by the FO method, the data reverse extraction unit 317 determines that the number of data in the queue control information unit 331 is 0 (N in step S263 in FIG. 26).
O) Since there is no registered data, the waiting unit 321 waits for data registration by another process (step S277). When the waiting is released, that is, when the data is registered, the data reverse extraction unit 317 re-executes the process from the check of the status flag (step S262). If the data has been completely extracted (executed until step S275), and if the number of queues in the queue control information unit 331 of the first segment is greater than 0 (YES in step S274), there is a process waiting for an empty entry. Means to do.

【0209】そこでデータ逆取り出し手段317は、第
1セグメントのキュー制御情報部331の通知セマフォ
に対し通知を行い(ステップS275)、待ち合わせて
いるプロセスを起動する。待ち合わせ数が0の場合(ス
テップS274でNO)は、待ち合わせているプロセス
は存在しないため通知する必要はない。
Then, the data reverse fetch unit 317 notifies the notification semaphore of the queue control information unit 331 of the first segment (step S275), and starts the waiting process. If the number of waits is 0 (NO in step S274), there is no process waiting, and there is no need to notify.

【0210】次に、本実施の形態の効果について説明す
る。
Next, the effect of the present embodiment will be described.

【0211】本実施の形態では、データの登録時に空き
エントリが存在しない場合に、他プロセスがデータを取
り出しエントリが空くのを自動的に待ちあわせるように
構成されているため、キューのオーバフローを意識する
必要がなくキューを利用することができる。
In the present embodiment, when there is no empty entry at the time of data registration, another process retrieves data and automatically waits for an empty entry. You can use the queue without having to do it.

【0212】また、本実施の形態では、さらに、データ
の取り出し時にデータが存在しない場合には、他プロセ
スによるデータの登録を自動的に待ち合わせるように構
成されているため、登録されているデータの数を意識す
ることなくキューを利用することができる。
Further, in the present embodiment, if data does not exist at the time of data retrieval, the system is configured to automatically wait for data registration by another process. The queue can be used without being aware of the number.

【0213】[0213]

【実施例2】次に、具体的な実施例を用いて本実施の形
態の動作を説明する。
Embodiment 2 Next, the operation of this embodiment will be described using a specific embodiment.

【0214】キューが、例えば図21および図22に示
すように、登録ポインタが”セグメント1のエントリ
4”を、取り出しポインタが”セグメント1のエントリ
5”を指しており、登録されているデータ数が”1
7”、使用セグメント数3、初期セグメント数3、最大
セグメント数3であるとする。この状態で、利用者プロ
グラム340がデータを登録すると、データ登録手段3
15では、登録ポインタが”セグメント1のエントリ
4”を指しており最終エントリではない(図25のステ
ップS223でNO)ため、次登録ポインタには”セグ
メント1のエントリ5”を設定する(ステップS22
4)。
As shown in FIGS. 21 and 22, for example, as shown in FIGS. 21 and 22, the registration pointer points to “entry 4 of segment 1” and the extraction pointer points to “entry 5 of segment 1”. Is "1"
7 ", the number of used segments is 3, the number of initial segments is 3, and the number of maximum segments is 3. In this state, when the user program 340 registers data, the data registration means 3
In No. 15, since the registration pointer points to “entry 4 of segment 1” and is not the last entry (NO in step S223 of FIG. 25), “entry 5 of segment 1” is set as the next registration pointer (step S22).
4).

【0215】すると、次登録ポインタ=取り出しポイン
タであるため(ステップS229でYES)、待ち合わ
せ手段236によりエントリの空きを待ち合わせる(ス
テップS236)。待ち合わせ手段321は、第1セグ
メントのキュー制御情報部331の待ち合わせ数を1と
し(図27のステップS281)、キューの排他を解除
して(ステップS282)、通知を待ち合わせる(ステ
ップS283)。
Then, since the next registration pointer = the extraction pointer (YES in step S229), the queuing means 236 waits for an empty entry (step S236). The queuing unit 321 sets the queuing number of the queue control information unit 331 of the first segment to 1 (step S281 in FIG. 27), releases the exclusion of the queue (step S282), and waits for a notification (step S283).

【0216】ここで、利用者プログラム341が、FI
FO方式でデータを取り出すと、データ取り出し手段3
16では、”セグメント1のエントリ5”からデータを
取り出す(図25のステップS244、S245)。エ
ントリ5は最終エントリではないので(ステップS24
6でNO)、取り出しポインタに”セグメント1のエン
トリ6”を設定する(ステップS247)。
Here, the user program 341 is an FI
When data is taken out by the FO method, the data taking out means 3
In step 16, data is extracted from "entry 5 of segment 1" (steps S244 and S245 in FIG. 25). Since the entry 5 is not the last entry (step S24)
No in step 6), "entry 6 of segment 1" is set in the take-out pointer (step S247).

【0217】続いて、データ取り出し手段316は、第
1セグメントのキュー制御情報部331の待ち合わせ数
が1であることから(ステップS253でYES)、第
1セグメントのキュー制御情報部331の通知セマフォ
に通知する(ステップS254)。
Subsequently, since the number of queues in the queue control information unit 331 of the first segment is 1 (YES in step S253), the data extracting unit 316 sets the notification semaphore in the queue control information unit 331 of the first segment. Notify (step S254).

【0218】待ち合わせ手段321は、利用者プログラ
ム341でのデータ取り出し手段316からの通知を受
け、処理を継続する。待ち合わせ手段321は、キュー
を排他し(図27のステップS284)、第1セグメン
トのキュー制御情報部331の待ち合わせ数から1を減
算する(ステップS285)。
The queuing means 321 receives the notification from the data extracting means 316 in the user program 341 and continues the processing. The queuing means 321 excludes the queue (step S284 in FIG. 27), and subtracts 1 from the number of queuing in the queue control information section 331 of the first segment (step S285).

【0219】続いて、データ登録手段315では、状態
チェック(図24のステップS222)から処理を再実
行すると、次登録ポインタには”セグメント1のエント
リ5”が設定され(ステップS224)、次登録ポイン
タ≠取り出しポインタであるため(ステップS229で
NO)、データの登録が完了する(ステップS230、
S231、S232)。
Subsequently, in the data registration means 315, when the processing is re-executed from the status check (step S222 in FIG. 24), "entry 5 of segment 1" is set in the next registration pointer (step S224), and the next registration Since pointer ≠ extraction pointer (NO in step S229), data registration is completed (step S230,
S231 and S232).

【0220】続いて、第1セグメントのキュー制御情報
部331の待ち合わせ数は0であるため(ステップS2
33でNO)、データ登録手段315は、通知は行わな
ず、キューの排他を解除し(ステップS235)、終了
する。
Subsequently, the number of queues in the queue control information section 331 of the first segment is 0 (step S2).
33, NO), the data registration unit 315 releases the exclusion of the queue without performing notification (step S235), and ends.

【0221】上記した各実施例のキュー制御システム
は、仮想記憶方式を採用し、セグメンテーションで仮想
記憶空間を管理するコンピュータのセグメント管理に用
いて好適とされる。
The queue control system of each of the above embodiments employs a virtual storage system, and is suitable for use in segment management of a computer that manages a virtual storage space by segmentation.

【0222】また、プロセス間通信を実現するにあた
り、利用者の負担を減らすことができる。すなわち、上
記実施例においては、キューへのデータの登録や空きエ
ントリの待ち合わせをキュー制御システムの内部で行う
ことで、キュー操作において、データエンプティやオー
バフローが発生せず、利用者プログラムの側で、エラー
処理等を考慮した複雑なプログラムを組む必要がない。
これに以外にも、必要なときにバッファプールからバッ
ファを取得し、使用後、バッファを戻す動的バッファ管
理等、情報データを保持するデータエントリと、キュー
制御情報部を有する構成の任意のキュー管理システムに
適用できることは勿論である。以上本発明を上記実施形
態に即して説明したが、本発明は、上記実施形態に限定
されるものでなく、特許請求の範囲の各請求項の発明の
範囲内で当業者であればなし得るであろう各種変形、修
正を含むことは勿論である。
Further, in realizing inter-process communication, the burden on the user can be reduced. That is, in the above embodiment, by registering data in the queue and waiting for an empty entry in the queue control system, in the queue operation, no data empty or overflow occurs, and the user program side There is no need to build a complicated program that takes error processing into account.
In addition to this, any queue having a configuration having a data entry holding information data and a queue control information section, such as dynamic buffer management which acquires a buffer from the buffer pool when necessary and returns the buffer after use, etc. Of course, it can be applied to the management system. Although the present invention has been described with reference to the above embodiment, the present invention is not limited to the above embodiment, and can be made by those skilled in the art without departing from the scope of the claims. Needless to say, various changes and modifications that may be included are included.

【0223】[0223]

【発明の効果】以上説明したように、本発明によれば下
記記載の効果を奏する。
As described above, according to the present invention, the following effects can be obtained.

【0224】本発明の第1の効果は、キューへのデータ
の登録および取り出しを高速に行うことができる、とい
うことである。
A first effect of the present invention is that data can be registered in and retrieved from a queue at high speed.

【0225】その理由は、本発明においては、処理対象
となるエントリは、登録ポインタあるいは、取り出しポ
インタによってあらかじめ決定されており、データの登
録および取り出し時に、キューの検索やエントリ間のチ
ェインの張り替えを不要としているためである。
The reason for this is that, in the present invention, the entry to be processed is determined in advance by a registration pointer or a retrieval pointer, and when registering and retrieving data, it is necessary to search for a queue or replace a chain between entries. This is because it is unnecessary.

【0226】本発明の第2の効果は、メモリ資源を効率
よく利用することができる、ということである。
A second effect of the present invention is that memory resources can be used efficiently.

【0227】その理由は、本発明においては、使用を終
了したキューを消去し、あるいは再利用することが可能
であり、また、登録データの数が一時的に多くなった場
合には、自動的にキューを拡張し、登録データの数が減
ったら、キューを縮退させる制御が行われるためであ
る。
The reason is that, in the present invention, a queue whose use has been completed can be deleted or reused, and when the number of registered data temporarily increases, automatic This is because when the number of registered data is reduced, control is performed to degenerate the queue.

【0228】本発明の第3の効果は、プロセス間通信を
実現するにあたり、利用者の負担を減らすことができ
る、ということである。
A third effect of the present invention is that the burden on the user can be reduced in realizing inter-process communication.

【0229】その理由は、本発明においては、キューへ
のデータの登録や空きエントリの待ち合わせをキュー制
御システムの内部で行うことで、キュー操作において、
データエンプティやオーバフローが発生せず、利用者プ
ログラムの側で異常を意識する必要がない、すなわち、
例えばエラー処理等を考慮したプログラムを組む必要が
ないためである。
The reason is that, in the present invention, the registration of data in the queue and the queuing of empty entries are performed inside the queue control system.
No data empty or overflow occurs, and there is no need to be aware of abnormalities on the part of the user program.
This is because, for example, it is not necessary to build a program that takes into account error processing and the like.

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

【図1】本発明の第1の実施の形態の構成を示す図であ
る。
FIG. 1 is a diagram showing a configuration of a first exemplary embodiment of the present invention.

【図2】本発明の第1の実施の形態におけるキューセグ
メントを模式的に示す図である。
FIG. 2 is a diagram schematically illustrating a queue segment according to the first embodiment of the present invention.

【図3】本発明の第1の実施の形態におけるキュー制御
情報部の一例を示す図である。
FIG. 3 is a diagram illustrating an example of a queue control information unit according to the first embodiment of the present invention.

【図4】本発明の第1の実施の形態におけるキュー生成
手段の動作の一例を説明するための流れ図である。
FIG. 4 is a flowchart illustrating an example of an operation of a queue generation unit according to the first embodiment of the present invention.

【図5】本発明の第1の実施の形態におけるキュー停止
手段の動作の一例を説明するための流れ図である。
FIG. 5 is a flowchart illustrating an example of an operation of a queue stopping unit according to the first embodiment of the present invention.

【図6】本発明の第1の実施の形態におけるキュー消去
手段の動作の一例を説明するための流れ図である。
FIG. 6 is a flowchart illustrating an example of an operation of a queue erasing unit according to the first embodiment of the present invention.

【図7】本発明の第1の実施の形態におけるキュー再初
期化手段の動作の一例を説明するための流れ図である。
FIG. 7 is a flowchart illustrating an example of an operation of a queue reinitialization unit according to the first embodiment of the present invention.

【図8】本発明の第1の実施の形態におけるデータ登録
手段手段の動作の一例を説明するための流れ図である。
FIG. 8 is a flowchart for explaining an example of the operation of the data registration means according to the first embodiment of the present invention.

【図9】本発明の第1の実施の形態におけるデータ取り
出し手段の動作の一例を説明するための流れ図である。
FIG. 9 is a flowchart illustrating an example of an operation of a data extracting unit according to the first embodiment of the present invention.

【図10】本発明の第1の実施の形態におけるデータ逆
取り出し手段の動作の一例を説明するための流れ図であ
る。
FIG. 10 is a flowchart illustrating an example of an operation of a data reverse extracting unit according to the first embodiment of the present invention.

【図11】本発明の第2の実施の形態の構成を示す図で
ある。
FIG. 11 is a diagram showing a configuration of a second exemplary embodiment of the present invention.

【図12】本発明の第2の実施の形態におけるキューセ
グメントを模式的に示す図である。
FIG. 12 is a diagram schematically illustrating a queue segment according to the second embodiment of the present invention.

【図13】本発明の第2の実施の形態におけるキュー制
御情報部の一例を示す図である。
FIG. 13 is a diagram illustrating an example of a queue control information unit according to the second embodiment of the present invention.

【図14】本発明の第2の実施の形態におけるキュー再
初期化手段の動作の一例を説明するための流れ図であ
る。
FIG. 14 is a flowchart illustrating an example of an operation of a queue re-initialization unit according to the second embodiment of the present invention.

【図15】本発明の第2の実施の形態におけるデータ登
録手段手段の動作の一例を説明するための流れ図であ
る。
FIG. 15 is a flowchart for explaining an example of the operation of the data registration means according to the second embodiment of the present invention.

【図16】本発明の第2の実施の形態におけるデータ取
り出し手段の動作の一例を説明するための流れ図であ
る。
FIG. 16 is a flowchart illustrating an example of an operation of a data extracting unit according to the second embodiment of the present invention.

【図17】本発明の第2の実施の形態におけるデータ逆
取り出し手段の動作の一例を説明するための流れ図であ
る。
FIG. 17 is a flowchart for explaining an example of the operation of a data reverse retrieval unit according to the second embodiment of the present invention.

【図18】本発明の第2の実施の形態におけるキュー拡
張手段の動作の一例を説明するための流れ図である。
FIG. 18 is a flowchart illustrating an example of an operation of a queue expansion unit according to the second embodiment of the present invention.

【図19】本発明の第2の実施の形態におけるキュー縮
退手段の動作の一例を説明するための流れ図である。
FIG. 19 is a flowchart illustrating an example of an operation of a queue degenerating unit according to the second embodiment of the present invention.

【図20】本発明の第3の実施の形態の構成を示す図で
ある。
FIG. 20 is a diagram showing a configuration of a third exemplary embodiment of the present invention.

【図21】本発明の第3の実施の形態におけるキューセ
グメントを模式的に示す図である。
FIG. 21 is a diagram schematically illustrating a queue segment according to the third embodiment of the present invention.

【図22】本発明の第3の実施の形態におけるキュー制
御情報部の一例を示す図である。
FIG. 22 is a diagram illustrating an example of a queue control information unit according to the third embodiment of the present invention.

【図23】本発明の第3の実施の形態におけるキュー停
止手段の動作の一例を説明するための流れ図である。
FIG. 23 is a flowchart for explaining an example of the operation of a queue stop unit according to the third embodiment of the present invention.

【図24】本発明の第3の実施の形態におけるデータ登
録手段の動作の一例を説明するための流れ図である。
FIG. 24 is a flowchart illustrating an example of an operation of a data registration unit according to the third embodiment of the present invention.

【図25】本発明の第3の実施の形態におけるデータ取
り出し手段の動作の一例を説明するための流れ図であ
る。
FIG. 25 is a flowchart illustrating an example of an operation of a data extracting unit according to the third embodiment of the present invention.

【図26】本発明の第3の実施の形態におけるデータ逆
取り出し手段の動作の一例を説明するための流れ図であ
る。
FIG. 26 is a flowchart illustrating an example of an operation of a data reverse retrieval unit according to the third embodiment of the present invention.

【図27】本発明の第3の実施の形態における待ち合わ
せ手段の動作の一例を説明するための流れ図である。
FIG. 27 is a flowchart illustrating an example of the operation of a queuing unit according to the third embodiment of the present invention.

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

100,200,300 計算機システム 110,210,310 キュー制御システム 111,211,311 キュー生成手段 112,212,312 キュー停止手段 113,213,313 キュー消去手段 114,214,314 キュー再初期化手段 115,215,315 データ登録手段 116,216,316 データ取り出し手段 117,217,317 データ逆取り出し手段 118,218,318 キュー排他手段 219,319 キュー拡張手段 220,320 キュー縮退手段 321 待ち合わせ手段 130,230,330 キューセグメント 131,231,331 キュー制御情報部 132,232,332 キューデータ部 140,240,340 利用者プログラム 100, 200, 300 Computer system 110, 210, 310 Queue control system 111, 211, 311 queue generating means 112, 212, 312 queue stopping means 113, 213, 313 Queue deleting means 114, 214, 314 queue re-initialization means 115,215,315 Data registration means 116, 216, 316 Data retrieval means 117, 217, 317 Data reverse retrieval means 118, 218, 318 queue exclusion means 219,319 Queue expansion means 220,320 Queue degeneration means 321 Means of meeting 130, 230, 330 queue segment 131, 231, 331 Queue control information section 132, 232, 332 Queue data section 140, 240, 340 User program

Claims (57)

【特許請求の範囲】[Claims] 【請求項1】キューとして用いるセグメントであって、
該セグメント中にキューの制御情報を格納するキュー制
御情報部と、データが登録されるエントリよりなるデー
タ部とを有する複数のセグメントを生成し、前記各セグ
メントに環状のリンクを設定し、環状にリンクされた複
数のセグメントのうちの1つのセグメント(「第1セグ
メント」という)のキュー制御情報部に初期値を設定す
るキュー生成手段を備え、 前記第1セグメントのキュー制御情報部には、データの
登録先のエントリ及び取り出しエントリを指す登録ポイ
ンタ及び取り出しポインタが少なくとも保持され、 前記第1セグメントのキュー制御情報部の登録ポインタ
が指すエントリに、データを登録するデータ登録手段
と、 前記第1セグメントのキュー制御情報部の取り出しポイ
ンタが指すエントリからデータを取り出すデータ取り出
し手段と、 キューの排他制御を行うキュー排他手段と、 を備えている、ことを特徴とするキュー制御システム。
1. A segment used as a queue,
A plurality of segments having a queue control information section for storing control information of a queue in the segment and a data section composed of entries in which data is registered are generated, and a circular link is set for each of the segments. A queue generating unit configured to set an initial value in a queue control information section of one of the plurality of linked segments (referred to as a “first segment”); At least a registration pointer and a retrieval pointer indicating a registration destination entry and a retrieval entry of the first segment; data registration means for registering data in an entry indicated by the registration pointer of the queue control information section of the first segment; Data to be retrieved from the entry pointed to by the retrieval pointer of the queue control information section of Queue control system for the extraction means, and a queue exclusion means for performing exclusive control of the queue, it is characterized.
【請求項2】前記第1セグメントの前記キュー制御情報
部の登録ポインタが指すエントリの直前のエントリか
ら、データを取り出すデータ逆取り出し手段をさらに備
えている、ことを特徴とする請求項1記載のキュー制御
システム。
2. The apparatus according to claim 1, further comprising a data reverse fetching means for fetching data from an entry immediately before an entry pointed to by a registration pointer of said queue control information section of said first segment. Queue control system.
【請求項3】キューの使用を停止し、キューの使用停止
以降のデータ登録およびデータ取り出しを抑止するキュ
ー停止手段と、 キューとして利用していたセグメントを消去するキュー
消去手段と、 をさらに備えている、ことを特徴とする請求項1又は2
記載のキュー制御システム。
3. A queue stopping means for stopping use of a queue and suppressing data registration and data retrieval after stopping use of the queue, and a queue deleting means for deleting a segment used as a queue. 3. The method according to claim 1, wherein
Queue control system as described.
【請求項4】前記キュー停止手段により使用停止となっ
たキューのキュー制御情報部を再初期化し、再度キュー
を使用できるようにするキュー再初期化手段をさらに備
えている、ことを特徴とする請求項3記載のキュー制御
システム。
4. A queue re-initializing means for re-initializing a queue control information section of a queue whose use has been suspended by said queue suspending means so that the queue can be used again. The queue control system according to claim 3.
【請求項5】データの登録時に空きエントリがない場
合、キューとして利用する新たなセグメントを生成し、
セグメント間の環状リンクを設定し直すキュー拡張手段
をさらに備えている、ことを特徴とする請求項1乃至4
のいずれか一に記載のキュー制御システム。
5. If there is no empty entry at the time of data registration, a new segment to be used as a queue is generated,
5. The apparatus according to claim 1, further comprising queue expansion means for resetting a ring link between segments.
The queue control system according to any one of the above.
【請求項6】データの取り出し時に使用されていないセ
グメントを削除し、セグメント間の環状リンクを設定し
直すキュー縮退手段をさらに備えている、ことを特徴と
する請求項1乃至5のいずれか一に記載のキュー制御シ
ステム。
6. The apparatus according to claim 1, further comprising a queue degenerating means for deleting a segment that is not used at the time of extracting data and resetting a circular link between the segments. 2. The queue control system according to 1.
【請求項7】データの登録時に空きエントリがない場
合、他プロセスによりデータが取り出され空きエントリ
ができることを待ち合わせる待ち合わせ手段をさらに備
えている、ことを特徴とする請求項1乃至6のいずれか
一に記載のキュー制御システム。
7. The data processing apparatus according to claim 1, further comprising a queuing unit that waits for the data to be taken out by another process to create a free entry when there is no free entry at the time of data registration. 2. The queue control system according to 1.
【請求項8】前記待ち合わせ手段が、データの取り出し
時に登録されているデータがない場合には、他プロセス
によりデータが登録されることを待ち合わせる手段を含
む、ことを特徴とする請求項1乃至7のいずれか一に記
載のキュー制御システム。
8. The apparatus according to claim 1, wherein said waiting means includes means for waiting for registration of data by another process when there is no data registered at the time of data retrieval. The queue control system according to any one of the above.
【請求項9】キューとして用いるセグメントであって、
該セグメント中にキューの制御情報を格納するキュー制
御情報部と、データが登録されるエントリよりなるデー
タ部とを有する複数のセグメントを生成し、前記各セグ
メントに環状のリンクを設定し、環状にリンクされた複
数のセグメントのうちの1つのセグメント(「第1セグ
メント」という)のキュー制御情報部に初期値を設定す
るステップを有し、前記第1セグメントのキュー制御情
報部には、データの登録先のエントリ及び取り出しエン
トリを指す登録ポインタ及び取り出しポインタが少なく
とも保持され、 前記第1セグメントのキュー制御情報部の登録ポインタ
の示すエントリへデータを登録するステップと、 前記第1セグメントのキュー制御情報部の取り出しポイ
ンタの示すエントリからデータを取り出すステップと、 キューを排他制御するステップと、 を含む、ことを特徴とするキュー制御方法。
9. A segment used as a queue,
A plurality of segments having a queue control information section for storing control information of a queue in the segment and a data section composed of entries in which data is registered are generated, and a circular link is set for each of the segments. Setting an initial value in a queue control information section of one segment (referred to as “first segment”) of the plurality of linked segments, wherein the queue control information section of the first segment includes data of data. Registering at least a registration pointer and a retrieval pointer indicating a registration destination entry and a retrieval entry; and registering data in an entry indicated by the registration pointer in the queue control information section of the first segment; and queue control information of the first segment. Retrieving data from the entry pointed to by the retrieval pointer of the copy unit; Comprising the steps of exclusive control, a queue control method characterized by.
【請求項10】前記第1セグメントの前記キュー制御情
報部の登録ポインタが指すエントリの直前のエントリか
らデータを取り出すステップを含む、ことを特徴とする
請求項9記載のキュー制御方法。
10. The queue control method according to claim 9, further comprising the step of extracting data from an entry immediately before an entry pointed to by a registration pointer of said queue control information section of said first segment.
【請求項11】キューの使用を停止して以降のデータ登
録およびデータ取り出しを抑止するステップと、 キューとして利用していたセグメントを消去するステッ
プと、 を含む、ことを特徴とする請求項9又は10記載のキュ
ー制御方法。
11. The method according to claim 9, further comprising the steps of: stopping use of the queue to inhibit data registration and data retrieval thereafter; and erasing a segment used as the queue. 11. The queue control method according to item 10.
【請求項12】停止状態のキューを再初期化し、再度キ
ューを使用可能とするステップをさらに含む、ことを特
徴とする請求項9乃至11のいずれか一に記載のキュー
制御方法。
12. The queue control method according to claim 9, further comprising the step of re-initializing the stopped queue and making the queue usable again.
【請求項13】データの登録時に空きエントリがない場
合に、キューとして利用する新たなセグメントを生成す
るステップをさらに含む、ことを特徴とする請求項9乃
至12のいずれか一に記載のキュー制御方法。
13. The queue control according to claim 9, further comprising a step of generating a new segment to be used as a queue when there is no empty entry at the time of data registration. Method.
【請求項14】データの取り出し時に使用していないセ
グメントを削除するステップをさらに含む、ことを特徴
とする請求項9乃至13のいずれか一に記載のキュー制
御方法。
14. The queue control method according to claim 9, further comprising a step of deleting a segment that is not used when data is taken out.
【請求項15】データの登録時に空きエントリがない場
合は他プロセスによりデータが取り出され空きエントリ
ができることを待ち合わせるステップと、 データの取り出し時に、空きエントリを待ち合わせてい
るプロセスに対しエントリが空いたことを通知して待ち
合わせを解除するステップと、 を含む、ことを特徴とする請求項9乃至14のいずれか
一に記載のキュー制御方法。
15. If there is no empty entry at the time of data registration, a step of waiting for data to be taken out by another process to create an empty entry, and that an entry is vacant for a process waiting for an empty entry at the time of data extraction. The queue control method according to any one of claims 9 to 14, further comprising the step of:
【請求項16】データの取り出し時に登録されているデ
ータがない場合には他プロセスによりデータが登録され
ることを待ち合わせるステップと、 データの登録時にデータの登録を待ち合わせているプロ
セスに対し、データが登録されたことを通知して待ち合
わせを解除するステップと、 を含む、ことを特徴とする請求項9乃至15のいずれか
一に記載のキュー制御方法。
16. A process for waiting for registration of data by another process when there is no data registered at the time of data extraction, and a process for waiting for data registration at the time of data registration. The queue control method according to any one of claims 9 to 15, further comprising a step of notifying the registration and canceling the waiting.
【請求項17】キューの管理をコンピュータで行わせる
プログラムであって、 (a)キューとして用いるセグメントであって、該セグ
メント中にキューの制御情報を格納するキュー制御情報
部と、データが登録されるエントリよりなるデータ部と
を有する複数のセグメントを生成し、前記各セグメント
に環状のリンクを設定し、環状にリンクされた複数のセ
グメントのうちの1つのセグメント(「第1セグメン
ト」という)のキュー制御情報部に初期値を設定する処
理を有し、前記第1セグメントのキュー制御情報部に
は、データの登録先のエントリ及び取り出しエントリを
指す登録ポインタ及び取り出しポインタが少なくとも保
持され、 (b)前記第1セグメントのキュー制御情報部の登録ポ
インタが指すエントリにデータを登録する処理と、 (c)前記第1セグメントのキュー制御情報部の取り出
しポインタが指すエントリからデータを取り出す処理
と、 (d)キューを排他制御する処理と、 を有し、 前記(a)乃至(d)の処理を前記コンピュータに実行
させるためのプログラム。
17. A program for causing a computer to manage a queue, comprising: (a) a segment used as a queue, a queue control information section for storing queue control information in the segment, and data registered therein. A plurality of segments each having a data portion consisting of an entry, and setting a ring-like link to each of the segments, and forming one of the plurality of ring-linked segments (referred to as a “first segment”). A process of setting an initial value in a queue control information section, wherein the queue control information section of the first segment holds at least a registration pointer and a retrieval pointer indicating a data registration destination entry and a retrieval entry; A) registering data in the entry pointed to by the registration pointer in the queue control information section of the first segment; (C) a process of fetching data from the entry pointed to by the fetch pointer of the queue control information section of the first segment; and (d) a process of exclusively controlling the queue. And a program for causing the computer to execute the processing of (1).
【請求項18】請求項17記載のプログラムにおいて、
前記第1セグメントの前記キュー制御情報部の登録ポイ
ンタが指すエントリの直前のエントリからデータを取り
出す処理を前記コンピュータにさらに実行させるための
プログラム。
18. The program according to claim 17, wherein
A program for causing the computer to further execute a process of extracting data from an entry immediately before an entry indicated by a registration pointer of the queue control information section of the first segment.
【請求項19】請求項17又は18記載のプログラムに
おいて、キューの使用を停止し、以降のデータ登録およ
びデータ取り出しを抑止する処理と、 キューとして利用していたセグメントを消去する処理
と、を前記コンピュータにさらに実行させるためのプロ
グラム。
19. The program according to claim 17, wherein the processing for stopping the use of the queue and suppressing the subsequent data registration and data retrieval and the processing for erasing the segment used as the queue are performed. A program that causes the computer to execute further.
【請求項20】請求項17乃至19のいずれか一に記載
のプログラムにおいて、 使用停止となったキューのキュー制御情報部を再初期化
し、再度キューを使用できるようにする処理を前記コン
ピュータにさらに実行させるためのプログラム。
20. The program according to claim 17, wherein the computer further performs a process of reinitializing a queue control information portion of the queue whose use has been stopped and enabling the queue to be used again. The program to be executed.
【請求項21】請求項17乃至20のいずれか一に記載
のプログラムにおいて、 データの登録時に空きエントリがない場合、キューとし
て利用する新たなセグメントを生成しセグメント間のリ
ンクを設定し直す処理を前記コンピュータにさらに実行
させるためのプログラム。
21. A program according to any one of claims 17 to 20, wherein if there is no empty entry at the time of data registration, a process of generating a new segment to be used as a queue and re-establishing a link between segments is performed. A program for causing the computer to further execute.
【請求項22】請求項17乃至21のいずれか一に記載
のプログラムにおいて、 データの取り出し時に、使用していないセグメントを削
除しセグメント間のリンクを設定し直す処理を前記コン
ピュータにさらに実行させるためのプログラム。
22. The program according to claim 17, further comprising the step of causing said computer to further execute a process of deleting unused segments and re-establishing links between segments when data is taken out. Program.
【請求項23】請求項17乃至22のいずれか一に記載
のプログラムにおいて、 データの登録時に空きエントリがない場合、他プロセス
によりデータが取り出され空きエントリができることを
待ち合わせる処理と、 データの取り出し時に空きエントリを待ち合わせている
プロセスに対しエントリが空いたことを通知して待ち合
わせを解除する処理と、 を前記コンピュータにさらに実行させるためのプログラ
ム。
23. A program according to claim 17, wherein when there is no empty entry at the time of data registration, a process of waiting for data to be taken out by another process to create an empty entry; A process for notifying a process waiting for an empty entry that the entry is free and canceling the waiting; and causing the computer to further execute the following.
【請求項24】請求項17乃至23のいずれか一に記載
のプログラムにおいて、 データの取り出し時に登録されているデータがない場
合、他プロセスによりデータが登録されることを待ち合
わせる処理と、 データの登録時にデータの登録を待ち合わせているプロ
セスに対しデータが登録されたことを通知し待ち合わせ
を解除する処理と、を前記コンピュータにさらに実行さ
せるためのプログラム。
24. The program according to claim 17, wherein when there is no data registered at the time of data extraction, a process of waiting for data to be registered by another process; And a process of notifying the process waiting for data registration that the data has been registered and canceling the waiting, and causing the computer to further execute the process.
【請求項25】前記キュー生成手段は、環状のリンクを
生成し前記第1セグメントのキュー制御情報部を初期設
定したのち、キューの状態を示す状態フラグを使用中に
設定する手段と、 利用者プログラムに前記第1セグメントのアドレスを返
却する手段と、 を備え、 前記利用者プログラムは、データの登録、及び取り出し
にあたり、前記アドレスをキーとして、前記データ登録
手段及び前記データ取り出し手段に対して、データの登
録と取り出しをそれぞれ要求する、ことを特徴とする請
求項1乃至8のいずれか一に記載のキュー制御システ
ム。
25. A means for setting a status flag indicating a status of a queue in use after generating a ring-shaped link and initial setting a queue control information section of the first segment, Means for returning an address of the first segment to a program, wherein the user program registers and retrieves data, using the address as a key, for the data registering means and the data retrieving means, The queue control system according to any one of claims 1 to 8, wherein registration and retrieval of data are requested, respectively.
【請求項26】前記第1のセグメントがキュー制御情報
部に設定される情報として、データを登録するセグメン
トのエントリを示す登録ポインタと、データを取りだす
セグメントのエントリを示す取り出しポインタと、キュ
ーに登録されているデータの数と、次のセグメントのア
ドレスよりなるリンク情報と、を少なくとも有し、 残りのセグメントはキュー制御情報部に設定される情報
として、次セグメントのアドレスよりなるリンク情報を
有する、ことを特徴とする請求項1乃至8のいずれか一
に記載のキュー制御システム。
26. The information in which the first segment is set in the queue control information section, a registration pointer indicating an entry of a segment for registering data, an extraction pointer indicating an entry of a segment for extracting data, and registration in a queue. The remaining segment has link information consisting of the address of the next segment as information set in the queue control information section. The queue control system according to any one of claims 1 to 8, wherein:
【請求項27】前記第1セグメントが、キュー制御情報
部として、データを登録するセグメントのエントリを示
す登録ポインタと、データを取りだすセグメントのエン
トリを示す取り出しポインタと、キューに登録されてい
るデータの数と、次のセグメントのアドレスよりなるリ
ンク情報と、に加えて、現在使用している使用セグメン
ト数と、セグメントの初期値である初期セグメント数
と、セグメントの最大値を示す最大セグメント数と、キ
ューの排他制御に用いられる排他セマフォ、プロセス間
の通知用の通知セマフォと、待ち合わせプロセス数を管
理するための待ち合わせ数とをそれぞれ格納するための
欄を含み、 前記第1セグメントを除くセグメントのキュー制御情報
部には、次セグメントのアドレスよりなるリンク情報の
みが設定される、ことを特徴とする請求項1乃至8のい
ずれか一に記載のキュー制御システム。
27. The first segment as a queue control information section, a registration pointer indicating an entry of a segment for registering data, an extraction pointer indicating an entry of a segment for extracting data, and a In addition to the number and link information including the address of the next segment, in addition to the number of used segments currently used, the initial number of segments that is the initial value of the segment, the maximum number of segments indicating the maximum value of the segment, A queue for storing the exclusive semaphore used for the exclusive control of the queue, a notification semaphore for notification between processes, and a queue number for managing the number of queued processes; Only link information consisting of the address of the next segment is set in the control information section The queue control system according to any one of claims 1 to 8, wherein the control is performed.
【請求項28】前記キュー停止手段は、キューの状態を
示す状態フラグをチェックし、前記状態フラグが使用中
である場合、状態フラグを停止状態に設定する手段を備
えている、ことを特徴とする請求項3乃至8のいずれか
一に記載のキュー制御システム。
28. The queue stopping means further comprises means for checking a status flag indicating a status of a queue, and setting the status flag to a stopped status when the status flag is in use. The queue control system according to any one of claims 3 to 8, wherein:
【請求項29】前記キュー消去手段は、キューの状態を
示す状態フラグをチェックし、前記状態フラグが停止状
態である場合、使用しているキューセグメントを消去
し、前記状態フラグが停止状態でない場合には、消去は
行わないように制御する手段を備えている、ことを特徴
とする請求項3乃至8のいずれか一に記載のキュー制御
システム。
29. The queue erasing means checks a status flag indicating a status of a queue. If the status flag is in a stopped state, the queue deleting means deletes a queue segment used, and if the status flag is not in a stopped state. The queue control system according to any one of claims 3 to 8, further comprising means for controlling so as not to perform erasure.
【請求項30】前記キュー再初期化手段は、キューの状
態を示す状態フラグをチェックし、前記状態フラグが停
止状態である場合には、前記第1セグメントのキュー制
御情報部に初期値を設定し、前記初期値を設定する領域
は、キューの使用により値が更新される領域のみとさ
れ、前記状態フラグを使用中に設定し、 前記状態フラグが停止状態でない場合には、キューの再
初期化は行わないように制御する手段を備えている、こ
とを特徴とする請求項4乃至8のいずれか一に記載のキ
ュー制御システム。
30. The queue re-initializing means checks a status flag indicating a status of a queue, and if the status flag is in a stopped state, sets an initial value in a queue control information section of the first segment. The area for setting the initial value is limited to an area whose value is updated by use of the queue. When the state flag is set to “in use”, and when the state flag is not in the stop state, the queue is reinitialized. The queue control system according to any one of claims 4 to 8, further comprising means for controlling so as not to perform the conversion.
【請求項31】前記データ登録手段は、キューの状態を
示す状態フラグが使用中である場合、前記第1セグメン
トのキュー制御情報部の登録ポインタの指すエントリが
セグメント内の最終エントリかチェックする手段と、 前記チェックの結果、最終エントリの場合、次の登録ポ
インタを次のセグメントの先頭エントリとし、最終エン
トリでない場合、次の登録ポインタを登録ポインタの指
すエントリの次のエントリとする手段と、 前記次の登録ポインタがキュー制御情報部の取り出しポ
インタと一致するか否か判定する手段と、 前記判定の結果、一致する場合、空きエントリなしとし
て、データ登録を行わず、一致しない場合、登録ポイン
タの指すエントリへ登録データを移送する制御を行う手
段と、 前記第1セグメントのキュー制御情報部の登録ポインタ
を次のポインタをさすエントリに設定する手段と、 前記第1セグメントのキュー制御情報部のデータ数を1
加算する手段と、 を備えている、ことを特徴とする請求項1乃至8のいず
れか一に記載のキュー制御システム。
31. A means for checking whether the entry pointed to by the registration pointer of the queue control information section of the first segment is the last entry in the segment when the status flag indicating the status of the queue is in use. Means for setting the next registration pointer as the first entry of the next segment if the result of the check is the last entry, and setting the next registration pointer as the next entry after the entry pointed to by the registration pointer if not the last entry; Means for determining whether or not the next registration pointer matches the extraction pointer of the queue control information section; and if the result of the determination is that there is no match, no data entry is performed without any empty entry. Means for controlling transfer of registration data to an entry pointed to; queue control information of the first segment Means for setting the registration pointer of the section to an entry pointing to the next pointer;
The queue control system according to any one of claims 1 to 8, further comprising: means for adding.
【請求項32】前記データ取り出し手段は、キューの状
態を示す状態フラグが使用中である場合、前記第1セグ
メントのキュー制御情報部のデータ数が正整数であるか
チェックする手段と、 前記データ数が正整数の場合、前記第1セグメントのキ
ュー制御情報部の取り出しポインタからデータを取得
し、前記データ数を1つ減算する手段と、 データを取り出したエントリがセグメント内の最終エン
トリの場合、取り出しポインタが次のセグメントの第1
エントリを指すように設定する手段と、 データを取り出したエントリがセグメント内の最終エン
トリでない場合、取り出しポインタが次のエントリを指
すように設定する手段と、 を備えている、ことを特徴とする請求項1乃至8のいず
れか一に記載のキュー制御システム。
32. The data fetching means, if a status flag indicating a queue status is being used, checks whether the number of data in the queue control information section of the first segment is a positive integer, If the number is a positive integer, means for acquiring data from the extraction pointer of the queue control information section of the first segment and subtracting one from the number of data; and when the entry from which the data is extracted is the last entry in the segment, The fetch pointer is the first of the next segment
Means for setting to point to an entry, and means for setting, when the entry from which data is fetched is not the last entry in the segment, the fetch pointer to point to the next entry. Item 9. The queue control system according to any one of Items 1 to 8.
【請求項33】前記データ逆取り出し手段は、キュー状
態を示す状態フラグが使用中である場合、前記第1セグ
メントのキュー制御情報部のデータの数をチェックする
手段と、 前記データ数が正整数のとき、前記第1セグメントのキ
ュー制御情報部の登録ポインタの指すエントリ(「登録
エントリ」という)がセグメント内の先頭エントリでは
ない場合、登録エントリの1つ前のエントリを指すよう
に登録ポインタを更新する手段と、 前記登録エントリがセグメント内の先頭エントリである
場合、登録ポインタが指すセグメントの1つ前のセグメ
ントを求め、該セグメントの最終エントリを指すように
登録ポインタを更新する手段と、 前記更新した登録ポインタの指すエントリから、前記利
用者プログラムから伝えられたデータ返却領域へデータ
を移送する手段と、 前記第1セグメントのキュー制御情報部のデータ数から
1を減算する手段と、 を備えている、ことを特徴とする請求項2乃至8のいず
れか一に記載のキュー制御システム。
33. The data reverse fetching means, when a status flag indicating a queue status is being used, checks the number of data in the queue control information section of the first segment, and the data number is a positive integer. If the entry pointed to by the registration pointer of the queue control information section of the first segment (referred to as “registration entry”) is not the first entry in the segment, the registration pointer is pointed to the entry immediately before the registration entry. Means for updating, when the registration entry is the first entry in a segment, means for finding a segment immediately before the segment pointed to by the registration pointer, and updating the registration pointer to point to the last entry of the segment; From the entry pointed to by the updated registration pointer to the data return area transmitted from the user program 9. A device according to claim 2, further comprising: means for transferring data; and means for subtracting 1 from the number of data in the queue control information section of the first segment. Queue control system.
【請求項34】前記データ登録手段は、前記第1セグメ
ントのキュー制御情報部の登録ポインタの指すエントリ
(「登録エントリ」という)がセグメント内の最終エン
トリである場合に、前記登録ポインタの指すセグメント
(「登録セグメント」という)の次セグメントが取り出
しポインタが指しているセグメントであり、使用セグメ
ントが1つ増加しても予め定められた最大セグメント数
以下である場合には、前記キュー拡張手段に、登録セグ
メントを指定してキューを拡張させるように制御する手
段を備え、 前記キュー拡張手段は、新しいセグメントを1つ生成
し、登録セグメントの次セグメントが生成したセグメン
トとなるように、環状リンクを再設定し、使用セグメン
ト数に1を加算する手段を備え、 セグメントの次セグメントとして新しいキューセグメン
トが追加され、 前記データ登録手段は、次登録ポインタに追加したセグ
メントの先頭エントリを設定し、登録エントリへの登録
データのエントリを行う、ことを特徴とする請求項5乃
至8のいずれか一に記載のキュー制御システム。
34. When the entry pointed to by the registration pointer of the queue control information section of the first segment (referred to as a “registration entry”) is the last entry in the segment, the data registration means points to the segment pointed to by the registration pointer. If the next segment (referred to as “registered segment”) is the segment pointed to by the extraction pointer, and if the number of used segments is not more than the predetermined maximum number of segments even if it is increased by one, Means for controlling a queue to be extended by designating a registered segment, wherein the queue expanding means generates one new segment and re-creates the ring link so that the next segment of the registered segment becomes the generated segment. Set and add means to add 1 to the number of used segments. 9. The data registration means according to claim 5, wherein a new queue segment is added, and said data registration means sets a head entry of the added segment in a next registration pointer and performs an entry of registration data in a registration entry. The queue control system according to any one of the above.
【請求項35】前記データ取り出し手段は、前記第1セ
グメントのキュー制御情報部の取り出しポインタの指す
エントリがセグメント内の最終エントリである場合、次
セグメントの先頭エントリを指すようにデータ取り出し
ポインタを更新し、その際、登録ポインタが指すセグメ
ントがデータを取り出したセグメント(「取り出しセグ
メント」という)でない場合、取り出しセグメントが前
記1つのセグメントではなく、前記第1セグメントのキ
ュー制御情報部の使用セグメント数を1つ減算した値が
初期セグメント数以上である場合、前記キュー縮退手段
に、取り出しセグメントを指定して、キューを縮退させ
るように制御する手段を備え、 前記キュー縮退手段は、指定されたセグメントである取
り出しセグメントを消去し、指定されたセグメントの前
セグメントが次セグメントを指すように、環状リンクを
再設定する手段を備えている、ことを特徴とする請求項
6又は7に記載のキュー制御システム。
35. When the entry pointed to by the retrieval pointer of the queue control information section of the first segment is the last entry in the segment, the data retrieval means updates the data retrieval pointer to point to the first entry of the next segment. At this time, if the segment pointed to by the registration pointer is not the segment from which the data was taken out (referred to as “fetched segment”), the fetched segment is not the one segment but the number of used segments of the queue control information section of the first segment. When the value obtained by subtracting one is equal to or greater than the initial segment number, the queue degeneration means includes means for designating a fetch segment and controlling the queue to be degenerated, and the queue degeneration means performs Erases a fetch segment and deletes the specified 8. The queue control system according to claim 6, further comprising means for resetting an annular link such that a previous segment of the segment points to a next segment.
【請求項36】前記データ逆取り出し手段は、前記第1
セグメントのキュー制御情報部の登録ポインタが指すエ
ントリがセグメント内の先頭エントリである場合、前セ
グメントの最終エントリを指すように登録ポインタを更
新し、その際、更新前の登録ポインタが指していたセグ
メント(「元セグメント」という)が取り出しポインタ
の指すセグメントではない場合、元セグメントが第1セ
グメントではなく、過去にキューの拡張が起こってお
り、前記第1セグメントのキュー制御情報部の使用セグ
メント数を1つ減算した値が初期セグメント数以上であ
る場合、前記キュー縮退手段に、元セグメントを指定し
てキューを縮退させるように制御する手段を備えてい
る、ことを特徴とする請求項6又は7に記載のキュー制
御システム。
36. The data reverse fetching means, wherein:
If the entry pointed to by the registration pointer of the queue control information section of the segment is the first entry in the segment, the registration pointer is updated so as to point to the last entry of the previous segment. At this time, the segment pointed to by the registration pointer before the update If the original segment is not the segment pointed to by the extraction pointer, the original segment is not the first segment, the queue has been expanded in the past, and the number of segments used in the queue control information section of the first segment is 8. When the value obtained by subtracting one is equal to or more than the initial number of segments, the queue degeneration means includes means for controlling the degeneration of the queue by designating the original segment. 2. The queue control system according to 1.
【請求項37】前記データ登録手段は、設定した次登録
ポインタの指すエントリが、前記第1セグメントのキュ
ー制御情報部の取り出しポインタの指すエントリと同じ
である場合には、前記待ち合わせ手段を用いて、他プロ
セスが、データを取り出し空きエントリができることを
待ち合わせ、 待ちあわせが解除され、空きエントリができた場合、前
記データ登録手段は、状態フラグのチェックから処理を
再実行し、データが登録できた場合であって、前記第1
セグメントのキュー制御情報部の待ち合わせ数が0より
大きい場合、前記データ登録手段は、前記第1セグメン
トのキュー制御情報部の通知セマフォに対し通知を行
い、待ち合わせているプロセスを起動する制御を行う、
ことを特徴とする請求項7に記載のキュー制御システ
ム。
37. If the entry pointed to by the set next registration pointer is the same as the entry pointed to by the extraction pointer of the queue control information section of the first segment, the data registration means uses the queuing means. When another process retrieves data and waits for an empty entry, and when the waiting is released and an empty entry is created, the data registration unit re-executes the process from checking the status flag and registers the data. Wherein the first
When the number of queues in the queue control information section of the segment is greater than 0, the data registration unit notifies the notification semaphore of the queue control information section of the first segment and performs control to start the waiting process.
The queue control system according to claim 7, wherein:
【請求項38】前記待ち合わせ手段は、前記第1セグメ
ントのキュー制御情報部の待ち合わせ数に1を加算し、
キュー排他手段を使用してキューの排他を解除し、前記
第1セグメントのキュー制御情報部の通知セマフォで待
ち合わせを行い、 前記データ登録手段、前記データ取り出し手段、前記デ
ータ逆取り出し手段、前記キュー停止手段の少なくとも
1つからの通知により待ち合わせが解除され、 その後、前記待ち合わせ手段は、前記キュー排他手段に
よりキューを排他し、前記第1セグメントのキュー制御
情報部の待ち合わせ数から1を減算する、ことを特徴と
する請求項7に記載のキュー制御システム。
38. The queuing means adds 1 to the number of queuing in the queue control information section of the first segment,
Release the exclusion of the queue by using the queue exclusion unit, wait for the notification semaphore of the queue control information section of the first segment, wait for the data registration unit, the data fetch unit, the data reverse fetch unit, and stop the queue. The queuing is canceled by a notification from at least one of the means, and thereafter, the queuing means excludes the queue by the queue exclusion means, and subtracts 1 from the number of queuing in the queue control information section of the first segment. The queue control system according to claim 7, wherein:
【請求項39】前記データ取り出し手段は、前記第1セ
グメントのキュー制御情報部のデータ数が0である場
合、前記待ち合わせ手段を使用して、他プロセスによる
データの登録を待ち合わせ、 待ちあわせが解除され、データが登録されたら、前記デ
ータ取り出し手段は、状態フラグのチェックから処理を
再実行し、データを取り出し、ポインタの更新が完了し
た場合に、前記第1セグメントのキュー制御情報部の待
ち合わせ数が0より大きい場合には、前記データ取り出
し手段は、前記第1セグメントのキュー制御情報部の通
知セマフォに対し通知を行い、待ち合わせているプロセ
スを起動する制御を行う、ことを特徴とする請求項7に
記載のキュー制御システム。
39. When the number of data in the queue control information section of the first segment is 0, the data fetching means waits for registration of data by another process using the queuing means, and the queuing is released. When the data is registered, the data retrieving means re-executes the process from checking the status flag, retrieves the data, and when the updating of the pointer is completed, the number of queues in the queue control information section of the first segment is reduced. 8. When the value is larger than 0, the data fetching unit notifies the notification semaphore of the queue control information section of the first segment and performs control for starting a waiting process. 2. The queue control system according to 1.
【請求項40】利用者プログラムがキューからデータを
取り出す場合において、前記データ逆取り出し手段で
は、前記第1セグメントのキュー制御情報部のデータ数
が0である場合には、前記待ち合わせ手段を使用して、
他プロセスによるデータの登録を待ち合わせ、 待ちあわせが解除された、すなわちデータが登録された
ら、前記データ逆取り出し手段は、状態フラグのチェッ
クから処理を再実行し、データの取り出しが完了した場
合に、前記第1セグメントのキュー制御情報部の待ち合
わせ数が0より大きい場合には、前記データ逆取り出し
手段は、前記第1セグメントのキュー制御情報部の通知
セマフォに対し通知を行い、待ち合わせているプロセス
を起動する制御を行う、ことを特徴とする請求項7に記
載のキュー制御システム。
40. When the user program extracts data from the queue, the data reverse extracting means uses the queuing means when the number of data in the queue control information section of the first segment is 0. hand,
Waiting for registration of data by another process, when the waiting is canceled, that is, when the data is registered, the data reverse fetching means re-executes the processing from checking the status flag, and when the data fetching is completed, When the number of queues in the queue control information section of the first segment is greater than 0, the data reverse fetch unit notifies the notification semaphore of the queue control information section of the first segment to activate the waiting process. 8. The queue control system according to claim 7, wherein the control is performed.
【請求項41】請求項1乃至8、25乃至40のいずれ
か一に記載のキュー制御システムを備えている情報処理
装置。
41. An information processing apparatus comprising the queue control system according to any one of claims 1 to 8, 25 to 40.
【請求項42】仮想記憶方式を採用し、セグメンテーシ
ョンで仮想記憶空間を管理するコンピュータのセグメン
トをキューで管理するシステムにおいて、 請求項1乃至8、25乃至40のいずれか一に記載のキ
ュー制御システムを備えている、ことを特徴とするキュ
ー制御システム。
42. A queue management system according to any one of claims 1 to 8, and 25 to 40, wherein the system uses a virtual storage system and manages segments of a computer that manages a virtual storage space by segmentation using queues. A queue control system, comprising:
【請求項43】前記キューを生成するにあたり、前記第
1セグメントのキュー制御情報部を初期設定したのち
に、状態フラグを使用中に設定し、利用者プログラムに
は、前記第1セグメントのアドレスを返却するステップ
と、 前記利用者プログラムは、前記アドレスをキーとして、
データの登録及び取り出しを要求するステップと、 を含む、ことを特徴とする請求項9乃至16のいずれか
一に記載のキュー制御方法。
43. In generating the queue, after initializing a queue control information section of the first segment, a status flag is set to “in use”, and a user program includes an address of the first segment in the user program. Returning, the user program uses the address as a key,
17. The queue control method according to claim 9, further comprising: requesting data registration and retrieval.
【請求項44】前記第1セグメントが、キュー制御情報
部として、データを登録するセグメントのエントリを示
す登録ポインタ、データを取りだすセグメントのエント
リを示す取り出しポインタと、登録データ数、セグメン
ト数、次のセグメントのアドレスよりなるリンク情報を
有し、 残りのセグメントはキュー制御情報部として、次セグメ
ントのアドレスよりなるリンク情報を有する、ことを特
徴とする請求項9乃至16のいずれか一に記載のキュー
制御方法。
44. The first segment, as a queue control information section, includes a registration pointer indicating an entry of a segment for registering data, an extraction pointer indicating an entry of a segment for extracting data, the number of registered data, the number of segments, and The queue according to any one of claims 9 to 16, wherein the queue has link information consisting of a segment address, and the remaining segments have link information consisting of the address of the next segment as a queue control information section. Control method.
【請求項45】前記第1セグメントが、キュー制御情報
部として、データを登録するセグメントのエントリを示
す登録ポインタと、データを取りだすセグメントのエン
トリを示す取り出しポインタと、キューに登録されてい
るデータの数と、次のセグメントのアドレスよりなるリ
ンク情報と、に加えて、現在使用している使用セグメン
ト数と、セグメントの初期値である初期セグメント数
と、セグメントの最大値を示す最大セグメント数と、キ
ューの排他制御に用いられる排他セマフォ、プロセス間
の通知用の通知セマフォと、待ち合わせプロセス数を管
理するための待ち合わせ数とをそれぞれ格納するための
欄を含み、 前記第1セグメントを除くセグメントのキュー制御情報
部には、次セグメントのアドレスよりなるリンク情報の
みが設定される、ことを特徴とする請求項9乃至16の
いずれか一に記載のキュー制御方法。
45. The first segment, as a queue control information section, includes a registration pointer indicating an entry of a segment for registering data, an extraction pointer indicating an entry of a segment for extracting data, and a In addition to the number and link information including the address of the next segment, in addition to the number of used segments currently used, the initial number of segments that is the initial value of the segment, the maximum number of segments indicating the maximum value of the segment, A queue for storing the exclusive semaphore used for the exclusive control of the queue, a notification semaphore for notification between processes, and a queue number for managing the number of queued processes; Only link information consisting of the address of the next segment is set in the control information section The queue control method according to claim 9, wherein the queue control is performed.
【請求項46】キューの停止を行うにあたり、キューの
状態を示す状態フラグをチェックし、状態が使用中であ
る場合、状態フラグを停止状態に設定するステップを含
む、ことを特徴とする請求項9乃至16のいずれか一に
記載のキュー制御方法。
46. A method of stopping a queue, comprising checking a status flag indicating the status of the queue, and setting the status flag to a stopped status if the status is in use. 17. The queue control method according to any one of 9 to 16.
【請求項47】キューを消去するにあたり、キューの状
態を示す状態フラグをチェックし、状態が停止状態であ
る場合、使用しているキューのセグメントを全て消去す
るステップを含む、ことを特徴とする請求項9乃至16
のいずれか一に記載のキュー制御方法。
47. When erasing a queue, the method includes a step of checking a status flag indicating the status of the queue and, if the status is in a stopped state, erasing all segments of the queue being used. Claims 9 to 16
The queue control method according to any one of the above.
【請求項48】キューを再初期化するにあたり、キュー
の状態を示す状態フラグが停止中であるかチェックする
ステップと、 状態が停止状態である場合、前記第1セグメントのキュ
ー制御情報部に初期値を設定するステップを有し、 前記初期値を設定する領域はキューの使用により値が更
新される領域のみとされ、 前記状態フラグを使用中状態に設定するステップを有す
る、 ことを特徴とする請求項9乃至16のいずれか一に記載
のキュー制御方法。
48. When re-initializing a queue, checking whether a status flag indicating the status of the queue is stopped, and if the status is stopped, the queue control information section of the first segment is initialized. Setting a value, wherein the area for setting the initial value is only an area for which the value is updated by use of a queue, and the step of setting the state flag to a use state. The queue control method according to any one of claims 9 to 16.
【請求項49】前記データの登録にあたり、キューの状
態を示す状態フラグが使用中であるかチェックするステ
ップと、 状態が使用中である場合、前記第1セグメントのキュー
制御情報部の登録ポインタの指すエントリがセグメント
内の最終エントリかチェックするステップと、 最終エントリの場合、次の登録ポインタを次のセグメン
トの先頭エントリとするステップと、 最終エントリでない場合、次の登録ポインタを登録ポイ
ンタの指すエントリの次のエントリとするステップと、 前記次の登録ポインタが前記第1セグメントのキュー制
御情報部の取り出しポインタと一致するか否か判定する
ステップと、一致しない場合、登録ポインタの指すエン
トリへ登録データを移送するステップと、 を有し、 一方、前記次の登録ポインタが前記第1セグメントのキ
ュー制御情報部の取り出しポインタと一致する場合、空
きエントリなしとしてデータ登録を行わず、 前記第1セグメントのキュー制御情報部の登録ポインタ
を次のポインタをさすエントリに設定するステップと、 前記第1セグメントのキュー制御情報部のデータ数を1
加算するステップと、 を含む、ことを特徴とする請求項9乃至16のいずれか
一に記載のキュー制御方法。
49. A step of checking whether a status flag indicating the status of a queue is in use when registering the data, and, if the status is in use, checking a registration pointer of a queue control information section of the first segment. Checking whether the entry pointed to is the last entry in the segment; if it is the last entry, setting the next registration pointer as the first entry of the next segment; otherwise, the entry pointed to by the next registration pointer to the next registration pointer And determining whether the next registration pointer matches the extraction pointer of the queue control information section of the first segment. If not, the registration data is stored in the entry pointed to by the registration pointer. Transferring the next registration pointer while the next registration pointer is Setting the registration pointer of the queue control information section of the first segment to an entry pointing to the next pointer without performing data registration when there is no empty entry if the extracted pointer matches the extraction pointer of the queue control information section of one segment; The number of data in the queue control information section of the first segment is 1
17. The queue control method according to claim 9, further comprising: adding.
【請求項50】前記データを取り出すにあたり、キュー
の状態を示す状態フラグが使用中であるかチェックする
ステップと、 状態が使用中ある場合、前記第1セグメントのキュー制
御情報部のデータ数が正整数であるかチェックするステ
ップと、 前記データ数が正整数の場合、前記第1セグメントのキ
ュー制御情報部の取り出しポインタからデータを取得す
るステップと、 前記第1セグメントのキュー制御情報部のデータ数を1
つ減算するステップ、 データを取り出したエントリがセグメント内の最終エン
トリの場合、取り出しポインタが次のセグメントの第1
エントリを指すように設定するステップと、 セグメント内の最終エントリでない場合、取り出しポイ
ンタが次のエントリを指すように設定するステップと、 を含む、ことを特徴とする請求項9乃至16のいずれか
一に記載のキュー制御方法。
50. A step of checking whether a status flag indicating the status of a queue is in use when extracting the data, and if the status is in use, the number of data in the queue control information section of the first segment is positive. Checking whether the number is an integer; acquiring the data from the extraction pointer of the queue control information section of the first segment when the number of data is a positive integer; and counting the number of data in the queue control information section of the first segment. 1
If the entry from which the data was retrieved is the last entry in the segment, the retrieval pointer is set to the first entry of the next segment.
17. The method of claim 9, further comprising: setting an entry to point to an entry; and, if not the last entry in the segment, setting the retrieval pointer to point to the next entry. 3. The queue control method according to 1.
【請求項51】前記データの逆取り出しを行うにあた
り、前記第1セグメントの状態フラグが使用中であるか
チェックするステップと、 状態が使用中である場合、前記第1セグメントのキュー
制御情報部のデータの数をチェックするステップと、 データ数が正整数のとき、前記第1セグメントのキュー
制御情報部の登録ポインタの指すエントリ(「登録エン
トリ」という)がセグメント内の先頭エントリではない
場合、登録エントリの1つ前のエントリを指すように登
録ポインタを更新するステップと、 前記登録エントリがセグメント内の先頭エントリである
場合、登録ポインタが指すセグメントの1つ前のセグメ
ントを求め、該セグメントの最終エントリを指すように
登録ポインタを更新するステップと、 更新した登録ポインタの指すエントリから、前記利用者
プログラムから伝えられたデータ返却領域へデータを移
送するステップと、 前記第1セグメントのキュー制御情報部のデータ数から
1減算するステップ、 を含む、ことを特徴とする請求項10乃至16のいずれ
か一に記載のキュー制御方法。
51. A step of checking whether or not the status flag of the first segment is in use when performing the reverse extraction of the data; and, if the status is in use, determining whether the status flag of the first segment is in use. Checking the number of data; if the number of data is a positive integer, and if the entry pointed to by the registration pointer of the queue control information section of the first segment (referred to as “registration entry”) is not the first entry in the segment, Updating the registration pointer to point to the entry immediately before the entry; and if the registration entry is the first entry in the segment, find the segment immediately before the segment pointed to by the registration pointer, Updating the registration pointer to point to the entry; and Transferring the data from the entry to the data return area transmitted from the user program, and subtracting 1 from the number of data in the queue control information section of the first segment. A queue control method according to any one of claims 10 to 16.
【請求項52】利用者プログラムがキューにデータを登
録する場合のデータ登録ステップにおいて、 前記第1セグメントのキュー制御情報部の登録ポインタ
の指すエントリ(「登録エントリ」という)がセグメン
ト内の最終エントリである場合、登録ポインタの指すセ
グメント(「登録セグメント」という)の次セグメント
が、前記第1セグメントのキュー制御情報部の取り出し
ポインタが指しているセグメントであり、使用セグメン
ト数を1つ増加しても、予め定められた最大セグメント
数を超えない場合、登録セグメントを指定してキューを
拡張させるステップと、前記キュー拡張ステップでは、
新しいセグメントを1つ生成し、登録セグメン トの次セグメントが生成したセグメントとなるように、
環状リンクを再設定するステップと、 前記第1セグメントのキュー制御情報部の使用セグメン
ト数に1を加算し、登録セグメントの次セグメントとし
て新しいキューセグメントが追加するステップと、 次登録ポインタに追加したセグメントの先頭エントリを
設定するステップと、 を有し、 登録セグメントの次セグメントが取り出しポインタが指
しているセグメントではない場合には、新たなセグメン
トは生成せず、また、前記第1セグメントのキュー制御
情報部の使用セグメント数に1加算した値が最大セグメ
ント数より大となる場合には、新たなセグメントを生成
しないように制御するステップを、さらに含む、ことを
特徴とする請求項9乃至16のいずれか一に記載のキュ
ー制御方法。
52. In a data registration step when a user program registers data in a queue, an entry pointed to by a registration pointer of the queue control information section of the first segment (referred to as a “registration entry”) is a last entry in the segment. , The segment following the segment pointed to by the registration pointer (referred to as “registration segment”) is the segment pointed to by the extraction pointer of the queue control information section of the first segment, and the number of used segments is increased by one. Also, when the number of segments does not exceed a predetermined maximum number of segments, in the step of expanding the queue by specifying the registration segment, in the queue expansion step,
Create one new segment and make the next segment after the registered segment the generated segment.
Resetting the ring link, adding 1 to the number of used segments of the queue control information section of the first segment, and adding a new queue segment as the next segment of the registered segment; segment added to the next registered pointer Setting the first entry of the first segment, and if the next segment of the registered segment is not the segment pointed to by the extraction pointer, no new segment is generated, and the queue control information of the first segment is not generated. 17. The method according to claim 9, further comprising a step of controlling not to generate a new segment when a value obtained by adding 1 to the number of used segments of the copy is larger than the maximum number of segments. 13. The queue control method according to claim 1.
【請求項53】前記利用者プログラムがキューからデー
タを取り出す場合のデータ取り出しステップにおいて前
記第1セグメントのキュー制御情報部の取り出しポイン
タの指すエントリがセグメント内の最終エントリである
場合、次セグメントの先頭エントリを指すようにデータ
取り出しポインタを更新するステップを有し、 その際、前記第1セグメントのキュー制御情報部の登録
ポインタが指すセグメントがデータを取り出したセグメ
ント(「取り出しセグメント」という)でない場合、取
り出しセグメントが前記1つのセグメントではなく、前
記第1セグメントのキュー制御情報部の使用セグメント
数を1つ減算しても前記第1セグメントのキュー制御情
報部の初期セグメント数を下回らない場合、取り出しセ
グメントを指定してキューを縮退させ、 前記キュー縮退ステップは、指定されたセグメントであ
る取り出しセグメントを消去し、指定されたセグメント
の前セグメントが次セグメントを指すように、環状リン
クを再設定するステップと、 登録ポインタの指すセグメントが取り出しセグメントで
ある場合、取り出しセグメントが前記1つのセグメント
の場合、及び、前記使用セグメント数から1減算した値
が前記第1セグメントのキュー制御情報部の初期セグメ
ント数よりも小の場合には、セグメントを削除しないよ
うに制御するステップを、さらに含む、ことを特徴とす
る請求項9乃至16のいずれか一に記載のキュー制御方
法。
53. If the entry pointed to by the fetch pointer of the queue control information section of the first segment is the last entry in the segment in the data fetching step when the user program fetches data from the queue, the beginning of the next segment Updating the data fetch pointer to point to the entry, wherein if the segment pointed to by the registration pointer of the queue control information section of the first segment is not the segment from which the data was fetched (referred to as “fetch segment”), If the fetch segment is not the one segment and the number of used segments of the queue control information section of the first segment is not less than the initial number of segments of the queue control information section of the first segment even after subtracting one, the fetch segment Specify the queue The queue degeneration step comprises: erasing a fetch segment which is a specified segment, resetting a circular link so that a previous segment of the specified segment points to the next segment, and pointing to a registration pointer. When the segment is a fetch segment, when the fetch segment is the one segment, and when the value obtained by subtracting 1 from the number of used segments is smaller than the initial number of segments in the queue control information section of the first segment, 17. The queue control method according to claim 9, further comprising: controlling not to delete a segment.
【請求項54】利用者プログラムがキューからデータを
LIFO(Last In First Out)形式で取り出す場合
のデータ逆取り出しステップにおいて、 前記第1セグメントのキュー制御情報部の登録ポインタ
が指すエントリがセグメント内の先頭エントリである場
合、前セグメントの最終エントリを指すように登録ポイ
ンタを更新し、その際、更新前の登録ポインタが指して
いたセグメント(「元セグメント」という)が取り出し
ポインタの指すセグメントではない場合、元セグメント
が第1セグメントではなく、過去にキューの拡張が起こ
っており、前記第1セグメントのキュー制御情報部の使
用セグメント数から1減算した値が初期セグメント数以
上である場合、キュー縮退ステップに元セグメントを指
定してキューを縮退させるステップと、 更新前の登録ポインタが指していたセグメント(「元セ
グメント」という)が取り出しポインタの指すセグメン
トの場合は、元セグメントが第1セグメントの場合、及
び、前記第1セグメントのキュー制御情報部の使用セグ
メント数から1減算した値が初期セグメント数より小と
なる場合には、セグメントを削除しないように制御する
ステップと、を含む、ことを特徴とする請求項10乃至
16のいずれか一に記載のキュー制御方法。
54. In the data reverse fetch step when the user program fetches data from the queue in the LIFO (Last In First Out) format, the entry pointed to by the registration pointer of the queue control information section of the first segment is the If it is the first entry, the registration pointer is updated to point to the last entry of the previous segment, and the segment pointed to by the registration pointer before updating (called the “source segment”) is not the segment pointed to by the extraction pointer If the original segment is not the first segment, the queue has been expanded in the past, and the value obtained by subtracting 1 from the number of used segments in the queue control information section of the first segment is equal to or greater than the initial segment number, the queue degeneration step Degenerating the queue by specifying the source segment in the If the segment pointed to by the registration pointer before the new one (referred to as “source segment”) is the segment pointed to by the extraction pointer, the source segment is the first segment, and the segment used by the queue control information section of the first segment 17. The queue according to claim 10, further comprising: when the value obtained by subtracting 1 from the number is smaller than the initial number of segments, controlling to not delete the segment. Control method.
【請求項55】利用者プログラムがキューにデータを登
録する場合において、データ登録ステップでは、設定し
た次登録ポインタの指すエントリが前記第1セグメント
のキュー制御情報部の取り出しポインタの指すエントリ
と同じである場合には、他プロセスが、データを取り出
し空きエントリができることを待ち合わせるステップ
と、 前記データ登録ステップにて、待ちあわせが解除され、
空きエントリができたら、キューの状態を示す状態フラ
グのチェックから処理を再実行するステップと、 データが登録できた場合に、前記第1セグメントのキュ
ー制御情報部の待ち合わせ数が0より大きい場合、前記
データ登録ステップは、前記第1セグメントのキュー制
御情報部の通知セマフォに対し通知を行い、待ち合わせ
ているプロセスを起動するステップと、 を含む、ことを特徴とする請求項9乃至16のいずれか
一に記載のキュー制御方法。
55. When the user program registers data in the queue, in the data registration step, the entry pointed to by the set next registration pointer is the same as the entry pointed to by the extraction pointer of the queue control information section of the first segment. In some cases, another process takes out data and waits for an empty entry. In the data registration step, the waiting is released,
When an empty entry is created, the process is executed again from the check of the status flag indicating the status of the queue. If the data is registered, if the number of queues in the queue control information section of the first segment is greater than 0, 17. The data registering step, comprising: notifying a notification semaphore of a queue control information section of the first segment, and starting a waiting process. A queue control method according to one of the preceding claims.
【請求項56】前記待ち合わせステップにおいて、前記
第1セグメントのキュー制御情報部の待ち合わせ数に1
を加算し、キューの排他を解除し、前記第1セグメント
のキュー制御情報部の通知セマフォで待ち合わせを行う
ステップと、 データ登録、データ取り出し,データ逆取り出し,ある
いはキュー停止ステップからの通知により待ち合わせが
解除され、 その後、キューを排他し、前記第1セグメントのキュー
制御情報部の待ち合わせ数から1を減算するステップを
含む、ことを特徴とする請求項54記載のキュー制御方
法。
56. In the waiting step, the number of queues in the queue control information section of the first segment is set to 1
Is added to the queue, the exclusion of the queue is released, and the queuing is performed by the notification semaphore of the queue control information section of the first segment. 55. The queue control method according to claim 54, further comprising the step of: excluding the queue, and then subtracting 1 from the number of queues in the queue control information section of the first segment.
【請求項57】利用者プログラムがキューからデータを
取り出す場合において、 データ逆取り出しステップでは、前記第1セグメントの
キュー制御情報部のデータ数が0である場合には、他プ
ロセスによるデータの登録を待ち合わせるステップと、 待ちあわせが解除され、データが登録されたら、データ
逆取り出しステップでは、状態フラグのチェックから処
理を再実行するステップと、 データの取り出しが完了した場合に、前記第1セグメン
トのキュー制御情報部の待ち合わせ数が0より大きい場
合には、データ逆取り出しステップは、前記第1セグメ
ントのキュー制御情報部の通知セマフォに対し通知を行
い、待ち合わせているプロセスを起動するステップと、 を含む、ことを特徴とする請求項10乃至16のいずれ
か一に記載のキュー制御方法。
57. When the user program fetches data from the queue, in the data reverse fetching step, if the number of data in the queue control information section of the first segment is 0, registration of data by another process is performed. In the waiting step, when the waiting is canceled and the data is registered, in the data retrieving step, the step of re-executing the processing from the check of the status flag is performed. When the data retrieval is completed, the queue control of the first segment is performed. If the number of queues in the information section is greater than 0, the data reverse fetching step includes a step of notifying the notification semaphore of the queue control information section of the first segment to start a waiting process. A queue according to any one of claims 10 to 16, characterized in that: -Control method.
JP2002152227A 2002-05-27 2002-05-27 Queue control system, queue control method, and queue control program Expired - Fee Related JP3823878B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002152227A JP3823878B2 (en) 2002-05-27 2002-05-27 Queue control system, queue control method, and queue control program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002152227A JP3823878B2 (en) 2002-05-27 2002-05-27 Queue control system, queue control method, and queue control program

Publications (2)

Publication Number Publication Date
JP2003345611A true JP2003345611A (en) 2003-12-05
JP3823878B2 JP3823878B2 (en) 2006-09-20

Family

ID=29769604

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002152227A Expired - Fee Related JP3823878B2 (en) 2002-05-27 2002-05-27 Queue control system, queue control method, and queue control program

Country Status (1)

Country Link
JP (1) JP3823878B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106685856A (en) * 2016-12-30 2017-05-17 国网浙江省电力公司绍兴供电公司 Method, system and equipment for processing intelligent substation mass network messages

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106685856A (en) * 2016-12-30 2017-05-17 国网浙江省电力公司绍兴供电公司 Method, system and equipment for processing intelligent substation mass network messages
CN106685856B (en) * 2016-12-30 2020-03-31 国网浙江省电力公司绍兴供电公司 Method, system and equipment for processing mass network messages of intelligent substation

Also Published As

Publication number Publication date
JP3823878B2 (en) 2006-09-20

Similar Documents

Publication Publication Date Title
JP3815967B2 (en) Method and apparatus for transferring data from a cache of one node to a cache of another node
US6078955A (en) Method for controlling a computer system including a plurality of computers and a network processed as a user resource
JP6248523B2 (en) Data processing management method, information processing apparatus, and data processing management program
US5339427A (en) Method and apparatus for distributed locking of shared data, employing a central coupling facility
US7107323B2 (en) System and method of file distribution for a computer system in which partial files are arranged according to various allocation rules
EP0747832A2 (en) Customer information control system and method in a loosely coupled parallel processing environment
US6862595B1 (en) Method and apparatus for implementing a shared message queue using a list structure
US20030028723A1 (en) Efficient data backup using a single side file
JPH03126158A (en) Method and apparatus for scheduling
JPH0778098A (en) File management system
US5682507A (en) Plurality of servers having identical customer information control procedure functions using temporary storage file of a predetermined server for centrally storing temporary data records
US20110029930A1 (en) Distributed processing device and distributed processing method
US6330625B1 (en) System for initiating multiple read operation requests to multiple copies of a data item and identifying a first one of the requests as having the fastest response time
JPH0962635A (en) Customer information control system and method having transaction-serialization control function in loosely-coupled parallel processing environment
JP2001175460A (en) Program distribution management system
JPH0944461A (en) System and method for control of customer information with api start and cancel transaction function in loosely-coupledparallel processing environment
US6178464B1 (en) System and method for canceling a computer request
JP2003345611A (en) System, method, and program for queue control
JPH10289217A (en) Log stream management system
JP2000227872A (en) Dynamic slot allocation and tracking method for request of plural memories
JPH10289141A (en) Method for managing log stream of multi-system environment
JP2990286B2 (en) Computer system in multi-thread environment
CN116821058B (en) Metadata access method, device, equipment and storage medium
AU2007202589B2 (en) Method and apparatus for transferring data from the cache of one node to the cache of another node
EP1176510A2 (en) Managing a resource used by a plurality of nodes

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060124

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060320

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20060606

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20060619

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100707

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110707

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110707

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120707

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120707

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130707

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees