JPS6242245A - File access method - Google Patents

File access method

Info

Publication number
JPS6242245A
JPS6242245A JP60181988A JP18198885A JPS6242245A JP S6242245 A JPS6242245 A JP S6242245A JP 60181988 A JP60181988 A JP 60181988A JP 18198885 A JP18198885 A JP 18198885A JP S6242245 A JPS6242245 A JP S6242245A
Authority
JP
Japan
Prior art keywords
file
access
request
file access
access request
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
Application number
JP60181988A
Other languages
Japanese (ja)
Inventor
Rie Tanaka
理恵 田中
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP60181988A priority Critical patent/JPS6242245A/en
Publication of JPS6242245A publication Critical patent/JPS6242245A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To give the priority to an access request whose processing is desired at an early state by carrying out the control for each access together with the priority and giving the access preferentially to the process to which the early execution is desired. CONSTITUTION:When an access request 5 is given to a file 1 via a process B3, a lock mechanism 4 gives the permission 6 to the process B3 since no other access request is given to the file 1. Then an access request 8 is delivered via a process A2 during the access of the process B3. Thus the mechanism 4 knows the access mode of the process B3 and accepts the request of the process A2 to wait 8 until the process B3 is unlocked. The mechanism 4 gives the access permission 11 to the process A2 even if an access request 10 is delivered as soon as the process B3 is unlocked since the process A2 has the request of higher priority. Thus the process B3 has to wait 12 until the process A2 is unlocked.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 この発明は同時に複数のプログラム処理を行う電子計算
機におけるファイルアクセス方法、時に同一ファイルに
対する複数のアクセス要求がある場合のファイルアクセ
ス方法に関するものである。
[Detailed Description of the Invention] [Field of Industrial Application] This invention relates to a file access method in a computer that processes multiple programs simultaneously, and a file access method when there are sometimes multiple access requests to the same file. .

〔従来の技術〕[Conventional technology]

CQ出版社発行の雑誌「インターフェース41985年
7月498号のp、259〜p、261に従来のファイ
ルアクセス方法が記述されている。従来の方法によれば
アクセス要求を出したプログラムはアクセス要求を出す
と同時にファイル占有処理(ロック処理)を行い、アク
セスが終了した時点でアンロック処理を行う。ファイル
があるアクセス要求を処理するためにロックされてしま
うとアクセス要求を出した箇所からのアンロック処理が
行われないかぎり別のプログラムがそのファイルに対し
て処理を行うことはできないのでそのファイルがアンロ
ックされるまで待つことになる。
The conventional file access method is described in the magazine "Interface 4, July 1985, issue 498, pp. 259-p. 261, published by CQ Publishing. According to the conventional method, the program that issued the access request is File exclusive processing (lock processing) is performed at the same time as the access is completed, and unlock processing is performed when the access is completed.If a file is locked to process a certain access request, it will be unlocked from the point where the access request was issued. Unless the process is performed, another program cannot process the file, so the program must wait until the file is unlocked.

従来のファイルアクセス方法は以上の処理により行われ
る。第3図〜第5図はこのような処理の流れを示すフロ
ーチャート図である。第3図はフアイルがロックされる
場合の処理を示す図で、ロックされたファイルは必ずP
CBリストに登録され〔この処理全図中(14)で示す
〕、そのロック・タスクID領域にロックを発行したタ
スク(すなわちプログラム)のID(識別符号)がセッ
トされる〔この処理を図中(15)で示す〕。第4図は
別のタスクによってロックされているファイルに対して
書込みを行う場合のアンロック待ちの様子を示すフロー
チャート図でお夕、タスクの待ち状態は事象フラグによ
って実現されている。ファイルがロックされると事象フ
ラグが1つ割当てられ〔この処理を第3図中(16)で
示す〕、そのフラグはリセットされる。ファイルにロッ
クをかけたタスク以外のタスクから書込み処理の要求が
くるとファイルに割当てられた事象フラグのセットを待
つ“〔この処理を第4図中(17)で示す〕。
The conventional file access method is performed through the above processing. FIGS. 3 to 5 are flowcharts showing the flow of such processing. Figure 3 shows the process when a file is locked.
The ID (identification code) of the task (i.e. program) that issued the lock is set in the lock/task ID area [this process is shown as (14) in the figure]. (15)]. FIG. 4 is a flowchart showing the state of waiting for unlocking when writing to a file that is locked by another task.The waiting state of a task is realized by an event flag. When a file is locked, an event flag is assigned (this process is shown at (16) in FIG. 3), and that flag is reset. When a request for write processing comes from a task other than the task that has locked the file, it waits for the event flag assigned to the file to be set (this process is shown at (17) in FIG. 4).

