JPH07120333B2 - Shared data management method - Google Patents

Shared data management method

Info

Publication number
JPH07120333B2
JPH07120333B2 JP60280914A JP28091485A JPH07120333B2 JP H07120333 B2 JPH07120333 B2 JP H07120333B2 JP 60280914 A JP60280914 A JP 60280914A JP 28091485 A JP28091485 A JP 28091485A JP H07120333 B2 JPH07120333 B2 JP H07120333B2
Authority
JP
Japan
Prior art keywords
lock
mode
request
manager
lock 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.)
Expired - Lifetime
Application number
JP60280914A
Other languages
Japanese (ja)
Other versions
JPS62140159A (en
Inventor
山本  彰
淳 新田
通 西垣
弘行 北嶋
茂 米田
昭 倉野
孝史 住吉
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP60280914A priority Critical patent/JPH07120333B2/en
Publication of JPS62140159A publication Critical patent/JPS62140159A/en
Publication of JPH07120333B2 publication Critical patent/JPH07120333B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Memory System (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Multi Processors (AREA)

Description

【発明の詳細な説明】 〔発明の利用分野〕 本発明は、ロツク方式に関し、特にCPU間ファイル共用
時のロック方式に関するものである。
Description: FIELD OF THE INVENTION The present invention relates to a lock system, and more particularly to a lock system for sharing files between CPUs.

〔発明の背景〕[Background of the Invention]

CPU間のフアイルを共有するシステムは、ますます増加
する傾向にあり、共用フアイルを管理するセネラル・ロ
ツク・マネージヤの処理性能は重要となる。一般にある
データの集合ロック管理を行うロック・マネージャは1
つでないとデータのコンシステンシィ(一貫性)が保て
なくなるため、CPU間でデータベースを共用した場合に
もあるデータの集合に対するロック・マネージャは1つ
にする必要がある(なお、管理するデータの集合が異な
れば、マネージャは異なっていてもよい)。ロック要求
を発行するユーザ・タスク群は、複数個の各CPUに存在
するため、ロック・マネージャをどのハードウェア(あ
る特定の1つのCPU(1)、あるいは、I/O系の制御装置
(2)など)に設けても、異なったハードウェア(ロッ
ク要求が存在しているCPUとロック・マネージャが存在
しているハードウェア)間で通信が発生する(ただし、
データの集合がある特定の1つのCPU上のユーザ・タス
クにしかアクセスされない場合を除く、しかし、この場
合は、CPU間でデータが共用されていないことになるた
め、考慮の対象外としてよい)。この時、各CPUでユー
ザ・タスクのロック要求を受け付け、これをロック・マ
ネージャに送るプログラムをローカル・ロック・マネー
ジャと呼び、前述の共用データのロック管理を行うロッ
ク・マネージャをグローバル化ロック・マネージャと呼
ぶ。ローカル・ロック・マネージャとグローバル・ロッ
ク・マネージャ間の通信コストは、ハードウェアが異な
る場合が多いため、従来のデータベース共用を行わない
システムに比べ、非常に大きくなる。
The system that shares files between CPUs tends to increase more and more, and the processing performance of the general lock manager that manages the shared files becomes important. Generally, there is one lock manager that manages a set lock of certain data.
Otherwise, the consistency of the data cannot be maintained, so even if the database is shared between CPUs, there must be one lock manager for the set of data (however, the data to be managed Managers may be different for different sets of). Since a user task group that issues a lock request exists in each of a plurality of CPUs, the lock manager can be used to determine which hardware (a specific CPU (1) or an I / O control device (2). ) Etc.), communication occurs between different hardware (CPU with lock request and hardware with lock manager) (however,
Except when a set of data is accessed only by a user task on one particular CPU, but in this case, since the data is not shared between CPUs, it may be excluded from consideration.) . At this time, the program that accepts the lock request of the user task in each CPU and sends it to the lock manager is called the local lock manager. The lock manager that manages the lock of the shared data described above is the globalized lock manager. Call. The communication costs between the local lock manager and the global lock manager are often much higher than in conventional systems that do not share databases, because the hardware is often different.

インデクスの様にアクセス頻度の高いデータの場合、ロ
ックの単位は細くしないと、多重度が上がらない。通常
のロック単位は、ページ(主記憶とI/O側との転送単
位)で行われるため、n段のインデクスの場合n回のロ
ック要求が発行されるため、マネージャ間の通信がn回
発生することになる。この通信コストは、非常に大きく
なるため、何らかの対策を考える必要がある。
In the case of data with high access frequency such as an index, unless the lock unit is made thin, the multiplicity cannot be increased. A normal lock unit is a page (transfer unit between the main memory and the I / O side), so in the case of an n-stage index, lock requests are issued n times, so communication between managers occurs n times. Will be done. Since this communication cost becomes very large, it is necessary to consider some measures.

〔発明の目的〕[Object of the Invention]

本発明の目的は、このような従来の問題を解決し、CPU
間データベース共用時において、ロック・マネージャ間
の通信回数を減らし、通信コストを低減できるロック方
式を提供することにある。
The object of the present invention is to solve such conventional problems,
An object of the present invention is to provide a lock method capable of reducing the communication cost between lock managers and reducing the communication cost when the databases are shared.

〔発明の概要〕[Outline of Invention]

上記目的を達成するために、本発明では、共用されるデ
ータのロック管理を集中して行うゼネラル・ロック・マ
ネージャと、複数グループのユーザ・タスク・グループ
に対応して設けられるローカル・ロック・マネージャを
設け、任意のロックモードがかけられているデータに対
する別のロック・モードの獲得が認められるロックモー
ドを選択して、ある任意のロック資源に対するモードの
ロック獲得、開放要求を行う場合、ゼネラル・ロック・
マネージャに送ることなく、その要求をユーザ・タスク
・グループの中のタスクから直接受取ったローカル・ロ
ック・マネージャ内で処理することに特徴がある。
In order to achieve the above object, according to the present invention, a general lock manager that centrally manages locks of shared data and a local lock manager provided corresponding to a plurality of user task groups are provided. When a lock mode that allows acquisition of another lock mode for data to which an arbitrary lock mode is applied is selected and a mode lock acquisition and release request for a certain lock resource is made, Lock·
It is characterized by processing the request in the local lock manager that receives it directly from the tasks in the user task group without sending it to the manager.

〔発明の実施例〕Example of Invention

以下、本発明の原理と実施例を、図面により詳細を説明
する。
Hereinafter, the principle and embodiments of the present invention will be described in detail with reference to the drawings.

まず、本発明の原理的な説明をする。First, the principle of the present invention will be described.

通常、ロックのモードは、コンカレンシィを上げるため
何種類か用意されているが、アクセスの内容(参照,更
新,追加,削除)により用いられるロック・モードが決
められている(ロック・プロトコル)。このような時、
あるデータに対して非常に高い確率でかけられるロック
・モードが存在し、しかもそのモードがそのモード自身
と共存可能(ロック・モードをaとした時、あるユーザ
・タスクがモードaでデータにロックをかけている時、
別のユーザ・タスクが同一データに対してモードaでロ
ックをかけようとした時、アクセス権が認められるよう
なモード)であれば、デフォールト・モードとして、そ
のデータには、それ以外のロック・モードをかける要求
がない場合には、常にそのモードのロックがかけられて
いるようにする方法が考えられる。これにより、ユーザ
・タスクがデフォールト・モードのロック要求を発行し
た場合には、グローバル・ロック・マネージャとローカ
ル・ロック・マネージャとの通信が必要なくなり、マネ
ージャ間の通信回数を減らすことができる。
Normally, several types of lock modes are prepared to increase concurrency, but the lock mode used is determined by the contents of access (reference, update, add, delete) (lock protocol). At this time,
There is a lock mode that can be applied to certain data with a very high probability, and that mode can coexist with the mode itself (when the lock mode is set to a, a user task locks data in mode a). When you are wearing
If another user task tries to lock the same data in mode a, the access right is granted.) If there is no request to set a mode, it is possible to always lock the mode. This eliminates the need for communication between the global lock manager and the local lock manager when the user task issues a lock request in the default mode, and the number of communication between managers can be reduced.

このロック方式を以下、デフォールト・モード・ロック
方式と呼ぶが、この方式はCPU間データベース方式をサ
ポートするハードウェア構成だけに限らず、他の構成に
も有効であるため、適用範囲が広いと考えられる。
This locking method is called the default mode locking method in the following.However, this method is effective not only for hardware configurations that support the CPU-to-CPU database method but also for other configurations, so it is considered to have a wide range of applications. To be

データの一貫性を保つためには、一般に同一のデータ集
合に対するロック管理を一ヶ所に集中させる必要があ
る。
In order to maintain data consistency, it is generally necessary to centralize lock management for the same set of data in one place.

