JPH0256035A - Write/read control system for sequential file - Google Patents

Write/read control system for sequential file

Info

Publication number
JPH0256035A
JPH0256035A JP63205679A JP20567988A JPH0256035A JP H0256035 A JPH0256035 A JP H0256035A JP 63205679 A JP63205679 A JP 63205679A JP 20567988 A JP20567988 A JP 20567988A JP H0256035 A JPH0256035 A JP H0256035A
Authority
JP
Japan
Prior art keywords
eof
file
record
read
pointer
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
JP63205679A
Other languages
Japanese (ja)
Other versions
JPH0810442B2 (en
Inventor
Hironari Hayashi
宏也 林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP63205679A priority Critical patent/JPH0810442B2/en
Publication of JPH0256035A publication Critical patent/JPH0256035A/en
Publication of JPH0810442B2 publication Critical patent/JPH0810442B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

PURPOSE:To constitute the title system so that exact EOF information can always be obtained, and a record can be referred to in the course of addition processing of the record by providing an EOF managing mechanism separately from a file and inquiring of this mechanism about an EOF position. CONSTITUTION:The system can execute a utilization in which a WRITE processing and a READ processing at the time when a record is added to the same sequential file, that is, when a file is opened are mixed. EOF information is managed separately from the file in accordance with an EOF managing process 2 of an EOF managing mechanism. This EOF managing mechanism has a function for updating a pointer of an EOF by adding the record, a function for informing an EOF pointer in the case of referring to the record, and a waiting control mechanism of a reference processing of the record. By inquiring of the EOF managing mechanism about an EOF position by these functions, exact EOF information can always be obtained.

Description

【発明の詳細な説明】 〔概   要〕 同一順ファイルに対するレコードの追加と参照とが混在
した利用形態におけるファイルオープン時の書込み読出
し制御方式に関し、 同一順ファイルに対するレコードの追加と参照とを混在
させることが可能な順ファイルの書込み読出し制御方式
を目的とし、 オープンしたファイルに対してレコードの追加及びレコ
ードの参照が可能なファイル手段と、En(I Of 
File  (EOF )情報を前記ファイル手段とは
別に管理する機構であって、READ処理において順フ
ァイルのオープン時に要求されたEOFボインクをRE
ADプロセス手段に与え、READプロセス手段におけ
る順ファイルのREAD処理を与える旧EOFを受信し
、前記READ処理中にWRITEプロセス手段による
レコードの追加があるかどうかをチェックし、WRIT
Eプロセスがある場合には、追加処理後に生成されたE
OFポインタを取り込み、取得した新EOFと旧EOF
とが一致していない場合にはREADプロセス手段に新
EOFを送信することにより、常にEOFポインタの位
置を管理するEOF管理プロセス手段と、順ファイルを
オープンし前記EOF管理プロセス手段にEOFポイン
タを要求し、EOFポインタ取得後前記ファイル手段を
アクセスし、順ファイルのレコードの読み込み終了後、
再度EOFの取り直しがあるかどうかを前記EOF管理
プロセス手段に要求し、EOFの取り直しがある場合に
は新EOFまでREAD処理を続行するREADプロセ
ス手段と、順ファイルをオープンし、順ファイルにレコ
ードを追加した後、前記EOF管理プロセス手段にEO
Fポインタの更新を要求し、・EOF管理プロセス手段
からEOFの更新に対する完了のメツセージを受信後、
レコードの追加処理を続行するかどうかを決定するW 
RITEプロセス手段からなり、同一順ファイルに対す
るレコードの追加とレコードの参照とを混在するように
構成する。
[Detailed Description of the Invention] [Summary] Regarding a write/read control method when opening a file in a usage mode in which record addition and reference to the same sequential file are mixed, record addition and reference to the same sequential file are mixed. The purpose of the present invention is to provide a sequential file write/read control method that allows for sequential file read/write control, and a file means that allows records to be added to and referenced from an opened file, as well as En(I Of
This is a mechanism for managing File (EOF) information separately from the file means, and it is a mechanism that manages the EOF information separately from the file means, and it is a mechanism for
Receives the old EOF that is given to the AD process means and causes the READ process means to perform READ processing of the sequential file, checks whether or not a record is added by the WRITE process means during the READ processing, and performs the WRIT
If there is an E process, the E generated after additional processing
The new EOF and old EOF obtained by importing the OF pointer
If they do not match, the EOF management process means that always manages the position of the EOF pointer by sending a new EOF to the READ process means, and the EOF management process means that opens a sequential file and requests the EOF pointer from the EOF management process means. After acquiring the EOF pointer, access the file means, and after reading the records of the sequential file,
A READ process means that requests the EOF management process means to determine whether or not the EOF is to be taken again, and if there is a retake of the EOF, continues the READ processing up to the new EOF, and a READ process means that opens a sequential file and writes records in the sequential file. After adding, the EOF management process means
After requesting an update of the F pointer and receiving a message of completion for updating the EOF from the EOF management process means,
W to decide whether to continue adding records
It consists of a RITE process means and is configured to mix record addition and record reference to the same sequential file.

〔産業上の利用分野〕[Industrial application field]

本発明は、順ファイルの制御方式に関し、さらに詳しく
は同一順ファイルに対するレコードの追加と参照とが混
在した利用形態におけるファイルオープン時の書込み読
出し制御方式に関する。
The present invention relates to a sequential file control method, and more particularly to a write/read control method when opening a file in a usage mode in which record addition and reference to the same sequential file are mixed.

高度情報処理社会の発展に伴い、ファイルから情報を読
み出し処理した後また格納する情報処理装置の高度な利
用形態がますます重要になってきた。ファ・イルシステ
ムでは、各ファイルがレコードの集合であり、同一順フ
ァイルに対するレコードの追加と参照が頻繁に実行され
る。レコードの追加処理においてはそのファイルをオー
プンした後現在のE OF (End Of File
)を検出し、そのEOFの位置から順にレコードの情報
が追加される。
2. Description of the Related Art With the development of an advanced information processing society, advanced forms of use of information processing devices that read information from files, process it, and then store it again have become increasingly important. In a file system, each file is a collection of records, and records are frequently added and referenced in the same sequential file. In record addition processing, the current E OF (End Of File) is opened after opening the file.
) is detected, and record information is added in order from the EOF position.

これが順ファイルをEXTENDモードでオープンした
場合のWRITE処理である。また、レコードの参照処
理はファイルをオープンした後現在のEOFまでの情報
を順に読み出す処理でこれが順ファイルをINPUTモ
ードでオープンした場合のREAD処理である。一般に
レコードの参照はファイル媒体上に直接書かれたE O
’Fを検出するとその処理を終了する。一方、レコード
の追加では既存のEOF上にレコードを上書きし、レコ
ードの追加を終了した後媒体上に新たなEOFを書き出
す。
This is the WRITE process when a sequential file is opened in EXTEND mode. Further, the record reference process is a process of sequentially reading information up to the current EOF after opening a file, and this is a READ process when a sequential file is opened in INPUT mode. Generally, record references are written directly on the file medium.
When 'F is detected, the process ends. On the other hand, when adding a record, the record is overwritten on the existing EOF, and after the record addition is completed, a new EOF is written on the medium.

最近、ファイルシステムを高度に利用するために同時に
2つのファイルに対するアクセスを可能にする要求や1
つのファイルに対してレコードの追加とレコードの参照
とを同時に行う要求が非常に高まったきた。
Recently, in order to make advanced use of file systems, there has been a demand for access to two files at the same time.
The demand for simultaneously adding records and referencing records to a single file has increased significantly.

〔従来の技術〕[Conventional technology]

従来、ファイル割当時にファイルに対する排他処理の強
度を強くし、複数のファイルに対して複数のアプリケー
ションプログラムが共用できる方式のみが採用されてい
た。
Conventionally, only a method has been adopted in which the strength of exclusive processing for files is strengthened at the time of file allocation so that multiple application programs can share multiple files.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

この種の従来方式によると同一ファイルに対してのレコ
ードの追加とレコードの参照とを混在させることができ
ないという問題が生じていた。同一順ファイルに対する
レコードの追加とレコードの参照とを混在させる場合に
はレコードの参照が媒体上に直接書かれたEOFを検出
するとその処理を終了し、一方、レコードの追加では既
存のEOF上にレコードを上書きし、レコードの追加を
終了した後、媒体上に新たなEOFを書き出すため、レ
コードの追加の最中はファイルEOFが存在しない状態
となる。そΦため、レコードの参照処理においてEOF
を検出することができず、レコードの参照処理がレコー
ドの追加処理を追い越す場合がある。従来方式ではレコ
ードの参照処理がレコードの追加処理を追い越さないよ
うな制御が実行できず、例えば以下のようなレコード参
照の待ち制御を実現することが困難であった。
This type of conventional method has a problem in that it is not possible to mix record addition and record reference to the same file. When record addition and record reference are mixed for the same sequential file, when record reference detects an EOF written directly on the medium, the process ends; After the record is overwritten and the record addition is completed, a new EOF is written on the medium, so the file EOF does not exist while the record is being added. Φ Therefore, in the record reference process, the EOF
cannot be detected, and record reference processing may overtake record addition processing. In the conventional method, it is not possible to perform control such that record reference processing does not overtake record addition processing, and it is difficult to implement the following record reference wait control, for example.

■ファイルのオープン時のEOFまでレコードを参照す
る。
■Reference records up to EOF when the file is opened.

■EOFがレコードの追加により更新されている場合は
、さらに更新されたEOFまでのレコードを参照する。
(2) If the EOF has been updated by adding records, refer to the records up to the updated EOF.

■EOFが更新されていない(まだレコードの追加がさ
れていない)場合、レコードの追加によりEOFが更新
されるまでレコードの参照を待ち合わせる。
(2) If the EOF has not been updated (no record has been added yet), wait until the record is referenced until the EOF is updated by adding a record.

すなわち、従来の方式では、例えば、順ファイルに書き
出されたデータをコンソール装置にそのまま出力すると
いうモニタリング処理が実行できないという問題点があ
った。従って、レコードの追加と参照とを混在した利用
形態が高度に利用されず、ファイルの複数のアプリケー
ションプログラムの共用化に対して利用形態が限定され
るという問題点が生じていた。
That is, the conventional method has a problem in that, for example, it is not possible to perform a monitoring process in which data written to a sequential file is directly output to a console device. Therefore, a usage pattern in which record addition and reference are mixed is not used to a high degree, and a problem arises in that the usage pattern is limited to the sharing of a file by a plurality of application programs.

本発明は同一順ファイルに対するレコードの追加と参照
とを混在させることが可能な順ファイルの書込み読出し
制御方式を提供することを目的とする。
SUMMARY OF THE INVENTION An object of the present invention is to provide a sequential file write/read control method that allows record addition and reference to the same sequential file to be mixed.

〔課題を解決するための手段〕[Means to solve the problem]

第1図は本発明の機能ブロック図である。 FIG. 1 is a functional block diagram of the present invention.

情報処理システムは、オープンしたファイルに対してレ
コードの追加及びレコードの参照が少なくとも可能なフ
ァイル手段1′を有する。そして、End Of Fi
le  (EOF )情報を前記ファイル手段1とは別
に管理する機構であって、READ処理において順ファ
イルのオープン時に要求されたEOFポインタをREA
Dプロセス手段3に与え、READプロセス手段3にお
ける順ファイルのREAD処理が終了した後その終了を
与える旧EOFを受信する機構を有し、前記READ処
理中にWRITEプロセス手段4によるレコードの追加
があるかどうかをチェックし、WRITEプロセスがあ
る場合には、追加処理後に生成された新しいEOFポイ
ンタを取り込み、取得した新EOFと旧EOFとが一敗
していない場合にはREADプロセス手段3に新EOF
を送信しするものであって、常にEOFポインタの位置
を管理するEOF管理プロセス手段2を設ける。そして
、順ファイルのオープン時に前記EOF管理プロセス手
段2にEOFポインタを要求し、EOFポインタ取得後
前記ファイル手段1をアクセスし、順ファイルのレコー
ドを読み込み、読み込み終了後、再度EOFの取り直し
があるかどうかを前記EOF管理プロセス手段2に要求
し、EOFの取り直しがある場合には新EOFまでRE
AD処理を続行するREADプロセス手段3と、順ファ
イルをオープンし、順ファイルにレコードを追加した後
、前記EOF管理プロセス手段2にEOFポインタの更
新を要求し、EOF管理プロセス手段2からEOFの更
新に対する完了のメツセージを受信後、レコードの追加
処理を続行するかどうかを決定するWRITEプロセス
手段4とををする。
The information processing system includes a file means 1' that is capable of at least adding records to and referencing records in an opened file. And End Of Fi
A mechanism for managing le (EOF) information separately from the file means 1, which uses the EOF pointer requested when opening a sequential file in READ processing.
It has a mechanism to receive the old EOF which is given to the D process means 3 and which gives the termination after the read process of the sequential file in the READ process means 3 is completed, and the record is added by the WRITE process means 4 during the READ process. If there is a WRITE process, the new EOF pointer generated after the additional processing is fetched, and if the acquired new EOF and old EOF have not lost, the new EOF pointer is sent to the READ process means 3.
An EOF management process means 2 is provided to transmit the EOF pointer and always manage the position of the EOF pointer. Then, when a sequential file is opened, an EOF pointer is requested from the EOF management process means 2, and after acquiring the EOF pointer, the file means 1 is accessed, a record of the sequential file is read, and after reading is completed, whether the EOF is to be retrieved again. If the EOF management process means 2 needs to be re-taken, the RE is sent to the new EOF.
The READ process means 3 continues AD processing, opens a sequential file, adds a record to the sequential file, requests the EOF management process means 2 to update the EOF pointer, and updates the EOF from the EOF management process means 2. After receiving the completion message for the WRITE process, the WRITE process means 4 decides whether to continue the record addition process.

〔作  用〕[For production]

本発明ではファイルのEOF情報゛をファイル内の媒体
内に・持つのではなく、ファイルとは別にEOFを管理
するEOF管理機構を設け、EOF管理機構にEOF位
置を問い合わせることにより、常に正確なEOF情報を
取得fることができる。
In the present invention, instead of having the EOF information of a file in the medium within the file, an EOF management mechanism is provided that manages the EOF separately from the file, and by querying the EOF management mechanism for the EOF position, the EOF information is always accurate. Information can be obtained.

これによりレコードの追加によりEOF情報が破壊され
ることなくレコードの追加処理中にレコードを参照する
ことが可能となる。
This makes it possible to refer to the record during record addition processing without destroying the EOF information due to record addition.

〔実  施  例〕〔Example〕

次に図面を参照して本発明の詳細な説明する。 Next, the present invention will be described in detail with reference to the drawings.

第2図は本発明のプロセス処理の機能ブロンク図である
。同図において、第1図と同しものは同じ記号で示され
、4は順ファイルに対するレコードの追加を実行するW
RITEプロセス、3は順ファイルに対するレコードの
参照を実行するREADプロセス、2はEOFポインタ
を管理するEOF管理プロセス、■は順ファイルの媒体
である°。
FIG. 2 is a functional block diagram of the process of the present invention. In the figure, the same things as in Figure 1 are indicated by the same symbols, and 4 is a W that executes record addition to the sequential file.
A RITE process, 3 a READ process that executes record reference for a sequential file, 2 an EOF management process that manages an EOF pointer, and ■ a sequential file medium.

本発明は、同一順ファイルに対するレコードの追加、す
なわち、順ファイルを拡張(EXTEND)モードで、
オープンした場合のWRITE処理と、レコードの参照
すなわち順ファイルをインプント(INPtJT)モー
ドでオーブンした場合のREAD処理とを混在した利用
形態を実現する。そのため本発明では、EOF情報はE
OF管理機構のEOF管理プロセス2に従ってファイル
とは独立に管理される。すなわち、EOF情報は直接フ
ァイルの媒体に書かれず、EOF管理機構において、管
理される。このEOF管理機構はレコードの追加により
EOFのポインタを更新する機能、レコードを参照する
場合EOFポインタを通知する機能、及びレコードの参
照処理の待ち制御機能を有する。これらの機能により、
EOF管理機構にEOF位置を問い合わせることにより
、常に正確なEOF情報を取得する動作が実行され、レ
コードの追加によりEOF情報が破壊されることなく、
レコードの追加処理中にレコードを参照することができ
る。このような動作を以下に説明する。
The present invention enables the addition of records to the same sequential file, that is, the sequential file in the EXTEND mode.
A usage mode is realized in which WRITE processing when opened and READ processing when a record is referenced, that is, a sequential file is opened in the implant (INPtJT) mode. Therefore, in the present invention, the EOF information is
It is managed independently from files according to the EOF management process 2 of the OF management mechanism. That is, the EOF information is not directly written on the file medium, but is managed by the EOF management mechanism. This EOF management mechanism has a function of updating an EOF pointer by adding a record, a function of notifying the EOF pointer when a record is referenced, and a function of waiting control for record reference processing. With these features,
By querying the EOF management mechanism for the EOF position, operations are always performed to obtain accurate EOF information, and the EOF information is not destroyed by adding records.
Records can be referenced during record addition processing. Such an operation will be explained below.

READプロセス3において、ステップR1において、
順ファイルのオープン時、すなわちインプントモードで
EOF管理プロセス2に対してEOFボインクを要求す
る。R2ステップでEOF管理プロセス2よりEOFポ
インタを取得する。
In READ process 3, in step R1,
When opening a sequential file, that is, in implant mode, an EOF boiling request is made to the EOF management process 2. In step R2, the EOF pointer is acquired from the EOF management process 2.

取得したEOFポインタを用いてステップR3において
READ処理を行う。この時のEOFを旧EOFとすれ
ば、ステップR3のREAD処理では順ファイルの先頭
アドレスからこの旧EOFまでのレコードを読み出し、
ステップR4においてEOFにポインタまで来たかどう
かを判定する。
A READ process is performed in step R3 using the acquired EOF pointer. If the EOF at this time is the old EOF, the READ process in step R3 reads the record from the first address of the sequential file to this old EOF,
In step R4, it is determined whether the pointer has reached the EOF.

もしEOFでなければステップR3を繰り返し、次のレ
コードを読み、これを逐次行うことになる。
If it is not EOF, step R3 is repeated, the next record is read, and this process is performed one after another.

ステップR4においてポインタがR2で取得したEOF
にきたとすればREAD処理を終了する。
In step R4, the pointer is the EOF acquired in R2.
If this happens, the READ process ends.

すなわち、順ファイルのEOF位置までレコードを読み
込んだか否かをチェックし、EOF位置まで読み込んだ
ならば次のステップR5に移る。ステップR5ではEO
Fポインタを取り直す、即ち旧EOFに代わる新しいE
OFが存在するかどうかを確かめる。そのため、EOF
を要求するメツセージを再びEOF管理プロセス2に答
申する。
That is, it is checked whether the record has been read up to the EOF position of the sequential file, and if the record has been read up to the EOF position, the process moves to the next step R5. In step R5, EO
Retake the F pointer, i.e. a new E to replace the old EOF.
Check if OF exists. Therefore, EOF
The message requesting the same is reported to the EOF management process 2 again.

このとき、READプロセス3が持つEOFポインタの
値、即ち旧EOFとメツセージを送信したREADプロ
セス3の識別子すなわち返信メツセージ用のアドレスを
EOF管理プロセス2に転送する。この識別子は戻りア
ドレスとしてEOF管理プロセス2内にセットされ、旧
EOFの値もセントされる。すなわちEOF管理プロセ
ス2ではREADプロセスから送信されたEOFポイン
タ及び戻りアドレスをEOF管理プロセス内の制御表に
格納する。EOF管理プロセス2ではREADプロセス
3がメツセージの待ち状態にあるのでREADプロセス
3からのメツセージに対する返信メツセージをREAD
プロセス3に送信する。
At this time, the value of the EOF pointer held by the READ process 3, that is, the old EOF, and the identifier of the READ process 3 that sent the message, that is, the address for the reply message, are transferred to the EOF management process 2. This identifier is set in the EOF management process 2 as the return address and the old EOF value is also sent. That is, the EOF management process 2 stores the EOF pointer and return address sent from the READ process in a control table within the EOF management process. In the EOF management process 2, the READ process 3 is waiting for a message, so it reads the reply message to the message from the READ process 3.
Send to process 3.

ステップR6においてEOF管理プロセス2からメツセ
ージを受信するとREADプロセス3はこのメツセージ
の内容を解読する。そして、ステップR2において取得
したEOFと異なる更新済のEOFポインタであるかど
うかをチェックし、さらにレコード参照の終了通知であ
るかどうかを判定する。すなわちステップR7において
受信したメツセージの内容が新EOFかレコード参照の
終了かをチェックし、レコード参照の終了ならばレコー
ド参照の一連の処理を終了する。もし新EOFならば、
次のR8のステップを実行する。ステツブR8では、読
み込んだレコードの加工の処理を実行し、新EOFを用
いてステップR3のREAD処理を行う。このようにR
EADプロセス3ではEOF管理機構にEOF位置を常
に問い合わせるので正確なEOF情報を取得することが
可能となる。
Upon receiving a message from the EOF management process 2 in step R6, the READ process 3 decodes the contents of this message. Then, it is checked whether the EOF pointer is an updated EOF pointer different from the EOF obtained in step R2, and further it is determined whether it is a record reference end notification. That is, in step R7, it is checked whether the content of the received message is a new EOF or the end of record reference, and if it is the end of record reference, the series of record reference processing is ended. If it is a new EOF,
Execute the next step R8. In step R8, the read record is processed, and the new EOF is used to perform the READ process in step R3. Like this R
In the EAD process 3, since the EOF management mechanism is constantly inquired about the EOF position, accurate EOF information can be obtained.

旧EOFから新EOFに変更するプロセスがWRITE
プロセス4である。WRITEプロセス4においてもレ
コードの追加によりEOFポインタを更新した場合、そ
の更新した旨をEOF管理プロセス2に通知する機能が
ある。WRITEプロセス4のステップWlでは順ファ
イルヲ拡張モードにおいてオープンし、順オープンした
ことをEOF管理プロセス2に通知する。ステップW2
において類ファイルをアクセスし、レコードを追加する
。この場合口EOFを消し、レコードを追加することに
なる。そして論理的な処理の区切りになるまでレコード
の追加を繰り返す。W3ステップにおいてレコードの追
加終了後にEOF管理プロセス2に新しいEOFポイン
タの更新があることをメツセージとして通知する。W4
ステップにおいてEOF管理プロセス4が確かに新EO
Fを受は取ったことを示すEOF更新完了メツセージを
受信する。EOF更新完了メツセージ受信後、更にレコ
ードの追加処理を続行する場合にはW2ステップに戻っ
て同様な処理を行う。もし、レコードの追加がなくレコ
ードの追加処理が終了しているならファイルをクローズ
し、次のW5ステップに移る。W5ステップではファイ
ルをクローズした場合、そのクローズした旨をEOF管
理プロセスに通知する。
The process of changing from old EOF to new EOF is WRITE
This is process 4. The WRITE process 4 also has a function of notifying the EOF management process 2 of the update when the EOF pointer is updated by adding a record. In step Wl of the WRITE process 4, the sequential file is opened in the expansion mode, and the EOF management process 2 is notified that the sequential file has been opened. Step W2
Access similar files and add records. In this case, the EOF will be deleted and a record will be added. Then, record addition is repeated until a logical processing break is reached. In step W3, after the record addition is completed, the EOF management process 2 is notified as a message that a new EOF pointer has been updated. W4
In step EOF management process 4 is certainly the new EO
Receives an EOF update completion message indicating that F has been received. After receiving the EOF update completion message, if the process of adding records is to be continued, the process returns to step W2 and performs the same process. If no record has been added and the record addition process has been completed, the file is closed and the process moves to the next step W5. In step W5, when the file is closed, the EOF management process is notified of the closing.

EOF管理プロセス2はEOF情報をファイルとは独立
に管理するものである。
The EOF management process 2 manages EOF information independently of files.

第3図は本発明のEOF管理機構の管理プロセスの機能
ブロック図である。EOF管理プロセス2においては常
にREADプロセス3からのメツセージに対する処理及
びWRITEプロセス4に対する処理2を同時に行う。
FIG. 3 is a functional block diagram of the management process of the EOF management mechanism of the present invention. The EOF management process 2 always performs processing for the message from the READ process 3 and processing 2 for the WRITE process 4 at the same time.

第3図の右図がREADメツセージに対する機能の処理
過程で、左図がWRITEメツセージに対する機能の処
理過程である。READメツセージに対する処理のステ
ップ5において、READプロセス3からのメツセージ
を待ち、メツセージがなければ、常に待ち状態になるが
、メツセージを受信すればREADプロセスの戻りアド
レス、及びREADプロセスから通知された旧EOFを
格納しステップ6に入る。
The right diagram in FIG. 3 shows the process of processing a function for a READ message, and the left diagram shows a process of processing a function for a WRITE message. In step 5 of processing for the READ message, a message from the READ process 3 is waited for, and if there is no message, the state is always in a waiting state, but if a message is received, the return address of the READ process and the old EOF notified from the READ process are returned. is stored and the process goes to step 6.

そして、現在格納されたEOFがWRITEプロセス4
からの要求で更新したり、あるいはREADプロセス3
からの要求で読み出されることを禁止するため、EOF
ポインタをロックする。そしてステップ7で、READ
プロセス3からすでにREAD処理が終わった時点での
旧EOFを受信し、さらに、WtTEプロセス4から新
EOFを受信し、これを格納する。そしてステップ8で
EOFのロックを解除し、ステップ9においてWRIT
Eプロセス4から取得した新EOFとREADプロセス
3から受信した旧EOFとが一致しているかどうかをチ
ェックする。新EOFと旧EOFが一致していなければ
、すでにREAD処理が終わった旧EOFに対して、さ
らにそこを先頭アドレスとして新しい新EOFまでRE
ADするための制御を行う。そのためステップ1oで更
新法の新EOFをREADプロセス3に送信し、ステッ
プ5に戻ってREADプロセス3からのメツセージ待ち
となる。また、もし新EOFと旧EOFが一致している
場合は、READ処理は終わり、さらにEOFはWRI
TEプロセス4によって更新されていないことが確認で
きるのでステップ11に移る。ステップ11では、ファ
イルを拡張モードでオープンしているWRITEプロセ
ス4が1つも存在していないかどうか調べ、もし存在し
ていなければREADプロセス3にその終了を通知する
。もしファイルを拡張モードでオープンしているWRI
TEプロセス4が少なくとも1つ存在すればステップ1
2に移り、WRITEプロセス4から新EOFを受は取
るため、待ち状態となる。さらにステップ12において
EOFがWRITEプロセ久4により更新されるまでR
EADプロセス3からのメツセージに対する処理に対し
ても待ち状態となり、このときREADプロセス3も待
ち状態である。ステップ12において、EOFがWRI
TEプロセス4により更新されたなら、ステップ6.7
.8に戻り、EOFポインタをロックしEOFポインタ
を取得した後そのロックを解除する。そして、新しいE
OFポインタをREADプロセス3に与える。
Then, the currently stored EOF is WRITE process 4
Update on request from or READ process 3
EOF
Lock pointer. And in step 7, READ
The old EOF at the time when the READ process has already been completed is received from the process 3, and the new EOF is received from the WtTE process 4 and stored. Then, in step 8, unlock EOF, and in step 9, WRIT
It is checked whether the new EOF obtained from the E process 4 and the old EOF received from the READ process 3 match. If the new EOF and old EOF do not match, RE to the old EOF for which READ processing has already been completed, and then use that as the starting address to the new new EOF.
Performs control for AD. Therefore, in step 1o, the new EOF of the update method is sent to the READ process 3, and the process returns to step 5 to wait for a message from the READ process 3. Also, if the new EOF and old EOF match, the READ process ends and the EOF is changed to WRI.
Since it can be confirmed that it has not been updated by TE process 4, the process moves to step 11. In step 11, it is checked whether there is any WRITE process 4 that is opening a file in extended mode, and if there is, the READ process 3 is notified of its termination. If the file is opened in extended mode, WRI
Step 1 if at least one TE process 4 exists
2, the new EOF is received from the WRITE process 4, so it enters a waiting state. Furthermore, in step 12, the R
It is also in a waiting state for processing a message from the EAD process 3, and at this time, the READ process 3 is also in a waiting state. In step 12, the EOF is
If updated by TE process 4, step 6.7
.. Returning to step 8, the EOF pointer is locked, and after acquiring the EOF pointer, the lock is released. And the new E
Give the OF pointer to the READ process 3.

第3図の左図はWRITEメツセージに対する処理であ
る。ステップ13においてWRITEプロセス4からの
メツセージを待ち、ステップ14でWRITEプロセス
4からのメンセージを受信した場合、ステップ15でE
OFポインタをロックし、ステ、ブ16でEOFポイン
タを更新し、ステップ17でEOFポインタのロックを
解除する。新EOFを更新した後ステップ18において
中1祈しているREADメンセージを再開する。すなわ
ち待ち状態にあるREADプロセス3のメツセージに対
して、その処理を再開し、待ち状態にある処理が複数存
在する場合はそれらのすべてを再開する。その後、ステ
ップ13に戻り、WRITEプロセス4からのメツセー
ジの待ち状態となる。
The left diagram in FIG. 3 shows processing for WRITE messages. If the message from WRITE process 4 is waited for in step 13 and the message from WRITE process 4 is received in step 14, then in step 15
The OF pointer is locked, the EOF pointer is updated in step 16, and the EOF pointer is unlocked in step 17. After updating the new EOF, in step 18, resume the READ message that was being prayed in the first year of junior high school. That is, the processing of the message of the READ process 3 in the waiting state is restarted, and if there are multiple processes in the waiting state, all of them are restarted. Thereafter, the process returns to step 13 and waits for a message from the WRITE process 4.

また、EOF管理プロセス2では、任意の順ファイルを
オープンしているWRITEプロセス4の数を管理し、
またとのREADプロセス3がこの順ファイルをオープ
ンしているかを管理する。
In addition, the EOF management process 2 manages the number of WRITE processes 4 that have opened any sequential file,
It also manages whether the READ process 3 is opening this sequential file.

さらにある順ファイルをオープンしているWRITEプ
ロセス4がすべてなくなった場合にその順アイルをオー
プンしているすべてのREADプロセス3に対してレコ
ード参照処理の終了を通知する。
Furthermore, when all the WRITE processes 4 that have opened a certain sequential file are gone, all the READ processes 3 that have opened that sequential file are notified of the end of the record reference process.

〔発明の効果〕〔Effect of the invention〕

本発明ではEOF情報はファイルとは別なEOF管理機
構により管理されているため、EOF位置を正確に取得
することが可能で、レコードの参照がレコードの追加処
理を追い越すことはなく、拡張モードによりオープンさ
れたファイル内でのレコードの追加及びインプットモー
トによりオープンされている同一の順ファイルのレコー
ドの参照とを混在することが可能となる。従ってレコー
ドを追加している順ファイルに対するモニタリング処理
等を正確に実行できる。
In the present invention, EOF information is managed by an EOF management mechanism separate from files, so it is possible to accurately obtain the EOF position, record references do not overtake record addition processing, and in extended mode It is possible to mix adding records within an open file and referencing records in the same sequential file opened by an input mote. Therefore, monitoring processing and the like for sequential files to which records are being added can be accurately executed.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明の機能ブロック図、 第2図は本発明のプロセス処理の殿能ブロック図、 第3図は本発明のEOF管理機構の管理プロセスの機能
ブロック図である。 1・・・ファイル手段、 2・・・EOF管理プロセス手段、 3・・・READプロセス手段、 4・・・WRITEプロセス手段、
FIG. 1 is a functional block diagram of the present invention, FIG. 2 is a functional block diagram of the process processing of the present invention, and FIG. 3 is a functional block diagram of the management process of the EOF management mechanism of the present invention. 1... File means, 2... EOF management process means, 3... READ process means, 4... WRITE process means,

Claims (1)

【特許請求の範囲】 オープンしたファイルに対してレコードの追加及びレコ
ードの参照が可能なファイル手段(1)と、 End Of File(EOF)情報を前記ファイル
手段(1)とは別に管理する機構であって、READ処
理において順ファイルのオープン時に要求されたEOF
ポインタをREADプロセス手段(3)に与え、REA
Dプロセス手段(3)における順ファイルのREAD処
理を与える旧EOFを受信し、 前記READ処理中にWRITEプロセス手段(4)に
よるレコードの追加があるかどうかをチェックし、WR
ITEプロセスがある場合には、追加処理後に生成され
た新EOFポインタを取り順ファイルをオープンし前記
EOF管理プロセス手段(2)にEOFポインタを要求
し、EOFポインタ取得後前記ファイル手段(1)をア
クセスし、順ファイルのレコードの読み込み終了後、再
度EOFの取り直しがあるかどうかを前記EOF管理プ
ロセス手段(2)に要求し、EOFの取り直しがある場
合には新EOFまでREAD処理を続行するREADプ
ロセス手段(3)と、順ファイルをオープンし、順ファ
イルにレコードを追加した後、前記EOF管理プロセス
手段(2)にEOFポインタの更新を要求し、EOF管
理プロセス手段(2)からEOFの更新に対する完了の
メッセージを受信後、レコードの追加処理を続行するか
どうかを決定するWRITEプロセス手段(4)からな
り、同一順ファイルに対するレコードの追加とレコード
の参照とを混在することを特徴とする順ファイルの書込
み読出し制御方式。
[Claims] File means (1) capable of adding and referencing records to an opened file, and a mechanism that manages End Of File (EOF) information separately from the file means (1). EOF requested when opening a sequential file during READ processing.
Give the pointer to the READ process means (3) and
Receives the old EOF that provides READ processing for the sequential file in the D process means (3), checks whether or not a record is added by the WRITE process means (4) during the READ processing, and writes the WR
If there is an ITE process, it takes the new EOF pointer generated after the additional processing, opens a sequential file, requests the EOF pointer from the EOF management process means (2), and after acquiring the EOF pointer, the file means (1) READ which requests the EOF management process means (2) whether or not the EOF is to be retaken again after reading the records of the sequential file, and if the EOF is to be retaken, continues the READ process up to the new EOF. A process means (3) opens a sequential file, adds a record to the sequential file, requests the EOF management process means (2) to update the EOF pointer, and updates the EOF from the EOF management process means (2). A sequence comprising a WRITE process means (4) for determining whether or not to continue the record addition process after receiving a completion message for the sequence, and characterized in that record addition and record reference to the same sequential file are mixed. File write/read control method.
JP63205679A 1988-08-20 1988-08-20 Sequential file write / read control method Expired - Lifetime JPH0810442B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63205679A JPH0810442B2 (en) 1988-08-20 1988-08-20 Sequential file write / read control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63205679A JPH0810442B2 (en) 1988-08-20 1988-08-20 Sequential file write / read control method

Publications (2)

Publication Number Publication Date
JPH0256035A true JPH0256035A (en) 1990-02-26
JPH0810442B2 JPH0810442B2 (en) 1996-01-31

Family

ID=16510897

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63205679A Expired - Lifetime JPH0810442B2 (en) 1988-08-20 1988-08-20 Sequential file write / read control method

Country Status (1)

Country Link
JP (1) JPH0810442B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020160985A (en) * 2019-03-27 2020-10-01 日本電気株式会社 File encryption device, method and program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020160985A (en) * 2019-03-27 2020-10-01 日本電気株式会社 File encryption device, method and program

Also Published As

Publication number Publication date
JPH0810442B2 (en) 1996-01-31

Similar Documents

Publication Publication Date Title
EP0398494B1 (en) Maintenance of file attributes in a distributed data processing system
US6665675B1 (en) Shared file system having a token-ring style protocol for managing meta-data
US5454108A (en) Distributed lock manager using a passive, state-full control-server
US6341308B1 (en) Input/output device information management system for multi-computer system
JP3199718B2 (en) Cache coherency maintenance method
US6205466B1 (en) Infrastructure for an open digital services marketplace
US5890153A (en) Database lock control method
US8990954B2 (en) Distributed lock manager for file system objects in a shared file system
US6202132B1 (en) Flexible cache-coherency mechanism
CN114328018B (en) Snapshot creation method, computing device and storage medium
US7444349B1 (en) Control of concurrent access to a partitioned data file
CN115437798A (en) Data processing method, device, device and medium of shared memory
JPH07503567A (en) multiprocessor computer system
JPH0256035A (en) Write/read control system for sequential file
US6834281B1 (en) Method and apparatus to support multi-node direct access to file system data
JP2972548B2 (en) File management method
JP2830826B2 (en) Distributed file synchronization system and method
US7185029B1 (en) Method and apparatus for maintaining, and updating in-memory copies of the first and second pointers to reference the new versions of the first and second control structures that indicate available and allocated portions of usable space in the data file
JPH09293055A (en) System and method for exclusive control over shared file in loosely coupled multiple computer system, and medium for storing exclusive control program
JPH02263231A (en) Control system for program product
JP2735400B2 (en) Asynchronous I/O control method
JP3008500B2 (en) Update record reading mechanism
JPH0784921A (en) Network system
JP3050194B2 (en) A system for dynamically adding a shared memory file between hosts, a method for dynamically adding a shared memory file between hosts, and a recording medium storing a program for dynamically adding a shared memory file between hosts
CN120780642A (en) Inter-core communication method, device, robot and storage medium

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080131

Year of fee payment: 12

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

Free format text: PAYMENT UNTIL: 20090131

Year of fee payment: 13

EXPY Cancellation because of completion of term
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090131

Year of fee payment: 13