第5図はファイルのアンロックを行う場合の処理を示す
図で、事象フラグのセット〔図中(15)で示す〕はフ
ァイルがアンロックされたときに行われる。これによっ
て対象ファイルの更新を行おうとしていたタスクはウェ
イト状態〔第4図中(19)で示す〕から解放される。
FIG. 5 is a diagram showing the process when a file is unlocked, and the event flag is set (indicated by (15) in the figure) when the file is unlocked. As a result, the task that was attempting to update the target file is released from the wait state [indicated by (19) in FIG. 4].

〔発明が解決しようとする間鴎点〕[The problem that the invention attempts to solve]

従来のファイルアクセス方法は、以上のような処理によ
り行われるから早く処理が必要なアクセス要求に対して
も他の処理のためファイルロックにより早く処理が行え
ないという問題があった。
Conventional file access methods have the problem that even access requests that require quick processing cannot be processed quickly due to file locking due to other processing.

この発明は上記のような問題点を解消するためになされ
たもので、早く処理を行いたいアクセス要求は処理ヲ攪
先的に行うことを可能にする方法を得ることを目的とし
ている。
The present invention has been made to solve the above-mentioned problems, and aims to provide a method that allows access requests to be processed quickly to be processed in advance.

〔問題点t−S決するための手段〕[Means for resolving issues]

この発明に係るファイルアクセス方法は従来はファイル
単位に行っていたアクセスの制御をアクセス単位で行い
、かつ優先順位をもうけ早く実行したい処理に対するア
クセスを優先的に処理するようにしたものである。
The file access method according to the present invention performs access control on an access basis instead of conventionally on a file-by-file basis, and also establishes a priority order so that accesses to processes that are desired to be executed quickly are processed preferentially.

〔作用〕[Effect]

この発明においてはロック機能が処理の優先順位順にロ
ックを受けつけ、現在の処理によるロックが解除(アン
ロック)された場合、その時点でロック要求の出ている
処理のうち一番優先順位の高い処理に対するロックの要
求を受けるので早く処理したいものを優先的に処理でき
る。
In this invention, the lock function accepts locks in order of priority of processes, and when the lock by the current process is released (unlocked), the process with the highest priority among the processes issuing a lock request at that time Since requests for locks are received, tasks that need to be processed quickly can be processed with priority.

〔発明の実施例〕[Embodiments of the invention]

以下、この発明の実施例を図について説明する。 Embodiments of the present invention will be described below with reference to the drawings.

第1図は、この発明によるファイルアクセス方法の一実
施例を示すブロック図で、(1)はファイル、(2)は
処理A、!31は処理B、+4)はロック機構である。
FIG. 1 is a block diagram showing an embodiment of the file access method according to the present invention, in which (1) is a file, (2) is a process A, ! 31 is processing B, and +4) is a locking mechanism.

なお、ファイル(1)にアクセス許可求する処理A(2
)と、処理B(3)とでは優先順位は処理A(2)の方
が大きいものとする。
Note that processing A(2) requests permission to access file (1).
) and process B(3), process A(2) has a higher priority.

次にこの発明の動作について説明する。第2図は、この
発明の動作を示すブロック図で第1図と同一符号は同一
部分を示し、+51#i処理B(3)による最初のアク
セス要求、(6)はアクセス要求(5)に対する許可、
(7)は処理A(2)によるアクセス要求、(81はア
クセス要求(7)の処理待ち、(9)は処理B(3)に
よるロックの解除要求、(10)は処理B(31iCよ
る新たなアクセス要求、(11)l′iアクセス要求(
7)に対する許可%(12)はアクセス要求(1o)の
処理待ち、(13)は処理A(2)によるロックの解除
要求である。
Next, the operation of this invention will be explained. FIG. 2 is a block diagram showing the operation of the present invention, in which the same reference numerals as in FIG. 1 indicate the same parts. permission,
(7) is an access request by process A (2), (81 is waiting for access request (7) to be processed, (9) is a lock release request by process B (3), and (10) is a new request by process B (31iC). access request, (11) l'i access request (
Permission % (12) for 7) is waiting for access request (1o) to be processed, and (13) is a lock release request by process A (2).

最初に処理B(3)によりファイル(1)に対しアクセ
ス要求(5)がくる場合、ロック機構(4)ではこのフ
ァイルに対する他のアクセス要求はないので処理B(3
)に対し許可(6)を出す。次に、処理B(3)のアク
セス中に処理A(2)によりアクセス要求(8)が来る
と、ロック機$11[4)では処理B(3)によるアク
セス中であることを知り処理A(2)の要求を受は処理
B(3)がアンロックするのを待つ(8)。処理B(3
)がアンロック(9)を行うと同時にアクセス要求(1
0) k出しても、ロック機構(4)では処理A(2)
による保水の方が優先順位が高いので処理A(2)に対
してアクセス許可(11)を出し、処理B(3)の方は
処理AUIがアンロック(13)するまで待つ(12)
ことになる。以上のようにして処理による優先11位に
したがってファイルに対するアクセスが許可されること
になる。
When an access request (5) is first received for file (1) by process B(3), there is no other access request for this file in locking mechanism (4), so process B(3)
) to issue permission (6). Next, when an access request (8) is received by process A(2) while process B(3) is accessing, the lock machine $11[4] knows that process B(3) is accessing and requests process A. Upon receiving the request (2), the process waits for processing B (3) to unlock (8). Processing B (3
) performs unlocking (9) and at the same time requests access (1).
0) Even if k is released, the lock mechanism (4) performs processing A (2)
Water retention has a higher priority, so issue access permission (11) to process A (2), and process B (3) wait until the process AUI is unlocked (13) (12).
It turns out. As described above, access to files is permitted according to the 11th priority of processing.