第5図は、CPU間でデータを共有する計算機システムの
構成図である。
FIG. 5 is a block diagram of a computer system that shares data between CPUs.

この場合、データを使用する処理要求が各CPU50上に存
在し、共用データを統合的に管理する機構がいずれかに
設けられる。これは、既存設置でもよい。第1図は、こ
のような場合のロック管理システムのソフトウェア構成
図である。
In this case, a processing request that uses data exists on each CPU 50, and a mechanism for integrally managing shared data is provided in any of them. This may be an existing installation. FIG. 1 is a software configuration diagram of the lock management system in such a case.

本発明は、ハード構成を限定する必要がないため、以
下、特に明確なハード構成を意識しないものとする。
In the present invention, it is not necessary to limit the hardware configuration, and hence it is not particularly conscious of a clear hardware configuration.

グローバル・ロック・マネージャ(以下、GLMと略す)1
0は、共用データのロック管理を集中的に行う。一方、
各ローカル・ロック・マネージャ(以下、LLLMという)
11は、それぞれ対応したユーザ・タスク群12からロック
要求を受け付け、これをGLM10に伝える。
Global Lock Manager (abbreviated as GLM below) 1
0 centrally manages locks on shared data. on the other hand,
Each local lock manager (hereinafter referred to as LLLM)
11 receives the lock request from the corresponding user task group 12 and transmits this to the GLM 10.

LLM11は対応したユーザタスク群12からロック要求を受
ける。
The LLM 11 receives the lock request from the corresponding user task group 12.

第1図に示すように、LLM11とユーザ・タスク群12のペ
アは2個以上任意数存在する。GLMと各LLMの通信は公知
の手段で行われる。ユーザ・タスク群12とLLM11の場合
も同様である。この場合、ユーザ・タスク群12とLLM11
は同一CPU上にあると考えてよい。GLM10は、どの装置上
にあるかを限定しない(あるいは新たに装置を設けても
よい)。また、GLM10と各LLM11については、一般には異
なった装置上にあるとするが、別にその様には限定しな
い。しかし、本発明が効果を発揮するためには、ユーザ
・タスク群12と対応するLLM11の通信コストに比べ、複
数ペアのGLM10と各LLM11の間の通信コストの中で、少く
とも一組のGLM10とLLM11の通信コストが高くなる必要が
ある。例えば、GLM10とある1つのLLM11の間の通信コス
トが、ユーザタスク群12とLLM11の通信コストに比較し
て大きければ、GLM10と他のLLM11の通信コストは大きく
なくともよい。ただし、GLM10とLLM11のすべてのペアの
通信コストが大きい方が本発明の効果を大きい。
As shown in FIG. 1, there are two or more arbitrary pairs of LLM 11 and user task group 12. Communication between the GLM and each LLM is performed by known means. The same applies to the user task group 12 and the LLM 11. In this case, user task group 12 and LLM11
Can be considered to be on the same CPU. The GLM 10 does not limit on which device it is (or a new device may be provided). Further, the GLM 10 and each LLM 11 are generally assumed to be on different devices, but they are not limited to such. However, in order to exert the effect of the present invention, in comparison with the communication cost of the LLM 11 corresponding to the user task group 12, at least one set of GLM 10 in the communication cost between the plurality of pairs of GLM 10 and each LLM 11. And the communication cost of LLM11 needs to be high. For example, if the communication cost between the GLM 10 and one LLM 11 is larger than the communication cost between the user task group 12 and the LLM 11, the communication cost between the GLM 10 and another LLM 11 does not have to be large. However, the effect of the present invention is greater when the communication cost of all pairs of GLM10 and LLM11 is higher.

一般に、ロックのモードは複数個存在し、これらのロッ
ク・モードの間には、共存関係が2値論理関数として定
義される。これは、あるユーザ・タスクがあるロック単
位に対してモードaでロックをかけている時に、別のユ
ーザ・タスクがモードbでロックをかけようとした時
に、後者のロックが認められるかどうかを2値論理で表
したものである。ロックが認められれば、bはaに対し
てコンパチブルであると呼ぶ。ここでは、これを関数と
して以下のように表す。
In general, there are a plurality of lock modes, and the coexistence relationship between these lock modes is defined as a binary logic function. This means whether one user task locks a lock unit in mode a, while another user task attempts to lock in mode b, the latter lock is allowed. It is expressed by binary logic. If the lock is recognized, b is said to be compatible with a. Here, this is expressed as a function as follows.

コンパチブルな場合:COMPAT(b,a)=true コンパチブルでない場合:COMPAT(b,a)=false (COMPAT(a,a)の関数も定義される)COMPAT(a,b)≠
COMPAT(b,a)でもよい。例えば、ロック・モードbが
かかっている時にロック・モードaをかけることは認め
られても、逆の場合が認められないような関数を定義し
てもよい。COMPAT(a,b)=COMPAT(b,a)=trueのと
き、aとbは互いにコンパチブルであるという。ロック
・モードaとロック・モードbに関して、次の2つの条
件式、COMPAT(r,a)=trueとなるすべてのロック・モ
ードrに対してCOMPAT(r,b)=(true)(1)、およ
び、 COMPAT(a,s)=trueとなるすべてのロック・モードs
に対してCOMPAT(b,s)=true (2) の両者が成立するとき、ロック・モードbはロック・モ
ードaより、より排他的でないという。
When compatible: COMPAT (b, a) = true When not compatible: COMPAT (b, a) = false (function of COMPAT (a, a) is also defined) COMPAT (a, b) ≠
COMPAT (b, a) may be used. For example, a function may be defined such that lock mode a is allowed to be applied when lock mode b is applied, but the opposite case is not allowed. When COMPAT (a, b) = COMPAT (b, a) = true, a and b are said to be compatible with each other. Regarding lock mode a and lock mode b, COMPAT (r, b) = (true) (1) for the following two conditional expressions, COMPAT (r, a) = true for all lock modes r , And all lock modes s with COMPAT (a, s) = true
On the other hand, when both COMPAT (b, s) = true (2) are satisfied, lock mode b is said to be less exclusive than lock mode a.

本発明は、データのロック管理を集中的に行うGLM10と
各LLM11の間の通信回数を減らすために、あるロック・
モードを定め、以下、このモードをロック・モードaと
するが、ロック・モードa以外のロック・モードをかけ
ようとしているロック要求が存在しない場合には、デフ
ォルト・モードとして常にロック・モードaがかけられ
ているように、ロック管理を行う方式に関するものであ
る。この時、次式が成立すれば本発明により、以下に示
すような効果が得られる。
In order to reduce the number of communication between the GLM 10 and each LLM 11 that centrally manages the lock of data, the present invention provides a lock
A mode is defined, and this mode is hereinafter referred to as a lock mode a. However, if there is no lock request to apply a lock mode other than the lock mode a, the lock mode a is always the default mode. As mentioned above, the present invention relates to a method for managing locks. At this time, the following effects can be obtained by the present invention if the following equation is satisfied.

COMPAT(a,a)=true モードa以外のロックがかけられていない場合には、ロ
ック・モードaがかけられていることとなり、かつ、モ
ードaどうしのロックはコンパチブルであるので、モー
ドaのアクセス権は、必ず、認められることになる。従
って、ユーザ・タスク群からロック・モードaのロック
獲得を受け取った時、LLM11はGLM10に通信することな
く、アクセス権を認めてもよいということになる。同様
の理由により、開放要求もGLM10に伝えなくてもよくな
る。これにより、LLM11とGLM10の通信回数を減らすこと
ができる。
COMPAT (a, a) = true If a lock other than mode a is not applied, it means that lock mode a is applied, and the locks between modes a are compatible. Access will always be granted. Therefore, when the lock acquisition of the lock mode a is received from the user task group, the LLM 11 may grant the access right without communicating with the GLM 10. For the same reason, the release request does not have to be transmitted to GLM10. As a result, the number of times of communication between the LLM11 and GLM10 can be reduced.

さらに、ロックの獲得・開放通知をGLM10まで、伝えな
くてもよくなるのは、ロック・モードaだけでなくな
り、より排他的でないモードの集合、すなわち、すべて
のロック・モードの集合のうち、ロック・モードaに対
して(1),(2)式を満たすロック・モードの集合に
属するモードのロックの獲得・開放通知の場合にも適用
できる。ここで、すべてのロック・モードの集合をX、
aより、より排他的でないロック・モードの集合をYと
する。Yに属するロック・モードの獲得・開放要求をGL
M10に伝えなくともよくなるのは、これらのロック・モ
ードと同等、あるいは、より排他的なモードであるロッ
ク・モードaかデフォールト・モードとしてかかってい
るとするためである(aがYの中に含まれることに注意
されたい)。
Further, it is not only the lock mode a that needs to notify the GLM10 of the lock acquisition / release notification, and the lock mode a is a set of less exclusive modes, that is, the lock mode of all lock modes. The present invention can also be applied to the case of the lock acquisition / release notification of the mode belonging to the set of lock modes that satisfy the expressions (1) and (2) for the mode a. Where X is the set of all lock modes
Let Y be the set of less exclusive lock modes than a. GL for lock mode acquisition / release requests belonging to Y
The reason why it is not necessary to inform M10 is that it is in lock mode a, which is equivalent to or more exclusive of these lock modes, or is in the default mode (a is in Y). Note that it is included).

