JP2000207229A - Resource occupancy management method - Google Patents
Resource occupancy management methodInfo
- Publication number
- JP2000207229A JP2000207229A JP11006090A JP609099A JP2000207229A JP 2000207229 A JP2000207229 A JP 2000207229A JP 11006090 A JP11006090 A JP 11006090A JP 609099 A JP609099 A JP 609099A JP 2000207229 A JP2000207229 A JP 2000207229A
- Authority
- JP
- Japan
- Prior art keywords
- resource
- macro
- occupied
- information table
- release
- 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
Abstract
(57)【要約】
【課題】同一の資源に対して異なるプロセスから異なる
マクロを用いて、資源を占有した場合においても、正し
く排他制御が実施され、プロセス終了時には異なるマク
ロを用いて占有した資源についても検索できる機能を提
供する。
【解決手段】複数のプロセス間で異なるマクロを使用し
て同一資源の排他制御を実施しても、その資源の排他制
御が正しく行われる。また、資源の占有情報が一元管理
されるため、プロセス終了時に、この情報を見ること
で、異なるマクロにより占有した資源においても解放漏
れを検知できる。
(57) [Summary] Even when resources are occupied using different macros from different processes for the same resource, exclusive control is correctly performed, and resources occupied using different macros at the end of the process Provide a function to search for Even if exclusive control of the same resource is performed using different macros among a plurality of processes, exclusive control of the resource is correctly performed. In addition, since resource occupation information is centrally managed, by viewing this information at the end of the process, release omission can be detected even for resources occupied by different macros.
Description
【0001】[0001]
【発明の属する技術分野】本発明は、資源占有の管理方
式に関し、マルチプロセス環境,プロセス間の資源の占
有処理のマクロを複数有する計算機システムにおいて、
異なるプロセスから異なるマクロを用いて同一の資源を
占有した場合においても正しく排他制御が実施されるこ
とを特徴とする資源占有の管理方式に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a resource occupancy management method, and more particularly to a multi-process environment and a computer system having a plurality of macros for occupying resources between processes.
The present invention relates to a resource occupancy management method characterized in that exclusive control is correctly performed even when the same resource is occupied by different macros from different processes.
【0002】[0002]
【従来の技術】従来、複数のプロセス間で排他制御を行
うためのマクロを発行する際、同一の資源に対して排他
制御を行う為には、プロセス間で同一のマクロを用いる
必要があった。本来、排他制御はそのマクロに依存する
ものではなく資源に依存するはずであるが、従来のシス
テムでは同一資源に対する排他制御は同一のマクロを使
用することがユーザに義務づけられている。2. Description of the Related Art Conventionally, when issuing a macro for performing exclusive control between a plurality of processes, it is necessary to use the same macro between processes in order to perform exclusive control on the same resource. . Originally, exclusive control should depend not on the macro but on the resource, but in a conventional system, exclusive control of the same resource requires the user to use the same macro.
【0003】そのため、同一の資源に対して互いに異な
る排他制御マクロを用いて排他制御したと解釈している
複数のプロセスがあった場合、正しく排他処理されずデ
ータが破壊される、あるいは正しく排他制御されないと
いう問題があった。また、プロセス終了時に資源の解放
漏れがあるかどうかは各マクロごとに管理情報が分散さ
れているため一括検索するのが困難で、ユーザに資源の
確保/解放を行うマクロが同一で、且つ必ず一対で行わ
れることと、占有する資源の管理も任されていた。For this reason, when there are a plurality of processes interpreting that exclusive control is performed on the same resource by using different exclusive control macros, exclusive processing is not performed correctly, data is destroyed, or exclusive control is performed incorrectly. There was a problem that was not. In addition, it is difficult to collectively search for whether or not there is a resource release omission at the end of the process because the management information is distributed for each macro. It was also in charge of the pair and the management of the resources they occupied.
【0004】[0004]
【発明が解決しようとする課題】1.プロセスがあるマ
クロによって資源占有する時、占有する資源が他のマク
ロによって占有されているかどうかの検証を行う手段を
提供する。[Problems to be Solved by the Invention] When a process occupies resources by one macro, it provides a means for verifying whether the occupied resources are occupied by other macros.
【0005】2.プロセスがあるマクロによって資源解
放する時、他のマクロによってその資源の占有を待って
いるプロセスに資源占有を可能にする手段を提供する。[0005] 2. When a process releases a resource by one macro, it provides a means for allowing a process waiting for the occupation of that resource by another macro to occupy the resource.
【0006】3.プロセスが発行した占有マクロに対し
て対とならない解放マクロによって同一の資源が解放さ
れた場合においても資源の解放が正常に行われることを
可能にする手段を提供する。[0006] 3. Provided is a means for enabling the resource to be released normally even when the same resource is released by a release macro that is not paired with the occupation macro issued by the process.
【0007】4.プロセス終了時に占有している資源が
あるかどうかを検索できる手段を提供する。[0007] 4. Provides a means to search for occupied resources at the end of the process.
【0008】[0008]
【課題を解決するための手段】本発明では上記課題を解
決する為に、占有される資源名称,資源を占有しようと
する占有マクロ、その占有マクロと対になる資源解放マ
クロ,占有プロセスID、その資源の占有を待つプロセ
スキューへのポインタを持つ資源情報テーブルを設け
る。また、資源の占有を待つプロセスのID,発行した
マクロ、次に資源を待つプロセスへのポインタを持つ待
ちプロセステーブルを設け、そのテーブルの線形リスト
で構成される待ちプロセスキューを設ける。資源の占有
マクロとそれと対となる解放マクロを定義した排他マク
ロリストを設ける。さらに、プロセスから発行されたマ
クロに対して、その処理をハンドリングするマクロハン
ドリング処理を設ける。According to the present invention, in order to solve the above-mentioned problems, an occupied resource name, an occupied macro for occupying a resource, a resource release macro paired with the occupied macro, an occupied process ID, A resource information table having a pointer to a process queue waiting for the occupation of the resource is provided. Further, a waiting process table having an ID of a process waiting for resource occupation, an issued macro, and a pointer to a process waiting for the next resource is provided, and a waiting process queue including a linear list of the table is provided. An exclusive macro list that defines a resource occupation macro and its corresponding release macro is provided. Further, a macro handling process for handling the macro issued from the process is provided.
【0009】[0009]
【発明の実施の形態】以下、本発明の実施の一形態を図
面に従って説明する。An embodiment of the present invention will be described below with reference to the drawings.
【0010】図1に本発明のテーブルの構成図を示す。
資源情報テーブル(100)には、資源名称,占有マク
ロ,解放マクロ,占有プロセスID,占有された資源を
待つプロセスキュー(102)へのポインタを持つ。待
ちプロセステーブル(101)は、待ちプロセスのID,
発行したマクロ,待ちプロセステーブルへのポインタを
持つ。待ちプロセスキュー(102)は、待ちプロセス
テーブルの線形リストで構成される。また、資源の占有
マクロとそれと対を成す資源の解放マクロを定義した排
他マクロリスト(103)を設定する。FIG. 1 shows the configuration of a table according to the present invention.
The resource information table (100) has a resource name, an occupied macro, a release macro, an occupied process ID, and a pointer to a process queue (102) waiting for the occupied resource. The waiting process table (101) stores the ID of the waiting process,
The issued macro has a pointer to the waiting process table. The waiting process queue (102) comprises a linear list of waiting process tables. Also, an exclusive macro list (103) is defined which defines a resource occupation macro and a resource release macro that is paired with the macro.
【0011】図2にマクロハンドリング処理を示す。プ
ロセスから発行されたマクロは、まずマクロハンドリン
グ処理にリンクされる。マクロハンドリング処理では排
他マクロリスト(103)を検索(200)し、発行さ
れたマクロが占有マクロか解放マクロか、あるいはその
他のマクロか判別する(201)。占有マクロの場合は
資源占有処理(202)を、解放マクロの場合は資源解
放処理(204)を、その他の場合は指定のマクロをそ
れぞれ実行する(203)。FIG. 2 shows a macro handling process. A macro issued from a process is first linked to a macro handling process. In the macro handling process, the exclusive macro list (103) is searched (200), and it is determined whether the issued macro is an occupied macro, a released macro, or another macro (201). In the case of the occupied macro, the resource occupancy processing (202) is executed, in the case of the release macro, the resource release processing (204) is executed, and in the other cases, the designated macro is executed (203).
【0012】図3に資源占有処理(202)を示す。本
処理では、最初に資源情報テーブルを検索する(30
0)。検索した結果、占有する資源が資源情報テーブル
にあるかどうか判定する(301)。占有する資源が資
源情報テーブルにない場合、資源情報テーブル(10
0)に資源名称,占有マクロ,占有プロセスIDを新規
に設定する(302)。次に排他マクロリスト(10
3)を検索し、対になる解放マクロを取得する(30
3)。取得した解放マクロを資源情報テーブル(100)
に設定し(304)、指定のマクロを実行する(30
5)。FIG. 3 shows the resource occupation process (202). In this process, first, the resource information table is searched (30).
0). As a result of the search, it is determined whether the occupied resource is in the resource information table (301). If the occupied resource is not in the resource information table, the resource information table (10
In 0), a resource name, occupied macro, and occupied process ID are newly set (302). Next, the exclusive macro list (10
3) to obtain a release macro to be paired (30)
3). The obtained release macro is stored in the resource information table (100).
Is set (304), and the designated macro is executed (30).
5).
【0013】一方、占有する資源が資源情報テーブルに
すでにある場合には、新たに待ちプロセステーブル(1
01)を作成する(306)。次に資源情報テーブル(1
00)から待ちプロセスキューに待ちプロセステーブル
があるかを検索する(307)。待ちプロセステーブルが
ある場合、待ちプロセスキュー(102)の最後尾に待
ちプロセステーブルをつなぐ(308)。このため、同
一資源に異なるマクロを用いて排他制御を行っても、正
しく排他処理される。On the other hand, if the resource to be occupied already exists in the resource information table, a new waiting process table (1) is newly added.
01) is created (306). Next, the resource information table (1
From (00), a search is made as to whether there is a waiting process table in the waiting process queue (307). If there is a waiting process table, the waiting process table is connected to the end of the waiting process queue (102) (308). Therefore, even when exclusive control is performed using different macros for the same resource, exclusive processing is performed correctly.
【0014】待ちプロセステーブルがない場合、作成し
た待ちプロセステーブルのアドレスを資源情報テーブル
(100)の待ちプロセスキューへのポインタに設定す
る(309)。If there is no waiting process table, the address of the created waiting process table is set as a pointer to the waiting process queue of the resource information table (100) (309).
【0015】図4に資源解放処理(204)を示す。資
源解放処理では、最初に資源情報テーブル(100)を
検索する(400)。検索の結果、占有する資源が資源
情報テーブル(100)にあるかどうかを判定する(4
01)。占有する資源が資源情報テーブル(100)に
ある場合、資源情報テーブル(100)にある占有プロ
セスIDが解放を要求したプロセスと同一かどうか判定
する(402)。占有する資源が資源情報テーブル(1
00)にない場合、占有していない資源を解放しようと
したのでエラーとする(403)。また、占有プロセス
IDが不一致の場合は、占有プロセス以外のプロセスが
不当に資源の解放を要求しているのでエラーとする(4
03)。FIG. 4 shows the resource release processing (204). In the resource release processing, first, the resource information table (100) is searched (400). As a result of the search, it is determined whether the occupied resource is in the resource information table (100) (4.
01). If the occupied resource is in the resource information table (100), it is determined whether or not the occupied process ID in the resource information table (100) is the same as the process that has requested the release (402). The occupied resource is the resource information table (1
00), an attempt is made to release an unoccupied resource, and an error occurs (403). If the occupied process IDs do not match, an error occurs because a process other than the occupied process has unduly requested the release of resources (4).
03).
【0016】プロセスIDが一致の場合、資源情報テー
ブル(100)から解放マクロを取得し(404)その
マクロを実行する(405)。このため、プロセスから
対になっていないマクロで解放要求が行われた場合にお
いても資源の解放が正しく行われる。If the process IDs match, a release macro is obtained from the resource information table (100) (404) and the macro is executed (405). Therefore, even when a release request is issued from a process using a macro that is not paired, the release of resources is performed correctly.
【0017】次に資源情報テーブル(100)に待ちプ
ロセスキュー(102)があるか検索する(406)。
待ちプロセスキュー(102)がある場合、待ちプロセ
スキュー(102)の先頭にある待ちプロセステーブル
を取得する(407)。資源情報テーブル(100)の
待ちプロセスキューへのポインタにNext ポインタを設
定する(408)。次に、待ちプロセスキューの先頭に
ある待ちプロセステーブルを削除する(409)。次
に、待ちプロセスキュー(102)に待ちプロセステー
ブル(101)がまだ残っているかを調べる(41
0)。待ちプロセスキュー(102)が空の場合は、そ
の資源を占有するプロセスがなくすべて解放されている
ので、資源情報テーブル(100)から資源名称,占有
マクロ,解放マクロ,占有プロセスID,待ちプロセス
キューへのポインタを削除する(411)。また、資源情
報テーブルに待ち行列がない場合も同様となる。Next, it is searched (406) whether there is a waiting process queue (102) in the resource information table (100).
If there is a waiting process queue (102), a waiting process table at the head of the waiting process queue (102) is acquired (407). A Next pointer is set as a pointer to the waiting process queue in the resource information table (100) (408). Next, the waiting process table at the head of the waiting process queue is deleted (409). Next, it is checked whether the waiting process table (101) still remains in the waiting process queue (102) (41).
0). When the waiting process queue (102) is empty, there is no process occupying the resource and all the resources are released. The pointer to is deleted (411). The same applies when there is no queue in the resource information table.
【0018】一方、待ちプロセスキュー(102)にま
だ待ちプロセステーブル(101)がある場合は、(4
07)で取得した待ちプロセステーブルの発行マクロ
を、資源情報テーブル(100)の占有マクロに、待ちプ
ロセスIDを占有プロセスIDに設定する(412)。
次に、排他マクロリスト(103)を検索し、対になる
解放マクロを資源情報テーブルに設定する(413)。
最後に待ちプロセスの発行マクロを実行する(41
4)。これにより、複数のプロセスが、互いに異なるマ
クロを用いて同一の資源を占有しようとした場合におい
ても、正しく排他制御が行われる。また、資源情報テー
ブルが参照すれば、どのプロセスがどのマクロを用いて
資源の占有を待っているかがわかる。On the other hand, if there is still a waiting process table (101) in the waiting process queue (102), (4)
In step 412, the issuing macro of the waiting process table acquired in step 07) is set to the occupied macro of the resource information table 100, and the waiting process ID is set to the occupied process ID.
Next, the exclusive macro list (103) is searched, and a pair of released macros is set in the resource information table (413).
Finally, the issuing macro of the waiting process is executed (41).
4). As a result, even when a plurality of processes try to occupy the same resource using different macros, exclusive control is performed correctly. Further, by referring to the resource information table, it is possible to know which process is using which macro and is waiting for the occupation of the resource.
【0019】図5にプロセス終了処理における資源情報
テーブルチェック処理を示す。プロセス終了時に資源情
報テーブルを参照し占有プロセスIDが終了しようとす
るプロセスIDと一致するかどうか検索する(50
0)。一致する場合は、資源の解放漏れがあるため、警
告メッセージを出力する(501)。FIG. 5 shows a resource information table check process in the process end process. At the end of the process, the resource information table is referenced to search whether the occupied process ID matches the process ID to be terminated (50).
0). If they match, a warning message is output because there is no release of resources (501).
【0020】[0020]
【発明の効果】本発明によれば、 1.複数のプロセス間で異なるマクロを使用して同一資
源の排他制御を実施しても、その資源の排他制御が正し
く行われる。According to the present invention, there are provided: Even if exclusive control of the same resource is performed using different macros among a plurality of processes, exclusive control of the resource is correctly performed.
【0021】2.資源の占有情報が一元管理されるた
め、資源の占有情報が一括収集できる。 3.プロセス終了時に占有プロセスのIDを検索するこ
とにより、資源の解放漏れのあるプロセスを検出でき
る。2. Since the resource occupation information is centrally managed, the resource occupation information can be collectively collected. 3. By retrieving the ID of the occupied process at the end of the process, it is possible to detect a process that has omission of resources.
【0022】4.ユーザが「マクロ+資源」を管理して
行わなければならなかった排他制御がマクロに依存しな
くなり、「資源」のみを管理するだけでよくなる。4. The exclusive control that the user has to perform by managing “macro + resource” does not depend on the macro, and only the “resource” needs to be managed.
【図1】本発明の資源情報テーブル,待ちプロセステー
ブル,待ちプロセスキュー,排他マクロリストの構成及
び相関を示した図である。FIG. 1 is a diagram showing the configuration and correlation of a resource information table, a waiting process table, a waiting process queue, and an exclusive macro list according to the present invention.
【図2】マクロハンドリング処理順を示したフローチャ
ートである。FIG. 2 is a flowchart showing a macro handling processing order.
【図3】資源占有処理順を示したフローチャートであ
る。FIG. 3 is a flowchart showing a resource occupation processing order.
【図4】資源解放処理順を示したフローチャートであ
る。FIG. 4 is a flowchart showing a resource release processing order.
【図5】資源情報テーブルチェック処理順を示したフロ
ーチャートである。FIG. 5 is a flowchart showing a resource information table check processing order;
100…資源情報テーブル、101…待ちプロセステー
ブル、102…待ちプロセスキュー、103…排他マク
ロリスト、104…マクロハンドリング処理、105…
資源情報テーブルチェック処理。100: Resource information table, 101: Waiting process table, 102: Waiting process queue, 103: Exclusive macro list, 104: Macro handling process, 105 ...
Resource information table check processing.
───────────────────────────────────────────────────── フロントページの続き (72)発明者 大柴 正義 茨城県日立市大みか町五丁目2番1号 株 式会社日立製作所大みか工場内 Fターム(参考) 5B098 GA04 GB05 GB13 GD15 GD22 ────────────────────────────────────────────────── ─── Continuing on the front page (72) Inventor Masayoshi Oshiba 5-2-1 Omika-cho, Hitachi City, Ibaraki Prefecture F-term in the Omika Plant of Hitachi, Ltd. F-term (reference) 5B098 GA04 GB05 GB13 GD15 GD22
Claims (3)
の占有/解放処理を有するマクロが複数ある計算機シス
テムに対する資源占有の管理方式において、主記憶装置
上に資源名称,占有マクロとそれに対応する解放マク
ロ,占有プロセスID,待ちプロセスキューへのポイン
タを構造に持つ資源情報テーブルを持ち、次にその資源
の占有を待っているプロセスID,発行したマクロ、そ
の次に資源の占有を待つプロセスへのポインタを構造に
持つ待ちプロセステーブルと、待ちプロセステーブルの
線形結合でFIFOを構成する待ちプロセスキューを持
ち、資源の占有マクロとそのマクロと対を成す資源の解
放マクロのリストを定義した排他マクロリストを持ち、
プロセスから発行されたマクロに対して、その処理をハ
ンドリングするマクロハンドリング処理を持ち、異なる
マクロによって発行された資源の占有/解放のマクロに
ついても同一の資源に対する占有であれば排他制御を行
うことを特徴とする資源占有の管理方式。In a multi-process environment, in a resource occupation management method for a computer system having a plurality of macros having a process of occupying / releasing resources between processes, a resource name, an occupied macro and a corresponding release on a main storage device are provided. It has a resource information table having a macro, an occupied process ID, and a pointer to a waiting process queue in a structure. An exclusive macro list having a waiting process table having a pointer in a structure and a waiting process queue forming a FIFO by a linear combination of the waiting process table, and defining a list of a resource occupation macro and a resource release macro paired with the macro. Have
It is necessary to have a macro handling process for handling the macro issued from the process, and to perform exclusive control for the macro occupation / release of the resource issued / issued by a different macro if the macro is occupied by the same resource. Characteristic resource occupancy management method.
異なるマクロにおいても請求項1の資源情報テーブルに
よってプロセスが占有している資源の情報が容易に検索
できることを特徴とする資源占有の管理方式。2. The resource occupancy management system according to claim 1,
2. A resource occupancy management method, wherein information on resources occupied by a process can be easily searched for by using the resource information table of claim 1 even in different macros.
プロセスが終了する際に実行されるプロセス終了処理に
資源情報テーブルチェック処理を設け、資源情報テーブ
ルから占有プロセスIDを検索することにより、プロセ
ス終了時に資源解放漏れのあるプロセスを確認できるこ
とを特徴とする資源占有の管理方式。3. The resource occupancy management system according to claim 1,
A resource information table check process is provided in the process termination process executed when the process is terminated, and a process having a resource release omission at the end of the process can be confirmed by retrieving the occupied process ID from the resource information table. Resource occupancy management method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP11006090A JP2000207229A (en) | 1999-01-13 | 1999-01-13 | Resource occupancy management method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP11006090A JP2000207229A (en) | 1999-01-13 | 1999-01-13 | Resource occupancy management method |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2000207229A true JP2000207229A (en) | 2000-07-28 |
Family
ID=11628838
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP11006090A Pending JP2000207229A (en) | 1999-01-13 | 1999-01-13 | Resource occupancy management method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2000207229A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008500633A (en) * | 2004-06-03 | 2008-01-10 | インテル・コーポレーション | Thread synchronization method and apparatus in managed runtime environment |
JP2010061230A (en) * | 2008-09-01 | 2010-03-18 | Canon Inc | Information processor and information processing method |
-
1999
- 1999-01-13 JP JP11006090A patent/JP2000207229A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008500633A (en) * | 2004-06-03 | 2008-01-10 | インテル・コーポレーション | Thread synchronization method and apparatus in managed runtime environment |
JP2010061230A (en) * | 2008-09-01 | 2010-03-18 | Canon Inc | Information processor and information processing method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US5745747A (en) | Method and system of lock request management in a data processing system having multiple processes per transaction | |
US8190857B2 (en) | Deleting a shared resource node after reserving its identifier in delete pending queue until deletion condition is met to allow continued access for currently accessing processor | |
US6189007B1 (en) | Method and apparatus for conducting a high performance locking facility in a loosely coupled environment | |
JPH1165863A (en) | Shared resource management method | |
JP3611295B2 (en) | Computer system, memory management method, and storage medium | |
US6185650B1 (en) | High performance locking facility | |
WO2024188050A1 (en) | File lock management method for distributed file system, and device and medium | |
US6088757A (en) | Computer program means and device for conducting high performance locking facility in a loosely coupled environment | |
US7069366B2 (en) | System and method for handling resource transaction requests | |
CN118069383A (en) | Deadlock detection method and related device | |
JP2000207229A (en) | Resource occupancy management method | |
CN111752715A (en) | System optimization method, device, device and storage medium under a large amount of requests | |
US20070088871A1 (en) | Implementation of shared and persistent job queues | |
CN111405015B (en) | Data processing method, device, equipment and storage medium | |
JP4238490B2 (en) | Database management method and system | |
US12367187B2 (en) | Distributed database locking | |
JPH09330240A (en) | Exclusive resource control system | |
JP3473394B2 (en) | Apparatus and method for controlling resource sharing between hosts and recording medium | |
CN116360966A (en) | Method, device and readable storage medium for accessing shared resource | |
JPH012149A (en) | Log information collection control method | |
CN118656393A (en) | Multi-user data security management method, device, equipment and medium based on DPU | |
KR100486854B1 (en) | System and Mothod Messaging order based global concurrency control in multidatabase systems | |
JPS63104146A (en) | resource management system | |
JPH0675837A (en) | Memory file access system | |
JPH09330239A (en) | Exclusive control method |