なお、上記実施例では処理が2つの場合にズ(j して
説明したが処理が2以上の場合であっても同様に行うこ
とができる。
In the above embodiment, the explanation has been given for the case where there are two processes, but the same procedure can be performed even when there are two or more processes.

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

この発明は以上説明したとおり処理による優先順位によ
りファイルに対するアクセスが行えるから早く行わなけ
ればならない処理に対しては優先して処理を行うことが
できるという効果がある。
As explained above, the present invention has the effect that files can be accessed according to the priority order of processing, so that processing that must be performed quickly can be performed with priority.

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

第1図はこの発明によるファイルアクセス方法の一実施
例を示すブロック図、第2図はこの発明の動作を示すブ
ロック図、第3〜第5図は従来の方法による処理の流れ
を示すフローチャート図である。 図において(1)はファイル、(2)は処理A、+31
は処理B、[4)はロック機構、15)は処理BKよる
アクセス要求、(6)は処理Bに対するアクセス許可、
(7)は処理Aによるアクセス要求、(8)は処理Aの
待ち、(9)は処理Bによる解除要求、(10)は処理
Bによるアクセス要求、1t)h処理人に対するアクセ
ス許可、(12)は処理Bの待ち、(13)は処理Aに
よる解除要求である。 尚、各図中同一符号は同−又は相当部分を示す。 大岩増雄 第1図 第2図 莞3図 手続補正書 (自発) 特許庁長官殿                   
   nl、事件の表示   特願昭 60−1819
88号2・発明の名称   ファイルアクセス方法3、
補正をする者 代表者 志 岐 守 哉 4、代理人 6、補正の内容 (1)明細書の特許請求の範囲を別紙のとおり訂正する
。 (2)明細書第2頁第2行「におけるファイルアクセス
方法、時に」とあるを「において、同時に」と訂正する
。 7、添付書類の目録 (1)訂正した特許請求の範囲 ・・・・・・・・−・
・・・・・・・ 1通C以上) 別紙 2、特許請求の範囲 (1)同時に複数のプログラム処理を行う電子計算機で
同一ファイルに対し複数の処理プログラムからファイル
アクセスの要求がある場合のファイルアクセス方法にお
いて、上記ファイルアクセスの要求のあった複数の処理
プログラムから12の処理プログラムに対してだけファ
イルアクセスの許可を与えることを特徴とするファイル
アクセス方法。 (2)複数の処理プログラムからファイルアクセスの要
求がある場合に各ファイルアクセス要求に対し優先順位
を設定する段階と、アクセス要求の対象であるファイル
がアンロックされた時上記優先順位に従ってファイルア
クセスの許可を与える段階とを備えたことを特徴とする
特許請求の範囲第1項記載のファイルアクセス方法。
FIG. 1 is a block diagram showing an embodiment of the file access method according to the present invention, FIG. 2 is a block diagram showing the operation of the present invention, and FIGS. 3 to 5 are flowcharts showing the flow of processing according to the conventional method. It is. In the figure, (1) is the file, (2) is the process A, +31
is process B, [4) is the lock mechanism, 15) is an access request by process BK, (6) is access permission for process B,
(7) is an access request by process A, (8) is waiting for process A, (9) is a cancellation request by process B, (10) is an access request by process B, 1t) h is access permission for the processor, (12 ) is a wait for process B, and (13) is a release request by process A. Note that the same reference numerals in each figure indicate the same or corresponding parts. Masuo Oiwa, Figure 1, Figure 2, Figure 3, Procedure Amendment (Voluntary) To the Commissioner of the Japan Patent Office
nl, case display patent application Sho 60-1819
No. 88 2. Name of the invention File access method 3.
Representative of the person making the amendment: Moriya Shiki (4), Attorney (6), Contents of the amendment (1) The scope of claims in the specification will be corrected as shown in the attached sheet. (2) In the second line of page 2 of the specification, the phrase "File access method, sometimes" is corrected to "at the same time." 7. List of attached documents (1) Revised scope of patent claims
...... 1 copy C or more) Attachment 2, Claims (1) Files when there are file access requests from multiple processing programs for the same file in a computer that processes multiple programs at the same time A file access method characterized in that file access permission is granted only to 12 processing programs from among the plurality of processing programs that have requested the file access. (2) When there are file access requests from multiple processing programs, a step in which priorities are set for each file access request, and when a file that is the target of an access request is unlocked, file access is performed according to the above priority order. 2. The file access method according to claim 1, further comprising the step of granting permission.