一方、集合X−Y(全体のモードの集合からYに属する
モードの集合を除いたもの)に属するモードの場合、他
のLLMに対してロック要求を発行しているユーザ・タス
ク群の中のタスクのロック要求とのコンパチビリティを
チェックする必要があるため、GLM10までロック要求通
知を伝えなければならない。
On the other hand, in the case of the mode belonging to the set XY (the set of all modes excluding the set of modes belonging to Y), among the user task groups issuing the lock request to another LLM Since it is necessary to check the compatibility of the task with the lock request, the lock request notification must be sent to GLM10.

GLM10は、集合X−Yに属するモードのロック要求のみ
受け取る。この場合、GLM10は受け取ったロック要求の
モードが次式を満たすかどうかで要求を分類する必要が
ある。受け取ったロック要求のモードをbとする。
The GLM 10 receives only lock requests in modes belonging to the set XY. In this case, the GLM 10 needs to classify the request according to whether the mode of the received lock request satisfies the following equation. The mode of the received lock request is b.

COMPAT(b,a)=true and COMPAT(a,b)=true (3) 以下、分類の必要性について述べる。(3)式を満たさ
ないロック・モードの場合は、集合Yに属するロック・
モードと互いにコンパチブルではない。従って、この場
合、このロック要求を認めるためには、モードaのロッ
ク要求がすべて開放されることが必要であったり(COMP
AT(b,a)=falseの場合)、このロック要求を認めた後
は、開放が行われるまで、モードaのロック要求を受け
入れなくなる(COMPAT(a,b)=falseの場合)ため、こ
の様なロック要求が発行された後からは、各LLMは対応
するユーザ・タスク群から集合Yに属するモードのロッ
ク要求を無条件に認めることはできなくなる。
COMPAT (b, a) = true and COMPAT (a, b) = true (3) The necessity of classification is described below. If the lock mode does not satisfy the expression (3), the lock modes belonging to the set Y
Not compatible with modes. Therefore, in this case, in order to acknowledge this lock request, it is necessary to release all the lock requests in mode a (COMP
AT (b, a) = false), after accepting this lock request, it will not accept the lock request of mode a (when COMPAT (a, b) = false) until it is released. After such a lock request is issued, each LLM cannot unconditionally accept the lock request of the mode belonging to the set Y from the corresponding user task group.

従って、GLM10は、(3)式を満たさないモードのロッ
ク要求を受け取った場合、この旨をすべてのLLMに通知
する必要がある。(3)式を満たさない集合をZとす
る。(1),(2),(3)式より次式が成立する。
Therefore, when the GLM 10 receives the lock request in the mode that does not satisfy the expression (3), it needs to notify all the LLMs to that effect. Let Z be a set that does not satisfy equation (3). From equations (1), (2), and (3), the following equation holds.

Y∩Z=φ(φ:空集合) (4) (3)式を満たす場合、すなわち、X−Y−Zに属する
モードのロック要求の場合は、集合Yに属するモードの
ロック要求とはコンパチブルであるため、各LLM11で受
け付けている集合にするモードのロック要求の処理要求
の考慮をせずに、集合X−Yに属するロック要求、すな
わち、各LLM11からGLM10に送られてくるロック要求だけ
を考慮してアクセス権の有無を判定できる。
Y∩Z = φ (φ: empty set) (4) When the expressions (3) are satisfied, that is, in the case of the lock request of the mode belonging to XYZ, it is compatible with the lock request of the mode belonging to set Y. Therefore, only the lock requests belonging to the set XY, that is, only the lock requests sent from each LLM11 to the GLM10 are taken into consideration without considering the processing request of the lock request in the set mode accepted by each LLM11. The presence or absence of the access right can be determined in consideration of.

以上により、各ロックのモードの集合ごとのロック獲
得,開放方法をまとめると、次のようになる。
From the above, the lock acquisition and release methods for each set of lock modes are summarized as follows.

集合Yに属するモードのロック要求の場合 :そのロック要求を受け付けたLLMが受け付けた場合集
合Yに属するモードを持つ他のロック要求とすべてのLL
Mが受け付けた集合Zに属するモードのロック要求を考
慮してロックの獲得を認めればよい。従って、すべての
LLM11が受け付けた集合Zに属するモードのロック獲
得,開放要求をGLM10の経由で受け付ければ、ロック要
求を受け付けたLLM11内でロック獲得要求が認められる
かどうかを判別することができる。また、開放要求も要
求を受け付けたLLM11だけで処理することができる。
In the case of a lock request of a mode belonging to set Y: When the LLM that receives the lock request accepts another lock request having a mode belonging to set Y and all LLs
The acquisition of the lock may be permitted in consideration of the lock request of the mode belonging to the set Z accepted by M. Therefore, all
If the lock acquisition / release request of the mode belonging to the set Z received by the LLM 11 is received via the GLM 10, it is possible to determine whether the lock acquisition request is accepted in the LLM 11 that has received the lock request. Further, the release request can be processed only by the LLM 11 that has accepted the request.

集合X−Y−Zに属するモードのロック要求の場合:こ
の場合GLM10で集合X−Yに属するモードのロック要求
の集合を考えればよいことになる。
In the case of a lock request in a mode belonging to the set XYZ: In this case, it is sufficient to consider a set of lock requests in a mode belonging to the set XY in the GLM 10.

集合Zに属するモードのロック要求の場合:この場合は
すべてのロック要求を考慮して、アクセス権を認めなけ
ればならない。今、各LLMにはそのLLMが受け付けに集合
Yに属するモードのロック要求の情報とすべてのLLMが
受け付けた集合Zに属するモードのロック要求の情報が
集められることになる。一方、GLM10には、すべてのLLM
から受け付けた集合X−Yに属するモードのロック情報
が集められていることになる。従って、集合Zに属する
モードのロック要求の場合、すべてのLLMにおいてアク
セス権が認められ、かつ、GLM10において集合X−Yに
属するモードのロック情報に関しても、アクセス権が認
められた場合に、アクセス権を認めればよいことにな
る。このため、GLM10は、集合Zに属するモードのロッ
ク獲得要求,開放要求を受け取った時、これをすべての
LLM11に通知する。
For lock requests in modes belonging to set Z: In this case all access requests must be considered and the access rights granted. Now, each LLM collects the information of the lock request of the mode belonging to the set Y that the LLM accepts and the information of the lock request of the mode belonging to the set Z accepted by all the LLMs. On the other hand, GLM10 has all LLM
It means that the lock information of the modes belonging to the set XY received from is collected. Therefore, in the case of the lock request of the mode belonging to the set Z, the access right is granted to all the LLMs, and the access information is also granted to the lock information of the mode belonging to the set XY in the GLM10. You just have to acknowledge the right. Therefore, when the GLM10 receives the lock acquisition request and the release request for the modes belonging to the set Z, it sends all the requests.
Notify LLM11.

以上は、ユーザ・タスク群12の中のユーザ・タスクがロ
ックの対象となる資源にロックをかけていない状態から
ロック獲得要求を発行した場合、および、ロックを獲得
している状態からこれを開放し、獲得していない状態に
する場合である。これ以外に、すでに獲得しているモー
ドを変更する場合がある。これは、従来保持しているロ
ック・モードの開放と新たに要求したモードの獲得が同
時に処理されることになる。ただし、この場合、新たに
変更を要求したモードが獲得されるまでは、従来保持し
ていたモードを開放しない。新たなモードが獲得される
のは、自分以外の現在そのロック資源を確保しているす
べてのユーザ・タスク群12の中のタスクのモードとコン
パチブルになった時である。モードの変更を自由に認め
るとロック資源が1つしかない場合にもデッド・ロック
が発生する可能性がある。さらに、ロック処理を計る目
的であるシリアライザビイリティ(処理要求の集合を並
行的に実行した時のデータの更新,参照結果が処理要求
をある順番に直列に実行していったとき、複数組ある順
番の付け方のうち、どれかある1つの順番の付け方で実
行していった時の結果と等しくなること)が保証されな
い場合がある。前者(同一資源内のデット・ロック)
は、その資源だけに着目すればよいため、簡単なチェッ
ク・アルゴリズムで発見可能であるが、発生した後のデ
ットロック解消処理がデフォールト,モード・ロック方
式の場合複雑になる。本発明では、この場合の解消処理
を直接対象としないため、モード変換による同一資源内
のデットロックは起きないものとして以下の話を進め
る。後者の場合も、直接本発明の対象とならないため、
シリアライザビィリティを保証しないようなモードの変
更は行なわれないものとする。
The above is when a user task in the user task group 12 issues a lock acquisition request from a state in which the resource to be locked is not locked and when the lock is acquired from the lock acquisition state. However, it is a case where the state is not acquired. Other than this, you may change the mode you have already acquired. This means that the release of the lock mode which is conventionally held and the acquisition of the newly requested mode are simultaneously processed. However, in this case, the mode that has been conventionally held is not released until the mode that newly requests the change is acquired. The new mode is acquired when it becomes compatible with the modes of the tasks in all the user task groups 12 other than the user currently having the lock resource. If the mode change is allowed freely, deadlock may occur even when there is only one lock resource. Furthermore, there are multiple sets when serialization abilities (the update of data when a set of processing requests are executed in parallel and the reference results are executed serially in a certain order), which is the purpose of measuring the locking process. There is no guarantee that the result will be the same as the result obtained by executing one of the ordering methods. The former (dead lock in the same resource)
Can be found by a simple check algorithm because only the resource needs to be focused on, but the deadlock elimination processing after the occurrence becomes complicated when the default mode lock method is used. In the present invention, since the resolution processing in this case is not directly targeted, the following discussion will be made on the assumption that deadlock in the same resource due to mode conversion does not occur. Also in the latter case, since it is not directly the subject of the present invention,
No mode changes shall be made that do not guarantee serializability.

