JPH0520264A - Method for controlling buffer - Google Patents
Method for controlling bufferInfo
- Publication number
- JPH0520264A JPH0520264A JP16795291A JP16795291A JPH0520264A JP H0520264 A JPH0520264 A JP H0520264A JP 16795291 A JP16795291 A JP 16795291A JP 16795291 A JP16795291 A JP 16795291A JP H0520264 A JPH0520264 A JP H0520264A
- Authority
- JP
- Japan
- Prior art keywords
- buffer
- segment
- data
- segments
- unused
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims description 23
- 238000010586 diagram Methods 0.000 description 4
Landscapes
- Information Transfer Systems (AREA)
Abstract
Description
【0001】[0001]
【産業上の利用分野】本発明はバッファ制御方法に関
し、特に複数のセグメントに分割されたデータバッファ
のバッファセグメントへデータを書き込む場合のバッフ
ァの制御方法に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a buffer control method, and more particularly to a buffer control method for writing data to a buffer segment of a data buffer divided into a plurality of segments.
【0002】[0002]
【従来の技術】従来のバッファ制御システムは、バッフ
ァにデータを書き込む際にバッファの空き領域が少なく
データがすべてバッファに書き込むことができない場合
は、現在使用しているバッファに十分な空き領域ができ
るまで待ち合わせを行っていた。2. Description of the Related Art In a conventional buffer control system, when writing data into a buffer, if there is little free space in the buffer and all the data cannot be written into the buffer, there is sufficient free space in the buffer currently in use. I was waiting until.
【0003】[0003]
【発明が解決しようとする課題】上述した従来のバッフ
ァ制御システムは、バッファの空き領域が少なくデータ
をすべてバッファに書き込むことができない場合は常に
バッファに十分な空き領域ができるのを待ち合わせるた
め、バッファへ書き込む性能が良くなかった。The conventional buffer control system described above always waits for a sufficient free space to be created in the buffer when the free space in the buffer is too small to write all the data in the buffer. The writing performance to was not good.
【0004】また、バッファに対する負荷が少ない場合
は多くのバッファセグメントが未使用の状態になりバッ
ファセグメントを無駄に遊ばせておく時間が長くなるい
う欠点があった。Further, when the load on the buffer is small, there is a drawback that many buffer segments are in an unused state and the time for idlely playing the buffer segments becomes long.
【0005】[0005]
【課題を解決するための手段】本発明のバッファ制御方
法は、複数個のバッファセグメントに分割されているデ
ータバッファと、前記データバッファの前記バッファセ
グメントどうしがどの様な順番で接続されているかを示
す接続状況テーブルと、前記接続状況テーブルに登録さ
れている前記バッファセグメントの順に前記データバッ
ファへアクセス可能としたバッファ制御機能をもつバッ
ファ制御装置が、バッファへデータを書き込む際に前記
バッファに空き領域が少なく前記データすべてを書き込
むことができないとき、未使用の前記バッファセグメン
トを捜し出し前記接続状況テーブルに登録することによ
り使用可能な前記バッファの容量を増加させる機能と、
未使用の前記バッファセグメントを捜索した結果、未使
用の前記バッファセグメントが無い場合は前記バッファ
セグメントが解放され使用可能状態になるまで待つ機能
を有する。A buffer control method according to the present invention determines a data buffer divided into a plurality of buffer segments and in what order the buffer segments of the data buffer are connected. A connection status table shown and a buffer control device having a buffer control function that enables access to the data buffer in the order of the buffer segments registered in the connection status table, when writing data to the buffer, an empty area in the buffer When not all the data can be written, there is a function of searching the unused buffer segment and registering it in the connection status table to increase the capacity of the available buffer.
As a result of searching the unused buffer segment, if there is no unused buffer segment, it has a function of waiting until the buffer segment is released and becomes available.
【0006】[0006]
【実施例】次に、本発明の実施例について図面を参照し
て説明する。Embodiments of the present invention will now be described with reference to the drawings.
【0007】図1は本発明のバッファ制御方法の一実施
例を示すデータバッファの概略図である。 データバッ
ファ1はセグメント0:10,セグメント1:11,
〜,セグメントN−1:12のN個のセグメントに分割
されている。本発明の実施例として2台の入出力装置を
接続している入出力制御装置のバッファ制御方法につい
て説明する。入出力制御装置は、内蔵しているこのデー
タバッファ1のセグメントに入出力データを格納しなが
らこの2台の入出力装置に対する入出力動作を行う。FIG. 1 is a schematic diagram of a data buffer showing an embodiment of the buffer control method of the present invention. Data buffer 1 is segment 0:10, segment 1:11,
, Segment N-1: 12 is divided into N segments. A buffer control method of an input / output control device connecting two input / output devices will be described as an embodiment of the present invention. The input / output control device performs input / output operations with respect to the two input / output devices while storing the input / output data in the segment of the built-in data buffer 1.
【0008】図2は登録中のバッファセグメントとバッ
ファセグメントの接続順序を示す接続状況テーブルの概
略図である。接続状況テーブル2にはデータバッファ1
のセグメント数と同等のN個のテーブル0:20,テー
ブル1:21,〜,テーブルN−1:22がある。接続
状況テーブル2は入出力装置単位にある必要があるた
め、同一の接続状況テーブル2が2個存在する。1個の
テーブルはテーブルのビット構成3に示すように有効ビ
ットが1ビットとセグメント番号が7ビットの計1バイ
トで構成されている。接続状況テーブル2はバッファセ
グメント全てを1個のセグメントとして使用できるよう
に、バッファセグメント数と同数の、N個のバッファセ
グメント番号を登録可能としている。接続状況テーブル
2には、現在接続中のバッファセグメントの番号と、そ
のバッファセグメント番号が有効であることを示す有効
ビットが同時に格納される。データバッファへの最初の
アクセス処理は、接続状況テーブル2のテーブル0から
開始するため、テーブル0の有効ビットが0の場合その
入出力装置は使用可能なバッファセグメントを持たない
と言う意味になる。テーブル0の有効ビットが1の場合
その入出力装置は少なくとも1セグメントはバッファセ
グメントを持っていることになり、テーブルに示される
バッファセグメントに対してアクセスが行われる。テー
ブル0が示すバッファセグメントに対してアクセスでオ
ーバーフローが発生すると次のアクセス処理は自動的に
次のテーブル1が示すバッファセグメントに移動する。
このときテーブル1のバッファセグメントにアクセスが
移動するのは、テーブル1の有効ビットが1のときだけ
であり、有効ビットが0の場合は、テーブル0のバッフ
ァセグメントの最初のアドレスに対してアクセスが行わ
れる。上記の自動的にアクセスするセグメントが移動す
るという処理は、最大テーブルN−1まで行われ、テー
ブルN−1のバッファセグメントへのアクセス処理がオ
ーバーフローした場合は、自動的にテーブル0のバッフ
ァセグメントにアクセス処理が移動する。接続状況テー
ブル2の内容は、接続状況テーブル2が対応する入出力
装置への入出力動作が終了した時、クリアされ、使用し
ていたバッファセグメントは解放される。FIG. 2 is a schematic diagram of a connection status table showing the connection order of the buffer segment being registered and the buffer segment. Data buffer 1 in connection status table 2
There are N tables 0:20, tables 1:21, ..., And tables N-1: 22, which are equivalent to the number of segments. Since the connection status table 2 needs to be provided for each input / output device, two identical connection status tables 2 exist. As shown in the bit structure 3 of the table, one table is composed of 1 byte in total including 1 effective bit and 7 segment number. The connection status table 2 is capable of registering N buffer segment numbers as many as the number of buffer segments so that all buffer segments can be used as one segment. The connection status table 2 simultaneously stores the number of the buffer segment currently connected and a valid bit indicating that the buffer segment number is valid. Since the first access process to the data buffer starts from the table 0 of the connection status table 2, if the valid bit of the table 0 is 0, it means that the input / output device has no usable buffer segment. When the valid bit of the table 0 is 1, the input / output device has a buffer segment in at least one segment, and the buffer segment shown in the table is accessed. If an overflow occurs in the access to the buffer segment indicated by table 0, the next access processing automatically moves to the buffer segment indicated by the next table 1.
At this time, access moves to the buffer segment of table 1 only when the valid bit of table 1 is 1, and when the valid bit is 0, access to the first address of the buffer segment of table 0 is performed. Done. The above-mentioned process of automatically moving the segment to be accessed is performed up to the maximum table N-1, and when the access process to the buffer segment of the table N-1 overflows, the buffer segment of the table 0 is automatically changed. Access processing moves. The contents of the connection status table 2 are cleared when the input / output operation to the input / output device corresponding to the connection status table 2 is completed, and the buffer segment used is released.
【0009】図3はマイクロプログラムが行う、データ
バッファへのデータの書き込みを指示する手順を示して
いる。バッファへデータの書き込み要求が発生したとき
マイクロプログラムは、バッファの制御情報よりバッフ
ァの容量に十分な空きがあり書き込みが可能であるかど
うかを判断する(ステップ30)。バッファセグメント
に十分な空きがなく書き込みが不可能である場合と、バ
ッファセグメントへの最初の書き込み時は、バッファセ
グメントの接続処理を実行しバッファへの書き込みを可
能な状態にする(ステップ31)。この処理に関して
は、後ほど図4を用いて詳しく説明する。ステップ32
では、バッファセグメントにデータの書き込みが可能な
のでバッファコントロール部にデータの書き込みを指示
する。データの書き込みが終了した後、次回のデータの
長さを今回書き込んだデータの長さと同一と仮定して、
接続中のバッファセグメントに全データを格納すること
ができるかどうかを計算する。もし、格納不可能ならば
バッファへの書き込みが不可能であるという情報を記憶
領域に記憶し、また格納可能ならば書き込みが可能であ
るという情報を記憶領域に記憶する(ステップ34、3
5)。FIG. 3 shows a procedure performed by the microprogram for instructing writing of data in the data buffer. When a data write request is issued to the buffer, the microprogram determines from the control information of the buffer whether there is sufficient free space in the buffer and writing is possible (step 30). When there is not enough space in the buffer segment and writing is not possible, and when the buffer segment is written for the first time, connection processing of the buffer segment is executed to enable writing to the buffer (step 31). This processing will be described later in detail with reference to FIG. Step 32
Then, since the data can be written in the buffer segment, the buffer controller is instructed to write the data. After writing the data, assuming that the length of the next data is the same as the length of the data written this time,
Calculates whether all data can be stored in the connected buffer segment. If the data cannot be stored, the information that the writing to the buffer is impossible is stored in the storage area, and if the information can be stored, the information that the writing is possible is stored in the storage area (steps 34 and 3).
5).
【0010】図4はバッファセグメントに空きが少なく
データをバッファにすべて書き込むことができないか、
または、テーブル0の有効ビットが0でバッファセグメ
ントがない場合に、未使用のバッファセグメントを接続
して使用可能なバッファセグメントを作る処理の手順を
示している。 マイクロプログラムはバッファセグメン
トに未使用のバッファセグメントが有るかどうかを判断
し、未使用のバッファセグメントが有れば(ステップ4
0のYes)、接続状況テーブル2に登録し(ステップ
44)、処理を終了する。他の入出力装置が残りのバッ
ファセグメントを全て使用していて、未使用のバッファ
セグメントが無く(ステップ40のNo)、且つ接続状
況テーブル2のテーブル0の有効ビットが0である場合
は(ステップ41がNo)、他の入出力装置が使用して
いるいずれかのバッファセグメントが解放されるまで待
ち合わせを行い(ステップ42)、1セグメントが解放
された時、接続状況テーブル2に登録を行い(ステップ
44)、処理を終了する。未使用のバッファセグメント
が無く(ステップ40のNo)、且つ接続状況テーブル
2のテーブル0の有効ビットが1で、少なくとも1セグ
メントは接続状況テーブル2に登録されている場合は
(ステップ41のYes)、現在接続中のバッファセグ
メントに空きができるまで待ち合わせを行い(ステップ
43)、空きができた時点で処理を終了する。FIG. 4 shows that the buffer segment has little space and cannot write all data to the buffer.
Alternatively, when the valid bit of table 0 is 0 and there is no buffer segment, the procedure of the process of connecting an unused buffer segment to make a usable buffer segment is shown. The microprogram determines whether or not the buffer segment has an unused buffer segment, and if there is an unused buffer segment (step 4).
(Yes at 0), register in the connection status table 2 (step 44), and terminate the process. If another I / O device is using all the remaining buffer segments, there is no unused buffer segment (No in step 40), and the valid bit of table 0 of the connection status table 2 is 0 (step 41 is No), and waits until any buffer segment used by another I / O device is released (step 42). When one segment is released, it is registered in the connection status table 2 ( Step 44) ends the process. If there is no unused buffer segment (No in step 40), the valid bit of the table 0 of the connection status table 2 is 1, and at least one segment is registered in the connection status table 2 (Yes in step 41). The process waits until there is a free space in the currently connected buffer segment (step 43), and the process ends when the free space is available.
【0011】[0011]
【発明の効果】以上説明したように、本発明のバッファ
制御方法は、バッファにデータを書き込む際にバッファ
に空き領域が少なくデータをすべてバッファに書き込む
ことができないときは未使用のバッファセグメント番号
を接続状況テーブルに登録し、使用可能なバッファの容
量を増加させることによって、現在使用中のバッファセ
グメントに空き領域ができるまで待ち合わせを行うとい
う処理の実行回数が少なくなりバッファへ書き込む性能
が向上し、また負荷が少ない場合でも未使用のバッファ
セグメントを接続して使用する処理によって未使用のバ
ッファセグメントの数は減少し、バッファセグメントを
無駄に遊ばせておく時間が少なくすることができる。As described above, according to the buffer control method of the present invention, when writing data into the buffer, when there is little free space in the buffer and all the data cannot be written into the buffer, an unused buffer segment number is set. By registering in the connection status table and increasing the available buffer capacity, the number of executions of the process of waiting until there is free space in the currently used buffer segment is reduced and the performance of writing to the buffer is improved. Even when the load is small, the number of unused buffer segments is reduced by the process of connecting and using the unused buffer segments, and the time for idle use of the buffer segments can be reduced.
【図1】本発明のバッファ制御方法の一実施例を示すデ
ータバッファの概略図である。FIG. 1 is a schematic diagram of a data buffer showing an embodiment of a buffer control method of the present invention.
【図2】本実施例の登録中のバッファセグメントとバッ
ファセグメントの接続順序を示す接続状況テーブルの概
略図である。FIG. 2 is a schematic diagram of a connection status table showing a buffer segment being registered and a connection order of the buffer segments according to the present embodiment.
【図3】本実施例のマイクロプログラムがバッファ制御
装置に対しバッファへデータの書き込みを指示する手順
を示すフローチャートである。FIG. 3 is a flowchart showing a procedure in which the microprogram of the present embodiment instructs the buffer control device to write data in the buffer.
【図4】本実施例のバッファセグメントに空きが少なく
データをバッファセグメントに書き込むことができない
場合に未使用のバッファセグメントを接続して使用可能
なバッファの容量を増加させる処理を示すフローチャー
トである。FIG. 4 is a flow chart showing a process of increasing the available buffer capacity by connecting an unused buffer segment when the buffer segment has little free space and data cannot be written to the buffer segment according to the present embodiment.
1 データバッファ 2 接続状況テーブル 10,11,12 バッファセグメント0,1,N−
1 20,21,22 テーブル0,1,N−11 data buffer 2 connection status table 10, 11, 12 buffer segment 0, 1, N-
1 20, 21, 22 Tables 0, 1, N-1
Claims (1)
ているデータバッファと、前記データバッファの前記バ
ッファセグメントどうしがどの様な順番で接続されてい
るかを示す接続状況テーブルと、前記接続状況テーブル
に登録されている前記バッファセグメントの順に前記デ
ータバッファへアクセス可能としたバッファ制御機能を
もつバッファ制御装置が、バッファへデータを書き込む
際に前記バッファに空き領域が少なく前記データすべて
を書き込むことができないとき、未使用の前記バッファ
セグメントを捜し出し前記接続状況テーブルに登録する
ことにより使用可能な前記バッファの容量を増加させる
機能と、未使用の前記バッファセグメントを捜索した結
果、未使用の前記バッファセグメントが無い場合は前記
バッファセグメントが解放され使用可能状態になるまで
待つ機能を備えることを特徴とするバッファ制御方法。Claim: What is claimed is: 1. A data buffer divided into a plurality of buffer segments, and a connection status table indicating in what order the buffer segments of the data buffer are connected. A buffer control device having a buffer control function capable of accessing the data buffer in the order of the buffer segments registered in the connection status table has a small empty area in the buffer when writing data to the buffer, and all the data is stored. When it is not possible to write, a function of increasing the capacity of the available buffer by searching for the unused buffer segment and registering it in the connection status table, and a result of searching the unused buffer segment, If there is no buffer segment before Buffer control method characterized by comprising a function to wait until the buffer segment is released becomes usable state.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP16795291A JPH0520264A (en) | 1991-07-09 | 1991-07-09 | Method for controlling buffer |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP16795291A JPH0520264A (en) | 1991-07-09 | 1991-07-09 | Method for controlling buffer |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH0520264A true JPH0520264A (en) | 1993-01-29 |
Family
ID=15859092
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP16795291A Pending JPH0520264A (en) | 1991-07-09 | 1991-07-09 | Method for controlling buffer |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0520264A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US10041823B2 (en) | 2013-08-09 | 2018-08-07 | Hitachi Metals, Ltd. | Thermal mass flow meter and mass flow controller |
-
1991
- 1991-07-09 JP JP16795291A patent/JPH0520264A/en active Pending
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US10041823B2 (en) | 2013-08-09 | 2018-08-07 | Hitachi Metals, Ltd. | Thermal mass flow meter and mass flow controller |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP2000181764A (en) | File managing system | |
| JPS62177621A (en) | Disk device | |
| JP2821345B2 (en) | Asynchronous I/O control method | |
| JPH0520264A (en) | Method for controlling buffer | |
| JP2634867B2 (en) | Disk cache data transfer control method | |
| JPH09244932A (en) | Disk array device | |
| JP2967687B2 (en) | Advance buffer flush system | |
| JP3472357B2 (en) | Information processing device | |
| JP2912657B2 (en) | File access processor | |
| JP2994917B2 (en) | Storage system | |
| JP3259095B2 (en) | Data transfer method | |
| JPH07152574A (en) | Program loading method | |
| JPH0520243A (en) | Data processing system | |
| JPH05158792A (en) | Batch reading system for cache buffer | |
| JPH07152642A (en) | Data area expansion method | |
| JPH0876940A (en) | Disk array control method | |
| JPH1011351A (en) | Computer system | |
| JPS6299827A (en) | Buffer control method | |
| JP2004288213A (en) | Data processing system and data processing method | |
| JPH04271472A (en) | System for processing data base | |
| JPH0242549A (en) | Light-after type disk cache control device | |
| JPH04342011A (en) | Asynchronous input/output controlling system | |
| JPH0432944A (en) | Magnetic disk control system | |
| JPH0447346A (en) | Decentraiized file processing system | |
| JPH05289822A (en) | Cd-rom reader |