Claims (2)

【特許請求の範囲】[Claims] (1)同時に複数のプログラム処理を行う電子計算機で
同一ファイルに対し複数の処理プログラムからファイル
アクセスの要求がある場合のファイルアクセス方法にお
いて、上記ファイルアクセスの要求のあった複数の処理
プログラムから1の処理プログラムに対してだけファイ
ルアクセスの許可を与えることを特徴とするファイルア
クセス方法。
(1) In a file access method when there are file access requests from multiple processing programs for the same file in a computer that processes multiple programs at the same time, one A file access method characterized by granting file access permission only to a processing program.
(2)複数の処理プログラムからファイルアクセスの要
求がある場合に各ファイルアクセス要求に対し優先順位
を設定する段階と、アクセス要求の対象であるファイル
がアンロックされた時上記優先順位に従ってファイルア
クセスの許可を与える段階とを備えたことを特徴とする
特許請求の範囲第1項記載のファイルアクセス方法。
(2) When there are file access requests from multiple processing programs, a step in which priorities are set for each file access request, and when a file that is the target of an access request is unlocked, file access is performed according to the above priority order. 2. The file access method according to claim 1, further comprising the step of granting permission.
JP60181988A 1985-08-19 1985-08-19 File access method Pending JPS6242245A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60181988A JPS6242245A (en) 1985-08-19 1985-08-19 File access method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60181988A JPS6242245A (en) 1985-08-19 1985-08-19 File access method

Publications (1)

Publication Number Publication Date
JPS6242245A true JPS6242245A (en) 1987-02-24

Family

ID=16110359

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60181988A Pending JPS6242245A (en) 1985-08-19 1985-08-19 File access method

Country Status (1)

Country Link
JP (1) JPS6242245A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02226343A (en) * 1988-12-30 1990-09-07 Internatl Business Mach Corp <Ibm> Computer apparatus and determination of preference

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02226343A (en) * 1988-12-30 1990-09-07 Internatl Business Mach Corp <Ibm> Computer apparatus and determination of preference

Similar Documents

Publication Publication Date Title
US4791554A (en) Method and apparatus for preventing deadlock in a data base management system
JP2574991B2 (en) Method for locking shared resources in a process in a computer system and computer system
US7281050B2 (en) Distributed token manager with transactional properties
US6138120A (en) System for sharing server sessions across multiple clients
US20030131041A1 (en) System and method for coordinating access to data for a distributed application
US7100161B2 (en) Method and apparatus for resource access synchronization
US20050235289A1 (en) Method for allocating resources in a hierarchical data processing system
JPH11327931A (en) Method and device for performing semaphore operation
JPH01188965A (en) Data processing
JPH02195453A (en) File access control system
JPS63109541A (en) Data reference control
JPH0728679A (en) Locking system of checkin/checkout model
JPH1115793A (en) Protection method for resource maintainability
JPH05274241A (en) Method and device for discriminating equivalence of objects
US6105050A (en) System for resource lock/unlock capability in multithreaded computer environment
US6507861B1 (en) System and method for avoiding deadlock in a non-preemptive multi-threaded application running in a non-preemptive multi-tasking environment
JPS6242245A (en) File access method
US20060212450A1 (en) Temporary master thread
JPH01209561A (en) Security managing system
JPS6320634A (en) Exclusive control system for computer resource
JPH03235130A (en) Exclusive priority control system
Valencia An overview of the VSTa microkernel
JPS63159949A (en) File access method
JPS63201723A (en) Automatic addition processing system for password at the time of generating job
JPH08137923A (en) Design data managing system for cad system