次に、本発明の場合、モードの変更をどのロック・マネ
ージャで認めるかについて述べる。この場合も、モード
の集合をY,X−Y−Z,Zのグループに分けて考える。ま
ず、同一グループ内での変更であるが、これはロック獲
得要求を認める場合と同様である。すなわち、集合Yに
属するモード内での変更の場合は、直接要求を受け付け
たLLM11,集合X−Y−Zに属するモード内での変更の場
合、GLM10,集合Zに属するモード内での変更は、GLM1
0、および、すべてのLLM11において変更が認められた時
に、モードの変更を認める。
Next, in the case of the present invention, it will be described which lock manager allows the mode change. Also in this case, the set of modes is divided into Y, XYZ, and Z groups for consideration. First, regarding the change within the same group, this is similar to the case of granting a lock acquisition request. That is, in the case of the change in the mode belonging to the set Y, in the case of the change in the mode belonging to the LLM11, the set XYZ which directly receives the request, the change in the mode belonging to the GLM10, the set Z , GLM1
When 0 and all LLM11 changes are accepted, mode changes are accepted.

次に、グループ間の変更がある場合について述べる。Next, the case where there is a change between groups will be described.

Y→Z,X−Y−Z→Z,Z→Y,Z→X−Y−Zのモード変更
の場合:いずれの場合もモードZのロック要求の獲得、
あるいは、開放処理があるため、GLM10、および、すべ
てのLLM11での変更処理が完了した段階でモードの変更
が認められることになる。
When changing the mode of Y → Z, X−Y−Z → Z, Z → Y, Z → X−Y−Z: In any case, obtain the lock request of the mode Z,
Alternatively, since there is a release process, the mode change is allowed when the change process in the GLM 10 and all LLMs 11 is completed.

Y→X−Y−Z,X−Y−Z→Yのモードのモード変更の
場合:この場合、モード変更要求を直接受け付けたLLM1
1とGLM10のみにモード変更が関係するため、この部分で
モード変更処理が完結することになる。
In case of mode change of Y → X−Y−Z, X−Y−Z → Y mode: In this case, LLM1 which directly accepted the mode change request
Since the mode change is related only to 1 and GLM10, the mode change process is completed in this part.

通常、各ロック資源に関する各ユーザ・タスクの情報
は、ロック獲得要求時に作成され、開放時に消去される
ため、モード変更時には作成,消去は発生しないことに
なる。しかし、本発明の場合、モードによって、ロック
情報が保持されるロック・マネージャの集合が異なるた
め、変更前のロック情報を保持しているロック・マネー
ジャの集合と変更後ロック情報と保持すべきロック・マ
ネージャの集合が異なる場合がある。この場合、ロック
情報の作成消去が行われることになる。なお、モードの
変更処理中には、これらのロック情報は、両者の集合の
いずれにも持つようになる。
Normally, the information of each user task regarding each lock resource is created when a lock is requested and erased when the lock is released, so that creation or deletion does not occur when the mode is changed. However, in the case of the present invention, the set of lock managers holding the lock information differs depending on the mode. Therefore, the set of lock managers holding the lock information before the change, the lock information after the change, and the lock to be held -Managers may be in different groups. In this case, the lock information is created and deleted. During the mode changing process, the lock information is held in both sets.

通常、ロック・マネージャは受け付けにロック要求をFC
FS(First Come First Serbed)スケジューリングでア
クセス権を認めていくため、受け付けたロック獲得要求
を第2図に示すロック・キューの最後尾につないでゆ
く。従って、キューの先頭からコンパチブル・チェック
を行ない、アクセス権が認められる範囲が定められる。
すでに、アクセス権が認められているロック要求がモー
ドを変更した場合について述べる。この場合、変更が直
ちに認められる場合と、待ち状態に入いる場合がある。
待ち状態に入いる場合はすでに獲得しているロック・モ
ードを保有したまま待ち状態に入いることになる。ま
ず、モード変更要求を受け付けた時、すでに別のロック
要求が変更待ち状態になっている場合は、無条件に変更
待ち状態になることになる。この場合変更待ち状態にな
っている要求の最後尾にロック要求がつながれているも
のとする。変更待ち状態になっている要求がない場合に
は、変更後のモードが現在アクセス権を保有しているす
べてのロック要求のモードとのコンパチビリティ・チェ
ックを行い、アクセス権が認められれば、そのまま認め
られることになる。そうでない場合、現在、アクセス権
を認められているロック要求の最後尾にロック要求情報
を格納することになる。
Normally, the lock manager will FC
Since the access right is recognized by FS (First Come First Serbed) scheduling, the received lock acquisition request is connected to the end of the lock queue shown in FIG. Therefore, the compatible check is performed from the head of the queue, and the range in which the access right is granted is determined.
The case where a lock request that has already been granted the access right changes the mode will be described. In this case, the change may be accepted immediately, or the change may be in a waiting state.
If you are in the waiting state, you are in the waiting state while holding the lock mode you have already acquired. First, when a mode change request is accepted, if another lock request is already in the change waiting state, the state is unconditionally put in the change waiting state. In this case, it is assumed that the lock request is connected at the end of the requests in the change waiting state. If there is no request waiting for change, the changed mode performs compatibility check with all the lock request modes that currently have access rights, and if access rights are granted, it remains as is. Will be recognized. Otherwise, the lock request information will be stored at the end of the lock request for which the access right is currently granted.

以上、述べてきたキュー操作は、一般的なものである。
本発明の場合には、すでに述べたようにモードにより、
ロック情報が保持されるロック・マネージャが異なるた
め、モードの変換の際にロック情報をロック・キューに
登録することがある。この場合の登録位置は、一般的な
モード変更要求を受け付けた場合と同じ位置に登録され
る。
The queue operation described above is general.
In the case of the present invention, as described above, depending on the mode,
Since the lock manager that holds the lock information is different, the lock information may be registered in the lock queue during mode conversion. The registration position in this case is registered at the same position as when a general mode change request is received.

次に、本発明に関して、ロック・キューに登録されるロ
ック情報のフォーマットを示す。第3図は、各LLM11に
設けられるロック・キュー(以下、これをLLMキューと
呼ぶ)に登録される情報を示したものである。キュー後
ポインタ30,キュー前ポインタ31は、ロック情報をキュ
ー状につなぐためのポインタである。ロック・モード32
はこのロック要求のモードを示す。変更ロック・モード
33は、ロック・モードの変更後のモードである。ユーザ
・タスクiD34は、このロック要求を発行したユーザ・タ
スク群12の中のユーザタスクiDを示す。LLMiD35は、こ
の要求を、ユーザ・タスク群12の中のタスクから直接受
け付けたLLM11のiDである。アクセス状態36は、待ち状
態か変更待ち状態かアクセス中であるかを示す。
Next, regarding the present invention, the format of the lock information registered in the lock queue is shown. FIG. 3 shows information registered in a lock queue (hereinafter referred to as an LLM queue) provided in each LLM 11. The post-queue pointer 30 and the pre-queue pointer 31 are pointers for connecting lock information in a queue. Lock mode 32
Indicates the mode of this lock request. Change lock mode
33 is a mode after the lock mode is changed. The user task iD34 indicates the user task iD in the user task group 12 that issued this lock request. The LLMiD 35 is the iD of the LLM 11 that directly receives this request from the task in the user task group 12. The access state 36 indicates whether it is in a waiting state, a change waiting state, or during access.

第4図は、GLM10に作成されるロック・キュー(以下、
これをGLMキューと呼ぶ)に登録されるロック情報のフ
ォーマットを示す。キュー後ポインタ30,キュー前ポイ
ンタ31,ロック・モード32,変更ロック・モード33,ユー
ザタスクiD34,LLMiD35については、第3図に示したもの
と同様である。ただし、この場合、すでに述べたように
ロック・キューに登録されるのは、集合X−Yに属する
モードのロック要求である。GLMキュー・アクセス状態4
6は、このロック要求のGLMキューにおける状態を示す。
とられる状態については、第3図のアクセス状態34と同
様である。以下、LLM1キュー・アクセス状態47以降、す
べてのLLMキューにおけるアクセス状態が格納されるフ
ィールドである。
Figure 4 shows the lock queue created in GLM10 (hereinafter,
This is called GLM queue) and shows the format of the lock information registered. The post-queue pointer 30, pre-queue pointer 31, lock mode 32, change lock mode 33, user task iD34, and LLMiD35 are the same as those shown in FIG. However, in this case, it is the lock request of the mode belonging to the set XY that is registered in the lock queue as described above. GLM queue access status 4
6 shows the status of this lock request in the GLM queue.
The states that can be taken are the same as the access state 34 in FIG. The fields below store the access states of all LLM queues after the LLM1 queue access state 47.

GLM10,および、各LLMがこれらのロック情報をキューに
登録する際、キューのどの位置に登録するかというこ
と、および、ロック・モードの変更を要求を受け取った
時のキュー操作,開放要求を受け取った時のキュー操作
については、すでに述べたとおりである。次に、このキ
ュー操作をいつ行うかを述べる。
When the GLM10 and each LLM register these lock information in the queue, which position in the queue should be registered, and the queue operation and release request when the lock mode change request is received. The queue operation at the time of opening is as described above. Next, we will describe when to perform this queue operation.

集合Yに属するモードのロック要求の場合:ロック獲得
要求,モード変更要求,開放要求をユーザタスク群の中
のタスクから直接受け取ったLLMが、要求を受け取った
段階でキュー操作を行う。集合Yに属するモード内での
モード変更の場合も、同様である。
In the case of the lock request of the mode belonging to the set Y: The LLM that directly receives the lock acquisition request, the mode change request, and the release request from the tasks in the user task group performs the queue operation when the request is received. The same applies to the case of changing modes within the modes belonging to the set Y.

集合X−Y−Zに属するモードのロック要求の場合:こ
のモードのロック要求はLLMキューには登録されないた
め、ユーザ・タスクから直接要求を受け付けたLLMからG
LM10が要求を受け付けた段階で、GLMキューの操作を行
う。集合X−Y−Z内でのモード変更、X−Y−Z→Y,
Y→X−Y−Zのモード変更の場合も同様である。
In the case of a lock request of a mode belonging to the set XYZ: The lock request of this mode is not registered in the LLM queue.
When the LM10 receives the request, it operates the GLM queue. Mode change in set XYZ, XYZ → Y,
The same applies to the case of changing the mode from Y to XYZ.

集合Zに属するモードのロック要求の場合:このモード
のロック要求は、これを発行したユーザ・タスクからの
要求を直接受け取ったLLMのLLMキューにも登録されるこ
とになるが、LLMはユーザタスク群の中のタスクから要
求を受取った段階では、LLMキューには登録しない。集
合Zに属するモードのロック要求のロック情報はすべて
のLLMキュー、および、GLMキューに登録するが、これら
のロック要求に関する順序関係がすべてのキュー上で一
致しないと、デッド・ロックの発生の原因となる。従っ
て、ロック要求のキューへの登録は、GLM10がそのロッ
ク要求を受け取った段階でGLMキューへの登録を行うも
のとする。GLM10は、集合Zに属するモードのロック要
求のロック情報と、GLMキューに登録された順序どおり
にすべてのLLMに送信する。このモードのロック情報がL
LMキューに登録されるのは、ユーザ・タンク群の中のタ
スクから直接ロック要求を受け取ったLLMを含めて、GLM
10からロック情報を受け取った段階である。同様の理由
で解放要求に関するキュー操作も同じ段階で行われる。
さらに、Y→Z,Z→Y,X−Y−Z→Z,Z→X−Y−Z,Z内で
のモード変更要求の場合も同様である。
For a lock request of a mode belonging to set Z: The lock request of this mode is also registered in the LLM queue of the LLM that directly receives the request from the user task that issued it, but the LLM does not When a request is received from a task in the group, it will not be registered in the LLM queue. The lock information of the lock request of the mode belonging to the set Z is registered in all the LLM queues and the GLM queue, but if the order relation regarding these lock requests does not match on all the queues, the cause of the deadlock occurs. Becomes Therefore, the lock request is registered in the queue when the GLM 10 receives the lock request and is registered in the GLM queue. The GLM 10 transmits the lock information of the lock request of the mode belonging to the set Z and all the LLMs in the order registered in the GLM queue. Lock information for this mode is L
Registered in the LM queue is the GLM, including the LLM that receives the lock request directly from the task in the user tank group.
This is the stage when the lock information was received from 10. For the same reason, the queue operation regarding the release request is performed at the same stage.
Further, the same applies to a mode change request within Y → Z, Z → Y, XYZ → Z, Z → XYZ, Z.

次に、LLM11,および,GLM10の処理フロー図を示す。ただ
し、第6図に示すようにLLM11の場合、ユーザ要求受信
部(ユーザ・タンク群12からのロック要求を受け付ける
部分)60とGLM情報受信部(GLM10からのロック情報を受
け付ける部分)61にわけてフロー図を示す。本発明は、
あるロック単位に、モードZに属するモードのロック要
求が存在しない場合は、常にロック・モードaがかけら
れているように、取扱うロック方式に関する。この場
合、GLM10,LLM11が扱うすべてのロック単位にこのよう
なロック方式が適用されるのではなく、ユーザにより指
定された1部のロック単位に限られる。GLM10,LLM11は
あらかじめどのロック単位の集合にどんなデフォールト
・モードかけるかを把握しているものとする。ここで示
すフロー図は本発明に直接関係する部分、すなわち、デ
フォールト・ロック・モード方式が適用されるような
(デフォールト・モード=a)ロック要求の処理に関す
る部分のみを示す。それ以外の部分については、公知で
あるため、省略する。
Next, a processing flow chart of LLM11 and GLM10 is shown. However, as shown in FIG. 6, in the case of the LLM 11, it is divided into a user request receiving unit (a part that receives the lock request from the user tank group 12) 60 and a GLM information receiving unit (a part that receives the lock information from the GLM10) 61. Shows a flow chart. The present invention is
The present invention relates to a lock method for handling a lock unit such that the lock mode a is always applied when there is no lock request for a mode belonging to the mode Z in a certain lock unit. In this case, such a lock method is not applied to all the lock units handled by the GLM10 and LLM11, but is limited to a part of the lock units designated by the user. GLM10, LLM11 is assumed to know the what kind of default mode is applied to a set of pre-which locks unit. The flow diagram shown here shows only the part directly related to the present invention, that is, the part relating to the processing of the lock request to which the default lock mode method is applied (default mode = a). The other parts are publicly known and therefore omitted.

第7図は、LLM11のユーザ要求受信部60のフロー図を示
す。ステップ700ではこの要求がデフォールト・モード
を用いているロック単位に対するロック要求であるかを
チェックする。そうでない場合には、ステップ701へジ
ャンプし、通常のロック処理を行う。ステップ702で
は、このロック要求をGLM10へ送る必要があるが、すな
わち、このロック要求のロック・モードが集合Yに属す
るモードでないか、さらに、Y内でのモード変更要求で
ないかをチェックし、送る必要があれば、ステップ703
でこのロック要求をGLM10に送り、ステップ704ではユー
ザタスクには、これに対する応答が返るまでウェイト状
態に入るよう指示を出してこの処理を終了させる。次
に、Yに属するロックの獲得・開放,およびY内でのモ
ード変更要求の場合について述べる。この場合は、LLM
キューの操作を行う必要がある。次に、ステップ705で
ロック要求の内容を分離する。解放処理の場合、ステッ
プ706で解放処理を行い、解放が行なわれたことをステ
ップ707において、要求を発行したユーザ・タスク群12
の中のタスクに通知する。さらに、ステップ708におい
て、このロック要求の解放により、新たにロックの獲
得,モードの変更が認められるようになったロック要求
かどうかを調べる。集合Yに属するモード,およびY内
でのモード変更の場合には、ステップ709においてアク
セス権を認められるようになったすべてのユーザ・タス
ク群12の中のタスクにこの旨を通知する。一方、集合Z
に属するモードのロック要求,および,Zに関係したモー
ド変更要求の場合には、ステップ710において、これら
の要求をすべてGLM10に送る。さらに、ステップ711にお
いて、これら新たに、ロックの獲得権,モードの変更権
が認められるものの中に、モードY内での変更権が認め
られた要求があるかをチェックする。あれば、さらに、
この変更によって、ロックの獲得権、変更権が認められ
る可能性があるため、再び、ステップ708に至る。そう
でなければ、処理を終了する。
FIG. 7 shows a flow chart of the user request receiving unit 60 of the LLM 11. Step 700 checks if this request is a lock request for a lock unit using the default mode. If not, the process jumps to step 701 to perform a normal lock process. In step 702, this lock request needs to be sent to the GLM 10, that is, it is checked and sent whether the lock mode of this lock request is a mode belonging to the set Y or a mode change request in Y. If necessary, step 703
Then, this lock request is sent to the GLM 10, and in step 704 the user task is instructed to enter the wait state until a response to this is returned, and this processing is ended. Next, the case of acquiring / releasing a lock belonging to Y and requesting a mode change in Y will be described. In this case, LLM
It is necessary to operate the queue. Next, in step 705, the contents of the lock request are separated. In the case of release processing, the release processing is performed in step 706, and the release is performed in step 707. The user task group 12 that issued the request
Notify the tasks in. Further, in step 708, it is checked whether or not the lock request has been released so that the lock can be newly acquired and the mode can be changed. In the case of the mode belonging to the set Y and the mode change in the Y, the task in all the user task groups 12 that has been granted the access right in step 709 is notified of this. On the other hand, the set Z
In the case of a lock request for a mode belonging to the above, and a mode change request related to Z, all of these requests are sent to the GLM 10 in step 710. Further, in step 711, it is checked whether or not there is a request for which the change right in the mode Y is recognized among those newly granted the lock acquisition right and the mode change right. If there is,
Since the lock acquisition right and the change right may be granted by this change, the process goes to step 708 again. If not, the process ends.

次に、変更・獲得要求の場合、ステップ702において、
この変更・獲得が認められるかどうかのチェックと該当
するキュー操作を行う。認められなければ、ステップ71
3において、ユーザ・タスク群12の中の要求発行タスク
にウェイト状態に入るように指示を出して処理を終了さ
せる。認められた場合には、ステップ714において、こ
の旨をユーザ・タスク群12の中のタスクに通知する。さ
らに、ステップ715で認められた要求がロック獲得要求
か、モード変更要求かの判断を行い、モード変更が認め
られた場合、この変更によって新たにアクセス権が認め
られる要求があるかをチェックするため、ステップ708
にジャンプする。そうでなければ処理を終了させる。以
上でユーザ要求受信部60のフロー図の説明を終了する。
Next, in the case of a change / acquisition request, in step 702,
Check whether this change / acquisition is permitted and perform the corresponding queue operation. If not, step 71
In 3, the request issuing task in the user task group 12 is instructed to enter the wait state and the processing is ended. If so, the task in the user task group 12 is notified of this in step 714. Further, it is judged whether the request accepted in step 715 is a lock acquisition request or a mode change request, and if the mode change is accepted, it is checked whether or not there is a request for which the access right is newly granted by this change. , Step 708
Jump to. If not, the process ends. This is the end of the description of the flow chart of the user request receiving unit 60.

次に、GLM要求受信部61の処理フロー図を示す。ステッ
プ800では、この要求がデフォールト・モードのロック
単位かどうかのチェックを行う。そうでなければ、ステ
ップ801に飛び通常の処理を行う。デフォールト・モー
ドのロック単位の場合には、ステップ802において、こ
の要求がユーザ・タスク群12の中のタスクに対する応答
(アクセス権が認められたり、モード変更要求が認めら
れたり、開放要求が完了したという通知)であるか、集
合Zに属するロックの獲得,開放要求,および,Z内,Z→
X−Y−Z,X−Y−Z→Z,Y→Z,Z→Yのモード変更要求
であるかをチェックする。ユーザ・タスク群12の中のタ
スクの応答である場合は、ステップ803で、この旨を通
知する。そうでない場合は、ステップ804以下で、集合
Zに属するモードのロック要求,および,上で示したモ
ード変更要求の処理を行う。この処理内容は、基本的に
は、ユーザ要求受信部60で集合Yに属するモードのロッ
ク要求,および,Y内でのモード変更要求を受け付けた場
合の処理内容と同様である。異なる点は、ユーザ要求受
信部60の場合、受け付けたロック要求の結果を知らせる
相手がユーザ・タスク群12の中のタスクであったのに対
し、この場合はGLM10であるという点である。さらに、
ここでは、ロックの獲得,変更が認められなかった場合
には、GLM10には応答を返さず、後で認められた段階で
応答を返すことになる。
Next, a processing flow chart of the GLM request receiving unit 61 is shown. In step 800, a check is made to see if this request is a default mode lock unit. If not, the process jumps to step 801, and normal processing is performed. In the case of the lock unit in the default mode, in step 802, this request is a response to the task in the user task group 12 (access right is granted, mode change request is accepted, release request is completed). Or a request to release a lock belonging to the set Z, and a release request, and within Z, Z →
It is checked whether the request is a mode change request of XYZ, XYZ → Z, Y → Z, Z → Y. In the case of the response of the task in the user task group 12, this is notified in step 803. Otherwise, in step 804 and subsequent steps, the lock request for the mode belonging to the set Z and the mode change request described above are processed. This processing content is basically the same as the processing content when the user request receiving unit 60 receives a lock request for a mode belonging to the set Y and a mode change request within Y. The different point is that, in the case of the user request receiving unit 60, the other party who notifies the result of the received lock request is a task in the user task group 12, whereas in this case it is the GLM 10. further,
Here, if the lock is not acquired or changed, no response is returned to the GLM10, but a response is returned at a later-recognized stage.

次に、GLM10の処理フロー図を第9図に示す。ステップ9
00では、この要求がデフォールト・モードのロック単位
がどうかのチェックを行う。そうでなければ、ステップ
901に飛び通常の処理を行う。デフォールト・モードの
ロック単位の場合には、ステップ902において、受け取
った要求が、LLM11を経由して送られてきたユーザ・タ
スク群12の中のタスクからのロックの獲得,開放,変更
要求であるか、LLM11から送られてきたロック獲得の完
了,モード変更要求の完了,開放通知完了であるかをチ
ェックする。後者であれば、ステップ903ですべてのLLM
11,および,GLM10において、この処理が完了しているか
をチェックする。そうであれば、ステップ904におい
て、この完了通知の要求を発行したユーザ・タスク群12
の中のタスクに伝えるため、該当するLLM11に完了通知
を発行する。次に、ステップ905において、この完了が
開放処理,あるいは,モード変更処理であるかをチェッ
クし、そうであればこの完了によって、新たにロック獲
得,モード変更が認められるかをチェックするために、
ステップ916にジャンプする。
Next, a processing flow chart of GLM10 is shown in FIG. Step 9
At 00, this request checks if the lock unit is in default mode. Otherwise, step
Jump to 901 and perform normal processing. In the default mode lock unit, in step 902, the received request is a lock acquisition, release, or change request from a task in the user task group 12 sent via the LLM 11. It is also checked whether the lock acquisition sent from the LLM11 is complete, the mode change request is completed, and the release notification is completed. If the latter, in step 903 all LLMs
In 11, and GLM10, check if this process is completed. If so, in step 904, the user task group 12 that issued the request for completion notification
Issue a completion notice to the appropriate LLM11 to inform the task in. Next, in step 905, it is checked whether or not this completion is a release processing or a mode change processing, and if so, it is checked whether a new lock acquisition or mode change is permitted by this completion.
Jump to step 916.

次に、ユーザ・タスク群12のタスクから要求を受け付け
た場合について述べる。ステップ906において、この要
求が、集合Zに属するモードのロック獲得要求が開放要
求であるか、または、Y→Z,Z→Y,X−Y−Z→Y,Y→X
−Y−Z,Z内でのモードの変更要求であるかをチェック
する。ステップ907において、そうであれば、この要求
をすべてのLLM11に伝える。次に、ステップ908におい
て、この要求がロック獲得,モード変更要求通知である
かをチェックする。そうであれば、ステップ909におい
て、この要求がGLMキューにおいて、認められるかをチ
ェックして、この結果をGLMキューに記憶しておく。こ
の場合、また、LLM11からの完了通知が返ってこないた
め、要求が全体として認められることはない。開放要求
であれば、ステップ910において、GLMキューをサーチ
し、開放処理を受け付けたことを記憶する。(開放通知
の場合も同様の理由により、まだ、認められることな
い) 次に、集合X−Y−Zに属するモードのロック獲得要
求,開放要求,X−Y−Z→Y,Y→X−Y−Z,X−Y−Z内
でのモード変更要求を受け取った場合について述べる。
ステップ911で、ロック獲得要求,モード変更要求かを
調べる。(開放要求の場合、ステップ915へジャンプす
る。そうであれば、ステップ912において、この要求が
認められるかどうかをチェックする。認められない場合
はこれで処理を終える。認められれば、ステップ913に
おいて、これを要求を発信したユーザ・タスク群12のタ
スクにこの旨を通知するため、該当するLLM11にこれを
通知する。ステップ914においては、モード変更要求が
認められたのかをチェックし、そうであれば、ステップ
916へジャンプする。開放要求の場合には、ステップ915
において、この処理を行い、この旨を該当するLLM11に
通知する。以下、ステップ916において、これらの開放
処理,モードの変更により新たに、ロック獲得,モード
変更が認められた要求があるかどうかをチェックする。
GLM10だけでこれらの要求が認められれば、要求が認め
られる場合には、ステップ917において、この要求が認
められたことを該当するLLMにこれを通知する。次に、G
LM10だけでなく、すべてのLLM11で要求が認められる必
要がある場合には、ステップ918において、この字体と
満しているかどうかをチェックし、そうであれば、この
要求が認められたことを該当するLLM11に通知する。LLM
11に送った完了要求の中でモード変更要求があるかどう
かをステップ918で確認し、さらに、この完了によって
新たに完了が認められる要求があるかどうかをチェック
するために、ステップ916へジャンプし、そうでなけれ
ば、処理を終了する。
Next, the case where a request is received from the tasks of the user task group 12 will be described. In step 906, this request is a lock acquisition request of a mode belonging to the set Z, or a Y-> Z, Z-> Y, X-Y-Z-> Y, Y-> X request.
-Check whether the request is for a mode change within YZ, Z. If so, in step 907, pass this request to all LLMs 11. Next, in step 908, it is checked whether this request is a lock acquisition / mode change request notification. If so, in step 909 it is checked if the request is admitted in the GLM queue and the result is stored in the GLM queue. In this case, again, since the completion notice is not returned from the LLM11, the request cannot be accepted as a whole. If it is a release request, the GLM queue is searched in step 910, and the fact that the release process is accepted is stored. (In the case of the release notification, it is not recognized yet for the same reason.) Next, the lock acquisition request, the release request, XYZ → Y, Y → X- of the modes belonging to the set XYZ. A case where a mode change request in YY, XYZ is received will be described.
At step 911, it is checked whether the request is a lock acquisition request or a mode change request. (If it is a release request, jump to step 915. If so, in step 912, it is checked whether or not this request is accepted. If it is not authorized, the processing is ended. If it is accepted, in step 913. In order to notify the task of the user task group 12 that issued the request, this is notified to the corresponding LLM 11. In step 914, it is checked whether the mode change request is accepted, and Steps, if any
Jump to 916. In case of release request, step 915
Then, this process is performed and the LLM 11 is notified of this fact. Then, in step 916, it is checked whether or not there is a new request for lock acquisition and mode change due to the release processing and mode change.
If the GLM 10 alone grants these requests, then if the request is granted, then in step 917 the appropriate LLM is notified that this request was granted. Then G
If all LLM11s, not just LM10s, must accept the request, check in step 918 if they are satisfied with this font, and if so, check that the request has been granted. Notify LLM11. LLM
In step 918, it is confirmed whether or not there is a mode change request among the completion requests sent to 11 and, further, in order to check whether or not there is a request to be newly completed by this completion, the processing jumps to step 916. , If not, the process ends.

このように、本実施例においては、モードYに属するロ
ック要求の発行確率がモードZに属するロック要求が発
行される確率に比べ高い時、効果を発行する。この場
合、LLMの個数をnとすると、各モードの集合の場合のG
LMとLLMの通信回数は、以下のようになる。
As described above, in this embodiment, the effect is issued when the probability of issuing the lock request belonging to the mode Y is higher than the probability of issuing the lock request belonging to the mode Z. In this case, if the number of LLMs is n, G in the case of each mode set
The number of communications between LM and LLM is as follows.

Y:0 X−Y−Z:2 Z:2nT2 Y,Zに属するモードのロック要求が発行される確率をPY,
PZとした時の本発明におけるGLMとLLM間の通信回数C
は、以下のようになる。
Y: 0 X-Y-Z: 2 Z: 2nT2 Y, Z Probability that a lock request for a mode is issued is P Y ,
Number of communication C between GLM and LLM in the present invention when P Z
Is as follows.

C:2(1−PY−PZ)+2(n+1)PZ 一方、従来方式では、モードによらず、常に2回数信が
発生する。従って、本発明によって得られる通信回数の
削減ΔC(C′−C)は以下のように定義される。
C: 2 (1-P Y -P Z) +2 (n + 1) whereas P Z, in the conventional method, regardless of the mode, always two times signal is produced. Therefore, the reduction ΔC (C′−C) in the number of communications obtained by the present invention is defined as follows.

ΔC=2(PY−nPZ) 従って、PZ>PY/nの場合には、本方式を適用すると逆に
性能劣下を招くこともある。
ΔC = 2 (P Y −nP Z ) Therefore, when P Z > P Y / n, when this method is applied, the performance may be deteriorated.

〔発明の効果〕〔The invention's effect〕

以上説明したように、本発明によれば、CPU間データベ
ース共用時において、ロック・マネージャ間の通信回数
を減らすロック方式を実現できるので、通信コストが低
減される。
As described above, according to the present invention, it is possible to realize a locking method that reduces the number of times of communication between lock managers when a database is shared between CPUs, and therefore communication costs are reduced.

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

第1図は本発明の対象となるロック管理システムのソフ
トウェア構成図、第2図はロック・キューの構成図、第
3図はLLMキューに登録されるロック情報のフォーマッ
ト図、第4図はGLMキューに登録されるロック情報のフ
ォーマット図、第5図はCPU間でデータを共有する計算
機システムの構成図、第6図はLLMの構成図、第7図は
ユーザ・タスク要求受信部の処理フロー図、第8図はGL
M情報受信部の処理フロー図、第9図はGLMの処理フロー
図である。 10:グローバル・ロック・マネージャ、11:ローカル・ロ
ック・マネージャ。
FIG. 1 is a software configuration diagram of a lock management system which is a target of the present invention, FIG. 2 is a configuration diagram of a lock queue, FIG. 3 is a format diagram of lock information registered in an LLM queue, and FIG. 4 is a GLM. Format of lock information registered in queue, FIG. 5 is a block diagram of a computer system that shares data between CPUs, FIG. 6 is a block diagram of LLM, and FIG. 7 is a processing flow of a user / task request receiving unit. Figures and 8 are GL
FIG. 9 is a processing flow chart of the M information receiving unit, and FIG. 9 is a processing flow chart of GLM. 10: Global Lock Manager, 11: Local Lock Manager.

───────────────────────────────────────────────────── フロントページの続き (72)発明者 北嶋 弘行 神奈川県川崎市麻生区王禅寺1099番地 株 式会社日立製作所システム開発研究所内 (72)発明者 米田 茂 神奈川県川崎市麻生区王禅寺1099番地 株 式会社日立製作所システム開発研究所内 (72)発明者 倉野 昭 神奈川県小田原市国府津2880番地 株式会 社日立製作所小田原工場内 (72)発明者 住吉 孝史 神奈川県横浜市戸塚区戸塚町5030番地 株 式会社日立製作所ソフトウエア工場内 ─────────────────────────────────────────────────── ─── Continuation of the front page (72) Inventor Hiroyuki Kitajima 1099, Ozenji, Aso-ku, Kawasaki-shi, Kanagawa Inside the Hitachi, Ltd. Systems Development Laboratory (72) Inventor, Shigeru Yoneda 1099, Ozen-ji, Aso-ku, Kawasaki, Kanagawa Company Hitachi Ltd. System Development Laboratory (72) Inventor Akira Kurano 2880 Kozu, Odawara City, Kanagawa Stock Company Hitachi Ltd. Odawara Factory (72) Inventor Takashi Sumiyoshi 5030 Totsuka-cho, Totsuka-ku, Yokohama, Kanagawa Stock Company Hitachi Factory software factory

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】複数のCPUと、該CPU上で実行されるタスク
により共通に利用される共用データを格納した記憶装置
とを含んでなり、前記CPUのそれぞれに設けられ、前記
タスクから前記共用データに対するロック要求を受け付
けるローカルロックマネージャと、前記複数のCPUのい
ずれかに設けられ、前記ローカルロックマネージャを介
して受け付けたロック要求に応じて前記共用データのロ
ック管理を行うグローバルロックマネージャとを有し、
前記共用データに対するロック要求のモードとして複数
のモードが用意された計算機システムの共用データ管理
方法において、前記共用データに対して、モードpでロ
ックがかけられている状態でモードqのロック要求を許
可する場合をCOMPAT(q,p)=trueと表し、任意のモー
ドbとデフォルトとして定められたモードaとの間に、
COMPAT(r,a)=trueとなるすべてのモードrに関してC
OMPAT(r,b)=true、かつ、COMPAT(a,s)=trueとな
るすべてのモードsに関してCOMPAT(b,s)=trueなる
関係が成立するとき、モードbはモードaよりも排他的
ないと定義しておき、各ローカルロックマネージャは、
対応するタスクから受け取ったロック要求のモードが、
前記モードaよりも排他的でないモードか判定し、該判
定により前記ロック要求のモードがモードaよりも排他
的でないと判断した場合には、前記ロック要求を前記グ
ローバルロックマネージャに通知することなく前記ロッ
ク要求を許可するか否か決定し、該決定の結果を前記タ
スクに通知し、前記ロック要求のモードがモードaより
も排他的でないモード以外のモードであると判断した場
合には、前記ロック要求を前記グローバルロックマネー
ジャに通知し、前記ロック要求を許可するか否かの決定
を前記グローバルロックマネージャに委ねることを特徴
とする共用データ管理方法。
1. A CPU comprising a plurality of CPUs, and a storage device storing shared data commonly used by tasks executed on the CPUs. The storage device is provided in each of the CPUs, and is shared by the tasks. A local lock manager that receives a lock request for data and a global lock manager that is provided in any of the plurality of CPUs and that manages the lock of the shared data according to the lock request received through the local lock manager are provided. Then
In a shared data management method for a computer system, wherein a plurality of modes are prepared as a lock request mode for the shared data, a mode q lock request is permitted for the shared data while being locked in the mode p. In this case, COMPAT (q, p) = true is expressed, and between any mode b and the mode a defined as the default,
C for all modes r for which COMPAT (r, a) = true
When the relation of COMPAT (b, s) = true holds for all modes s of OMPAT (r, b) = true and COMPAT (a, s) = true, the mode b is more exclusive than the mode a. And each local lock manager
The mode of the lock request received from the corresponding task is
If it is determined whether the mode of the lock request is not exclusive than the mode a and it is determined that the mode of the lock request is not exclusive of the mode a, the lock request is notified without notifying the global lock manager. It is determined whether or not to permit the lock request, the result of the determination is notified to the task, and when it is determined that the mode of the lock request is a mode other than the mode not exclusive to the mode a, the lock A shared data management method comprising notifying a request to the global lock manager and entrusting the global lock manager to decide whether to grant the lock request.
【請求項2】前記グローバルロックマネージャは、ロー
カルロックマネージャから受け取ったロック要求のモー
ドcが前記モードaに関してCOMPAT(c,a)=true、か
つ、COMPAT(a,c)=trueなる条件を満たすか否か判定
し、前記条件を満たす場合は、当該グローバルロックマ
ネージャが受け付けたロック要求に関するロック情報に
基づいて前記モードcのロック要求を許可するか否か決
定し、前記条件を満たさない場合には、前記モードcの
ロック要求の発生を各ローカルロックマネージャに通知
して前記モードcのロック要求が許可可能であるか否か
を問い合わせ、前記ローカルロックマネージャの各々
は、前記問い合わせに応じて、前記グローバルロックマ
ネージャから通知されたロック要求が、自己が受け付け
た前記モードaよりも排他的でないモードのロック要求
との関係において許可可能なものかどうか判断し、許可
可能と判断したとき、前記問い合わせに対する応答を前
記グローバルロッくマネージャに返し、前記グローバル
ロックマネージャは、各ローカルロックマネージャから
の前記応答を受信し、前記応答及び前記ロック情報とに
基づき前記モードcのロック要求を許可するか否か決定
することを特徴とする特許請求の範囲第1項記載の共用
データ管理方法。
2. The global lock manager satisfies the condition that the mode c of the lock request received from the local lock manager is COMPAT (c, a) = true with respect to the mode a and COMPAT (a, c) = true. If the condition is not satisfied, it is determined whether or not to permit the lock request in the mode c based on the lock information about the lock request accepted by the global lock manager. Notifies each local lock manager of the occurrence of the mode c lock request and inquires whether the mode c lock request can be granted. Each of the local lock managers responds to the inquiry by The lock request notified from the global lock manager is more exclusive than the mode a that it has accepted. It is determined whether or not it is permissible in relation to the lock request of a certain mode, and when it is permissible, a response to the inquiry is returned to the global lock manager, and the global lock manager receives the response from each local lock manager. The shared data management method according to claim 1, further comprising receiving the response and determining whether to permit the lock request in the mode c based on the response and the lock information.
【請求項3】前記ローカルロックマネージャの各々は、
自己が受け付けた前記モードaよりも排他的でないモー
ドのロック要求に関するロック情報と、前記グローバル
ロックマネージャから通知されたロック要求に関するロ
ック情報とを保持し、該保持しているロック情報に基づ
いて、前記タスクから受け付けたロック要求に対する前
記決定を行うことを特徴とする特許請求の範囲第2項記
載の共用データ管理方法。
3. Each of the local lock managers comprises:
It holds lock information about a lock request in a mode that is less exclusive than the mode a accepted by itself and lock information about a lock request notified from the global lock manager, and based on the held lock information, The shared data management method according to claim 2, wherein the determination is made for the lock request received from the task.
【請求項4】前記モードaに関して、COMPAT(a,a)=t
rueが成立することを特徴とする特許請求の範囲第1項
または第2項記載の共用データ管理方法。
4. COMPAT (a, a) = t for the mode a
The shared data management method according to claim 1 or 2, wherein rue is established.
JP60280914A 1985-12-16 1985-12-16 Shared data management method Expired - Lifetime JPH07120333B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60280914A JPH07120333B2 (en) 1985-12-16 1985-12-16 Shared data management method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60280914A JPH07120333B2 (en) 1985-12-16 1985-12-16 Shared data management method

Publications (2)

Publication Number Publication Date
JPS62140159A JPS62140159A (en) 1987-06-23
JPH07120333B2 true JPH07120333B2 (en) 1995-12-20

Family

ID=17631694

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60280914A Expired - Lifetime JPH07120333B2 (en) 1985-12-16 1985-12-16 Shared data management method

Country Status (1)

Country Link
JP (1) JPH07120333B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2856761B2 (en) * 1989-03-31 1999-02-10 株式会社東芝 Resource lock management device
US6574654B1 (en) * 1996-06-24 2003-06-03 Oracle Corporation Method and apparatus for lock caching
WO2010041515A1 (en) * 2008-10-06 2010-04-15 インターナショナル・ビジネス・マシーンズ・コーポレーション System accessing shared data by a plurality of application servers

Also Published As

Publication number Publication date
JPS62140159A (en) 1987-06-23

Similar Documents

Publication Publication Date Title
US6668295B1 (en) Anticipatory lock mode conversions in a lock management system
US6965893B1 (en) Techniques for granting shared locks more efficiently
US7325064B2 (en) Distributed locking protocol with asynchronous token prefetch and relinquish
US7246167B2 (en) Communication multiplexor using listener process to detect newly active client connections and passes to dispatcher processes for handling the connections
US5161227A (en) Multilevel locking system and method
US7600063B2 (en) Techniques for improved read-write concurrency
EP0563624B1 (en) Method and apparatus for performing conditional operations on externally shared data
US5454108A (en) Distributed lock manager using a passive, state-full control-server
US7447786B2 (en) Efficient locking of shared data that is accessed for reads in a cluster database
US6708198B1 (en) Efficiently initiating lock state transitions for distributed resource objects that participate in a distributed lock management system
US6697901B1 (en) Using secondary resource masters in conjunction with a primary resource master for managing resources that are accessible to a plurality of entities
US8745707B2 (en) Method and apparatus providing optimistic locking of shared computer resources
JP5516398B2 (en) Multiprocessor system and method for sharing device between OS of multiprocessor system
US20150019739A1 (en) Two-level management of locks on shared resources
KR20010005570A (en) An agent-implemented locking mechanism
US6185650B1 (en) High performance locking facility
US6704767B1 (en) Using distributed information about lock conversion requests to efficiently manage lock state transitions
US8086579B1 (en) Semantic response to lock requests to reduce coherence overhead in multi-node systems
US20040243578A1 (en) Techniques for achieving higher availability of resources during reconfiguration of a cluster
US6088757A (en) Computer program means and device for conducting high performance locking facility in a loosely coupled environment
Goscinski et al. Resource management in large distributed systems
JPH07120333B2 (en) Shared data management method
JP7346649B2 (en) Synchronous control system and method
WO2021068710A1 (en) Method and system for fast processing of locks requested to access a shared resource
US7013463B2 (en) Latch mechanism for concurrent computing environments

Legal Events

Date Code Title Description
EXPY Cancellation because of completion of term