JPS62100856A - Lock processing system for input and output system - Google Patents

Lock processing system for input and output system

Info

Publication number
JPS62100856A
JPS62100856A JP60241217A JP24121785A JPS62100856A JP S62100856 A JPS62100856 A JP S62100856A JP 60241217 A JP60241217 A JP 60241217A JP 24121785 A JP24121785 A JP 24121785A JP S62100856 A JPS62100856 A JP S62100856A
Authority
JP
Japan
Prior art keywords
lock
request
input
output
processing
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
JP60241217A
Other languages
Japanese (ja)
Inventor
Akira Yamamoto
彰 山本
Atsushi Nitta
淳 新田
Toru Nishigaki
西垣 通
Hiroyuki Kitajima
北嶋 弘行
Shigeru Yoneda
茂 米田
Akira Kurano
倉野 昭
Takashi Sumiyoshi
住吉 孝史
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 JP60241217A priority Critical patent/JPS62100856A/en
Publication of JPS62100856A publication Critical patent/JPS62100856A/en
Pending legal-status Critical Current

Links

Landscapes

  • Multi Processors (AREA)

Abstract

PURPOSE:To attain designation for a fine lock range by chaining a normal CCW for data transfer and a CCW showing a lock range vir a lock control routine set inside a CPU and delivering an input/output request. CONSTITUTION:A local lock manager 20 is set within a CPU10 and delivers the transfer request of the shared data and the lock acquiring request to a global lock manager 26 set on a controller 16 by the request of a user program group 21. The communication is carried out between both lock managers by a normal I/O interface via channels 12 and 13. The manager 20 delivers an I/O request through an I/O control program 22 and therefore delivers the lock request and the data transfer request to the manager 26. In the same way, the manager 20 delivers the request onto a CPU11 through an I/O control program 25 in response to the request given from a user program group 24.

Description

【発明の詳細な説明】 〔発明の利用分野〕 本発明は、入出力系ロック処理方式に関し、特に複数C
PU間で共有する資源に対するロック処理、その中でも
入出力系(以下、■/○系と省略する)に対するデータ
処理方式に関するものである。
[Detailed Description of the Invention] [Field of Application of the Invention] The present invention relates to an input/output system lock processing method, and in particular,
This relates to lock processing for resources shared between PUs, and in particular, data processing methods for input/output systems (hereinafter abbreviated as ■/○ systems).

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

計算機システムに投入される処理の要求量が増大するに
伴って、複数のCPUを備えたシステム構成が一般的に
なってきている。この場合、複数のCPU間で共有され
るデータに対するロック処理、つまり占有によって生ず
るオーバヘッドが、システムの性能上の問題となってく
る。このロック処理によるオーバヘッドを少なくするこ
とが、マルチプロセッサシステムの重要な課題である。
As the amount of processing required for computer systems increases, system configurations equipped with multiple CPUs are becoming common. In this case, the overhead caused by locking, or occupancy, of data shared among multiple CPUs becomes a problem in terms of system performance. Reducing the overhead caused by this lock processing is an important issue for multiprocessor systems.

従来、複数のCPU間で共有されるデータのロック・ア
ーキテクチャとしては、次のような技術が知られている
。(a)先ず、CPU間の連絡方式としては、特開昭5
7−68461号公報に記載の方式があり、(b)I1
0系集中方式としては、[マルチシステム・データシェ
アリングの解析J  (The  DC3−A  ne
w  approach  to  vau1ヒisy
seem   data−sharing、N  CC
、1984+PP、59〜68参照)に記載された方式
があり、また(c)I10系分散方式としては、[日立
マニュアルH−8538−CIディスク制御装置、H−
8598デイスク駆動装置」に記載の方式がある。上記
(a)のCPU間連絡方式は、グローバル・ロツク・マ
ネーシア(共用データに対するアクセス権の管理を行う
マネージャ)が存在しているCPUと、ローカル・ロツ
ク・マネージャ(ユーザ・プログラムのロック要求を受
け付けるマネージャ)が存在しているCPUとの間で、
ロックに関する情報を送受信する。この場合、ローカル
・ロツク・マネージャが存在するCPUから、ロック情
報転送処理が2回、グローバル・ロツク・マネージャが
存在するCPUがら、ロック情報処理が2回、それぞれ
発生するため、合計4回の■/○処理が必要である。次
に、(b)の■/○集中方式は、D CS (D at
=a −5hare  Cor+trol  Syst
em)として実現されている。この方式は、■10系に
新しい装置を設けて、CPU間で共用される資源のロッ
クt′理を行うグローバル・ロツク・マネージャをこの
装置上に実現する。各CPU上のローカル・ロツク・マ
ネージャは、1回のI10処理でデータに対するロック
をかけることができる。次に、(c)のI10系分散方
式は、アクセス対象となるデータが存在するディスクに
対して、I10要求とロック要求が同時に発行される。
Conventionally, the following techniques are known as locking architectures for data shared among multiple CPUs. (a) First, as a communication method between CPUs,
There is a method described in Publication No. 7-68461, and (b) I1
As for the 0-system centralized method, [Analysis of multi-system data sharing J (The DC3-A ne
w approach to vau1hiisy
seem data-sharing, NCC
, 1984+PP, 59-68), and the (c) I10-based dispersion method includes the method described in [Hitachi Manual H-8538-CI Disk Controller, H-
There is a method described in ``8598 Disk Drive Device''. The inter-CPU communication method in (a) above involves a CPU that has a global lock manager (a manager that manages access rights to shared data) and a local lock manager (that accepts lock requests from user programs). manager) and the CPU where it resides,
Send and receive information about locks. In this case, lock information transfer processing occurs twice from the CPU where the local lock manager resides, and lock information processing occurs twice from the CPU where the global lock manager exists, for a total of four times. /○Processing is required. Next, the ■/○ concentration method in (b) is D CS (D at
=a −5hare Cor+trol Syst
em). In this method, a new device is provided in the 10 series, and a global lock manager is implemented on this device for handling locks on resources shared between CPUs. A local lock manager on each CPU can acquire a lock on data in a single I10 operation. Next, in the I10-based distributed method (c), an I10 request and a lock request are simultaneously issued to a disk where data to be accessed exists.

この方式では、ロック獲得のためのオーバヘッドが■/
○処理に含まれているため、オーバヘッドという観点か
らは最も性能的には優れている。しかし、従来実現され
ている方式では、ロックの単位はディスク装置全体であ
るため、データベースのようなきめの■かいロック単位
、例えばレコード(ディスクと主記憶の間のデータ転送
単位)単位のロックを必要とする場合には不向きである
In this method, the overhead for lock acquisition is
○ Since it is included in the processing, it has the best performance from the perspective of overhead. However, in the conventional method, the unit of lock is the entire disk device, so locking is performed in fine-grained lock units such as databases, such as records (units of data transfer between disk and main memory). Not suitable if you need it.

また、データ転送を伴わない単なるロック要求の発行に
ついては、何も考慮されていなかった。
Furthermore, no consideration was given to simply issuing a lock request without data transfer.

〔発明の目的〕[Purpose of the invention]

本発明の目的は、このような従来の問題を解決し、複数
のCP 0間で共用するデータに対するロックに対して
、細かいロック範囲を指定するととができ、かつロック
処理のオーバヘッドを格段に小さくできる入出力系ロッ
ク処理方式を提供することにある。
The purpose of the present invention is to solve such conventional problems, to specify a detailed lock range for locking data shared among multiple CP0s, and to significantly reduce the overhead of lock processing. The purpose of this invention is to provide an input/output lock processing method that allows for efficient input/output lock processing.

〔発明の概要〕[Summary of the invention]

上記目的を達成するため、本発明の入出力系ロック処理
方式は、複数のCPUに接続された制御装置と、該制御
装置に接続された複数台の入出力装置とを備える計算機
システムにおいて、各CPU内に、システ11に共有さ
れる資源のロック管理ルーチンを有し、該ロック管理ル
ーチンにより、通常のデータ転送用のCCWと該データ
転送の対象となる範囲とは独立したロック範囲を示すC
CWとをチェインして入出力要求を発行し、ロック範囲
とデータ転送範囲を別個に持つロック処理とデータ転送
処理とを行うことに特徴がある。
In order to achieve the above object, the input/output system lock processing method of the present invention provides a computer system that includes a control device connected to a plurality of CPUs and a plurality of input/output devices connected to the control device. The CPU has a lock management routine for resources shared by the system 11, and the lock management routine uses a CCW for normal data transfer and a CCW that indicates a lock range independent of the range targeted for data transfer.
It is characterized by issuing input/output requests by chaining with CW, and performing lock processing and data transfer processing that have separate lock ranges and data transfer ranges.

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

以下1本発明の実施例を、図面により詳細に説明する。 EMBODIMENT OF THE INVENTION Below, one embodiment of the present invention will be described in detail with reference to the drawings.

第2図は、本発明を適用する計算機システムのブロック
図である。第2図においては、2台のCPUIo、11
が設けられており、各CPUl0゜11には、それぞれ
チャネル1.2.13と主記憶装置14.15とが接続
され、両チャネル12゜13には制御装置16を介して
複数個の工/○装置群18が接続されている。ここでは
、CPU。
FIG. 2 is a block diagram of a computer system to which the present invention is applied. In Figure 2, two CPUIo, 11
A channel 1.2.13 and a main storage device 14.15 are connected to each CPU10. ○The device group 18 is connected. Here, the CPU.

チャネル、主記憶装置が2台づつ備えられたシステムで
あるが、一般に2台以上n台の場合に拡張することがで
きる。また、制御装置16とI10装置群I8も1セツ
トのみ接続されているが、一般にnセットまで拡張可能
である。ただし、各制御装置は、各CPU専用のチャネ
ルを経由して2台以上のCPUと接続されているものと
する。
Although the system is equipped with two channels and two main storage devices, it can generally be expanded to include two or more n devices. Further, although only one set of the control device 16 and the I10 device group I8 are connected, it is generally possible to expand to n sets. However, it is assumed that each control device is connected to two or more CPUs via a channel dedicated to each CPU.

ところで、CPU間で共用するデータに対するロック処
理のオーバヘッドをほぼ0にすることは、ディスク上の
データに対するアクセスとロック要求とを一括して処理
することにより実現できる。
By the way, it is possible to reduce the overhead of locking processing for data shared between CPUs to almost zero by processing accesses to data on a disk and locking requests all at once.

しかし、従来の各種方式では、この方法を用いると、ロ
ック単位がディスク全体であるために、データベースの
ように細かい単位のロックが要求される場合には、その
まま適用できない。そこで、本実施例では、ディスク上
のデータ転送対象となるデータとは独立にロック範囲を
明示したCCW(チャネル・コマンド・ワード)を、従
来のデータ転送用CCWとチェインして、1回のIlo
で一括処理する。また、データ転送を伴わないロック要
求を発行する場合、およびロック待ちが完了したという
通知を受け取る場合、他のデータ転送処理の性能に及ぼ
す影響を小さくするため、仮想的なデバイスを設け、二
わに対して要求を発行するようにしている。
However, in the various conventional methods, since the unit of lock is the entire disk, this method cannot be applied directly to cases where fine-grained locking is required, such as with databases. Therefore, in this embodiment, a CCW (channel command word) that specifies the lock range independently of the data to be transferred on the disk is chained with the conventional CCW for data transfer, so that one Ilo
Process in batch. In addition, when issuing a lock request that does not involve data transfer, or when receiving a notification that a lock wait has been completed, a virtual device is created to reduce the impact on the performance of other data transfer processes. I am trying to issue a request to .

第1図は、本発明の一実施例を示す入出力系ロック処理
方式のソフトウェア関係の図である。すなわち、第1図
では、CPU1.0,11.制御装置16上の各ロック
・マネージャ間の関係を示している。ローカル・ロツク
・マネージャ20は、CPU]、0内に存在し、ユーザ
・プログラム群21の要求に従って、共用データの転送
、あるいはロック獲得要求を制御装置]6上のグローバ
ル・ロツク・マネージャ26に発行する。制御装置16
が複数存在する場合には、グローバル・ロツク・マネー
ジャ26は各制御装置ごとに設けられる。
FIG. 1 is a software related diagram of an input/output system lock processing method showing an embodiment of the present invention. That is, in FIG. 1, CPUs 1.0, 11. The relationship between each lock manager on controller 16 is shown. The local lock manager 20 exists in the CPU], 0, and issues shared data transfer or lock acquisition requests to the global lock manager 26 on the controller], according to requests from the user program group 21. do. Control device 16
If there are multiple lock managers, a global lock manager 26 is provided for each control unit.

このとき、どのグローバル・ロツク・マネージャに要求
を発行するかは、ユーザ・プログラム群21からの要求
内容を識別して、ローカル・ロツク・マネージャ20が
判断する。このような判別機能をローカル・ロツク・マ
ネージャ20に設ければ、制御装置がn台の場合にも、
簡単に拡張可能であるため、ここでは制御装置が1台の
場合について説明する。ロック・マネージャ間の通信は
、チャネル12.13を経由して通常のI10インタフ
ェースで行われるため、ローカル・ロツク・マネージャ
20は、I10管理プログラム22を通じて■/○要求
を発行する形で、グローバル・ロツク・マネージャ26
に対しロック要求、およびデータ転送要求を発行する。
At this time, the local lock manager 20 determines which global lock manager to issue the request to by identifying the content of the request from the user program group 21. If such a discrimination function is provided in the local lock manager 20, even when there are n control devices,
Since it is easily expandable, the case where there is only one control device will be described here. Communication between lock managers takes place over the normal I10 interface via channel 12.13, so that local lock managers 20 can communicate with global lock managers by issuing ■/○ requests through I10 management program 22. lock manager 26
Issue lock requests and data transfer requests to

同じようにして、CPU1l上にも、ユーザ・プログラ
ム群24の要求に応じてローカル・ロツク・マネージャ
23がこれを受け付け、■/○管理プログラム25を通
じてグローバル・ロツク・マネージャ26に要求を発行
する。
Similarly, on the CPU 11, the local lock manager 23 accepts requests from the user program group 24 and issues requests to the global lock manager 26 through the ■/○ management program 25.

第3図は、第1図における各ローカル・ロツク・マネー
ジャの機能ブロック図である。各記号は、第1図と同一
のものを表わしており、ローカル・ロツク・マネージャ
20または23は、ロック解析部30とロック待ち完了
通知部31を備えている。ローカル・ロツク・マネージ
ャ20と23は、全く同じ構成、機能であるため、ここ
ではローカル・ロツク・マネージャ20について説明す
る。
FIG. 3 is a functional block diagram of each local lock manager in FIG. Each symbol represents the same thing as in FIG. 1, and the local lock manager 20 or 23 includes a lock analysis section 30 and a lock wait completion notification section 31. Local lock managers 20 and 23 have exactly the same configuration and function, so only local lock manager 20 will be described here.

ローカル・ロツク・マネージャ20中のロック解析部3
0が、ユーザ・プログ511群21(24)の中にある
1つのプログラムからロック要求または(ロック要求)
+(データ転送要求)を受け付けるものとする。一般に
、丁/○要求を発行する場合には、■/○要求の発行対
象となる■/○装置を指定する必要がある。ロック解析
部3oは、ユーザ・プログラム群21の中のプログラム
からロック要求を受け付けた時、■/○要求の発行対象
となる装置を決める。ここでは、ロック要求は、ロック
獲得要求と解放要求を指す。一般に、ロックにはいくつ
かのモードがあり、獲得しているモ−ドの変更を認める
場合もあるが、この場合にも本実施例では簡単に拡張可
能である。(ロック要求)+(データ転送要求)の場合
には、r/○要求発行対象となる装置は、データ転送を
行う工/○装置群18の装置にする必要があるため、従
来発行されていた入出力処理用のCCWの前に、ロック
をかけるためのCCWを付加した形でT/○要求を発行
すればよいことになる。
Lock analysis section 3 in local lock manager 20
0 is a lock request or (lock request) from one program in the user program 511 group 21 (24)
+ (data transfer request) shall be accepted. Generally, when issuing a D/○ request, it is necessary to specify the ■/○ device to which the ■/○ request is issued. When the lock analysis unit 3o receives a lock request from a program in the user program group 21, it determines the device to which the ■/○ request is to be issued. Here, a lock request refers to a lock acquisition request and a lock release request. Generally, locks have several modes, and there are cases in which the acquired mode may be allowed to be changed, but even in this case, this embodiment can be easily extended. In the case of (lock request) + (data transfer request), the device to which the r/○ request is issued must be a device in the machine/○ device group 18 that performs the data transfer, so the r/○ request was issued in the past. It is sufficient to issue a T/○ request with a CCW for locking added before the CCW for input/output processing.

第4図は、第3図におけるデータ転送を伴うロック要求
のCCWチェインの説明図である。ロック用のCCWの
内容は、ロック要求の内容(ロックの獲得、解放)、ロ
ックの範囲、プログラムより、ローカル・ロツク・マネ
ージャIDからなる。
FIG. 4 is an explanatory diagram of a CCW chain of lock requests involving data transfer in FIG. 3. The contents of the CCW for locking include the contents of the lock request (lock acquisition, release), lock range, program, and local lock manager ID.

ここで、プログラムIDは、ロック要求を発行したプロ
グラム群の中のプログラムのID(識別記号)である。
Here, the program ID is the ID (identification symbol) of the program among the program group that issued the lock request.

複数の資源にロックをかけたい場合には、ロック用のコ
マンドを複数個チェインすればよい。なお、1つのコマ
ンドで複数の資源にロックをかけるようにする方法も考
えられる。従来の例(例えば、前記CC)で挙げた文献
)では、ロックの範囲がT/○装置全体であるため、ロ
ック・コマンドは1つであり、ロックと工/○要求発行
の対象装置が同一であるため、ロック・コマンドでロッ
ク範囲を限定する必要はなかった。本実施例では、ロッ
ク範囲は■/○要求発行対象装置とは異なってもよいた
め、CCW内で限定する必要がある。従って、データ転
送を行うI10装置群18の中のI10装置とは異なっ
た装置上のデータに対するロック要求を発行してもよい
ことになる。従来は、どのプログラムID、ローカル・
ロツク・マネージャIDであるかをグローバル・ロツク
・マネージャ26に通知する必要がなかったが、本実施
例では、第4図に示すように、これを通知する方法を用
いる。この理由については、後述する。
If you want to lock multiple resources, you can chain multiple locking commands. Note that a method of locking multiple resources with one command is also conceivable. In the conventional example (for example, the document cited in CC above), the scope of the lock is the entire T/○ device, so there is only one lock command, and the target device for which the lock and the T/○ request is issued are the same. Therefore, there was no need to limit the lock range with a lock command. In this embodiment, the lock range may be different from the device to which the ■/○ request is issued, so it needs to be limited within the CCW. Therefore, it is possible to issue a lock request for data on a device different from the I10 device in the I10 device group 18 that performs the data transfer. Traditionally, which program ID, local
Although it was not necessary to notify the global lock manager 26 of the lock manager ID, in this embodiment, a method of notifying this as shown in FIG. 4 is used. The reason for this will be described later.

次に、ロック解析部30が、ロック要求のみを受け付け
た場合について、述べる。この場合には、データ転送は
必要がないため、単にロックをかけるためだけにI10
要求を発行することになる。
Next, a case will be described in which the lock analysis unit 30 receives only a lock request. In this case, there is no need for data transfer, so the I10
will issue a request.

従って、この場合のCCWのシーケンスは、第5図に示
すようになる。つまり、ccwrp、ロック範囲、プロ
グラムID、ローカル・ロツク・マネージTDが、−ロ
ック要求の内容である。この時に問題となるのが、この
工/○要求を発行する対象となる装置の設定である。デ
ータ転送処理が不要であるのに、実I10装置に対して
I10要求を発行して、I10装置を占有すると、その
間に他の■/○処理が実行できないという問題が生じる
。この問題を解決するために、仮想デバイス方式を用い
る。これは、ロック処理の際にのみ用いる仮想的なデバ
イスを設け、このデバイスに対して■/○要求を発行す
るという形でロック処理を行うものである。具体的には
、あるI10装置群18のI10装誼には割り付けられ
ていないデバイス・アドレスを1つ選択し、このデバイ
ス・アドレスを用いてI10要求を発行する。このデバ
イスを仮想デバイス32とする(第3図参照)。
Therefore, the CCW sequence in this case is as shown in FIG. That is, ccwrp, lock range, program ID, and local lock manager TD are the contents of the lock request. The problem at this time is the settings of the device to which this work/○ request is issued. If an I10 request is issued to a real I10 device and the I10 device is occupied even though data transfer processing is not necessary, a problem arises in that other ■/○ processes cannot be executed during that time. To solve this problem, a virtual device method is used. In this method, a virtual device is provided that is used only during lock processing, and lock processing is performed by issuing ■/○ requests to this device. Specifically, one device address that is not assigned to the I10 device of a certain I10 device group 18 is selected, and an I10 request is issued using this device address. This device is assumed to be a virtual device 32 (see FIG. 3).

本実施例では2さらに、仮想デバイス33を設けるが、
この使用目的については後述する。この方法を用いるこ
とにより、他のデータ転送処理をを伴う通常のI10処
理の影響を受けることなく。
In this embodiment, a virtual device 33 is further provided.
The purpose of use will be described later. By using this method, normal I10 processing involving other data transfer processing is not affected.

ロック処理が可能になる。Lock processing is possible.

データにロック要求を発行した場合、ロックをかけるこ
とができる場合と、他の処理要求との競合が生じ、ロッ
ク待ちが生じる場合がある。グローバル・ロツク・マネ
ージャ26は、ローカル・ロツク・マネージャ20また
は23からロック要求を受け付けた時、ロックをかける
資源の状態を調へ、他のプログラム群21または24の
中のプログラムと競合が生じるかをチェックする。アク
セス権を認めることができれば、ロック処理を終了させ
ることができる。データ転送を行うロック要求の場合に
は、この後、通常のデータ転送処理を開始することにな
る。ロック要求のみの場合には、この段階で、ロック処
理を終了し、仮想デバイス32が解放されることになる
When a lock request is issued for data, it may be possible to lock the data, or there may be a conflict with other processing requests, resulting in a lock wait. When the global lock manager 26 receives a lock request from the local lock manager 20 or 23, it checks the status of the resource to be locked and determines whether there will be a conflict with a program in another program group 21 or 24. Check. If the access right can be granted, the locking process can be completed. In the case of a lock request for data transfer, normal data transfer processing is then started. In the case of only a lock request, the lock processing is ended at this stage and the virtual device 32 is released.

次に、他のプログラムとの競合のため、ロック待ちが生
じる場谷について述べる。従来の工/○装置単位ごとの
ロックの場合には、プログラムが待ちに入る場合、I1
0装置群18の中の丁10装置を占有したまま待ち状態
に入る方法をとる。
Next, we will discuss the case where lock waiting occurs due to contention with other programs. In the case of conventional locking for each machine/device unit, when a program enters the wait state, I1
A method is adopted in which the system enters a waiting state while occupying 10 devices in the 0 device group 18.

これは、工/○装置全体にロックがかけられているため
、そのプログラムのI10処理を終了させ、次のI10
処理に入っていても、次の処理を実行させることができ
ないことに起因している。しかし、本実施例のように、
ロックの範囲がI10装置全体でない場合には、後に続
いているプログラムのロック範囲が異なれば、そのロッ
クが受け付けられる可能性があるため、そのI10処理
を終了させ、装置を解放させる必要が生じる。同じ理由
で、データ転送を必要としないロック処理の場合にも、
ロック待ちが生じた場合には、I10処理を終了させ、
仮想デバイス32を解放する。
Since the entire machine/○ device is locked, this will terminate the I10 processing of that program and start the next I10 process.
This is due to the fact that even if the process is in progress, the next process cannot be executed. However, as in this example,
If the range of the lock is not the entire I10 device, the lock may be accepted if the subsequent program has a different lock range, so it is necessary to terminate the I10 processing and release the device. For the same reason, for locking operations that do not require data transfer,
If a lock wait occurs, terminate I10 processing,
Release the virtual device 32.

ロック解析部30は、ロック待ちが生じたことによりI
10処理を終了させた場合には、プログラム群21の中
の該当するプログラムに対して待ち状態に入るように指
示する。この場合、アクセス対象となるデータに現在ロ
ックをかけているプログラムがロックを解放した時には
、ロック待ちを解除することを可能にしなければならな
い。従つて、グローバル・ロツク・マネージャ26では
、現在どのプログラムが共用資源に対してロックを保有
しているか、ロック待ちになっているかを管理する必要
が生じる。
The lock analysis unit 30 detects an I
When processing 10 is completed, the corresponding program in the program group 21 is instructed to enter a waiting state. In this case, when the program currently locking the data to be accessed releases the lock, it must be possible to release the lock wait. Therefore, the global lock manager 26 needs to manage which programs currently hold locks on shared resources and which programs are waiting for locks.

第6図は、本発明で使用されるロック獲得要求チェイン
の説明図である。このロック獲得要求チェインは、グロ
ーバル・ロツク・マネージャ26内に設けられる。上記
管理情報は、第6図に示すように、ロックの範囲となっ
ているロック範囲ID60ごとに、以下の情報62〜6
4、つまりロックを要求するローカル・ロツク・マネー
ジャTI)62、ロックを要求するプログラムID63
、およびロック状態64が、ロックポインタ61によっ
てキュー状に格納されている。ロック要求ローカル・ロ
ツク・マネージャID62.ロック要求プログラムrD
63は、ロック要求を発行したローカル・ロツク・マネ
ージャとプログラムの各IDである。これらの情報は、
CCWの中のローカル・ロツク・マネージャ丁り、CC
WIDより格納する。ロック状態64は、この要求がロ
ックを占有中であるか、待ち状態にあるかを示している
。グローバル・ロツク・マネージャは、ロック要求を受
け付けた時、その資源にロック要求が現在ない場合には
、キュー情報を作成しなければならない。また、既に他
のプログラムによるロック要求が受け付けられている場
合には、共存可能か、競合するかをチェックする。一方
、解放要求を受け付けた場合には、新たにアクセス権を
認めるプログラムにその旨を通知する必要がある。また
FIG. 6 is an explanatory diagram of a lock acquisition request chain used in the present invention. This lock acquisition request chain is provided within the global lock manager 26. As shown in FIG. 6, the above management information includes the following information 62 to 6 for each lock range ID 60 that is a lock range.
4, the local lock manager TI requesting the lock) 62, the program ID requesting the lock 63
, and the lock state 64 are stored in a queue by the lock pointer 61. Lock request local lock manager ID62. Lock request program rD
63 is the ID of the local lock manager and program that issued the lock request. This information is
Local lock manager in CCW, CC
Store from WID. Lock status 64 indicates whether this request is occupying the lock or is in a waiting state. When the global lock manager receives a lock request, it must create queue information if there is currently no lock request for that resource. Furthermore, if a lock request by another program has already been accepted, it is checked whether they can coexist or if there is a conflict. On the other hand, when a release request is accepted, it is necessary to notify the program to which the new access right is granted. Also.

その資源に対するロック要求がなくなった場合には、キ
ュー情報を消去する。
When there are no more lock requests for that resource, the queue information is deleted.

一方、ローカル・ロツク・マネージャ20側には、アク
セス権が認められた旨を受け取るために、ロック待ち完
了通知部31が存在する。この場合にも、ロック待ち完
了通知部31はI10要求を発行する形で完了通知を受
け取ることになる。I10発行対象装置は、データ転送
を伴わないロック要求の場合と同じように、他の■/○
処理要求に性能劣化を引き起こさせないため、仮想デバ
イス方式を用いる。このときに用いる仮想デバイスを仮
想デバイス33とする(第3図参照)。他の処理要求の
ロック解放はいつ発生するか不明であるため、ロック待
ち完了通知部31は、ある完了通知を受けてユーザ・タ
スクのロック待ちを解放した後、直ちに■/○要求を発
行して2次のロック待ち完了通知を受け取る態勢に入る
必要がある。
On the other hand, a lock wait completion notification section 31 exists on the local lock manager 20 side to receive a notification that the access right has been granted. In this case as well, the lock wait completion notification unit 31 receives a completion notification in the form of issuing an I10 request. I10 is issued to other ■/○ devices as in the case of lock requests that do not involve data transfer.
A virtual device method is used to avoid performance degradation due to processing requests. The virtual device used at this time is assumed to be a virtual device 33 (see FIG. 3). Since it is unknown when the lock will be released for other processing requests, the lock wait completion notification unit 31 issues a ■/○ request immediately after receiving a certain completion notification and releasing the lock wait for the user task. It is necessary to prepare to receive the secondary lock wait completion notification.

この場合のCCWは、新コマンドを用いてもよく、また
完了通知を仮想デバイス33からの入力レコードと解釈
すれば、既存のリード・コマンドでも対応できる。本実
施例では、これに関する限定は行わない。一方、ロック
待ちが完了したユーザタスクは、アクセス権が認められ
たため、データ転送が必要な場合には、ローカル・ロツ
ク・マネージャを介することなく、通常の工/○処理に
入ればよいことになる。一方、グローバル・ロツク・マ
ネージャ26側には、完了通知受信要求の受け付は状況
に関する情報を持つ必要がある。これらの情報は、ロー
カル・ロツク・マネージャごとに持つ。
The CCW in this case may use a new command, or if the completion notification is interpreted as an input record from the virtual device 33, an existing read command can also be used. This embodiment does not limit this. On the other hand, the user task that has completed waiting for the lock has been granted access rights, so if data transfer is required, it can simply enter normal processing without going through the local lock manager. . On the other hand, the global lock manager 26 needs to have information regarding the status in order to accept the completion notification reception request. Each local lock manager has this information.

第7図は、本発明で使用されるロック完了通知情報チェ
インの構成図である。この情報は、ある処理要求のロッ
クのロック待ちが完了した時、該当するローカル・ロツ
ク・マネージャからロック完了通知要求が発行されてい
なかった時この完了通知情報を記憶しておくために必要
である。ローカル・ロツク・マネージャID70は、こ
れがどのローカル・ロツク・マネージャ中に対する完了
通知の情報であるかを示す。ロック待ちを完了したプロ
グラム群21(または23)中のプログラムのプログラ
ムIDは、ロック待ち完了ポインタ71を介してキュー
状に完了通知プログラムID72に格納される。ロック
待ちを完了したプログラムがない場合には、先頭のロッ
ク待ち完了ポインタ71が空になる。
FIG. 7 is a configuration diagram of a lock completion notification information chain used in the present invention. This information is necessary in order to remember this completion notification information when a lock wait for a certain processing request is completed and a lock completion notification request has not been issued by the corresponding local lock manager. . Local lock manager ID 70 indicates which local lock manager this completion notification information is for. The program ID of the program in the program group 21 (or 23) that has completed the lock wait is stored in a queue in the completion notification program ID 72 via the lock wait completion pointer 71. If no program has completed lock waiting, the leading lock waiting completion pointer 71 becomes empty.

■/○管理プログラム21は、ロック解析部30の要求
に従って、I10要求を発行する。すなわち、データ転
送を伴うロック要求の場合には、第4図に示すようなC
CW、ロック要求のみの場合には、第5図に示すような
CCWを発行する。
■/○ The management program 21 issues an I10 request in accordance with the request from the lock analysis section 30. In other words, in the case of a lock request that involves data transfer, C
In the case of only CW and lock requests, a CCW as shown in FIG. 5 is issued.

この場合、I10要求の対象となるデバイスは、ローカ
ル・ロツク・マネージャ側で限定するものとする。ただ
し、これは■/○管理プログラム22側で制御するよう
にしてもよい。また、ユーザが、ロック要求を含まない
工/○要求を発行する場合には、直接I10管理プログ
ラム22に要求を発行することになる。
In this case, the devices targeted by the I10 request shall be limited by the local lock manager. However, this may be controlled by the ■/○ management program 22 side. Furthermore, when the user issues a work/○ request that does not include a lock request, the user issues the request directly to the I10 management program 22.

以下、各ロック・マネージャの処理フローに従って、動
作を説明する。第8図は、ローカル・ロツク・マネージ
ャ20(または23)のロック解析部30の処理ブロー
チヤードである。先ず、この要求がロック要求のみの要
求か、データ転送を伴うロック要求であるかを判別する
(ステップ800)。データ転送を伴う場合、データ転
送の対象となるI10装置群18の中のI10装置に対
して、データ転送要求とロック要求を一括して発行する
ように工/○管理プログラム22に要求する(ステップ
801)。ロックの範囲は、ロック用のCCWの中で決
定する。一方、ロック要求のみの場合には、仮想デバイ
ス32に対してロック要求を発行するように、I/○管
理プログラム22に要求する(ステップ802)。この
後、これらの処理の完了を待つ(I10完了待ち、ステ
ップ803)。■/○完了後、完了状態をチェックし、
ロック待ちが生じている場合には、要求を発行したプロ
グラム群21の中のプログラムにウェイト状態に入るよ
うに通知しくステップ804,805)。
The operation of each lock manager will be explained below according to the processing flow. FIG. 8 is a processing block diagram of the lock analysis section 30 of the local lock manager 20 (or 23). First, it is determined whether this request is a lock request only or a lock request that involves data transfer (step 800). If data transfer is involved, the engineering/○ management program 22 is requested to issue a data transfer request and a lock request all at once to the I10 device in the I10 device group 18 that is the target of the data transfer (step 801). The scope of the lock is determined within the CCW for the lock. On the other hand, if there is only a lock request, the I/O management program 22 is requested to issue a lock request to the virtual device 32 (step 802). Thereafter, it waits for the completion of these processes (I10 wait for completion, step 803). ■/○After completion, check the completion status,
If a lock wait is occurring, the program in the program group 21 that issued the request is notified to enter a wait state (steps 804, 805).

ロック待ちが生じていなければ、処理が完了したことを
通知しくステップ806)、処理を終了させる。
If there is no lock waiting, a notification is sent that the process has been completed (step 806), and the process is terminated.

第9図は、ローカル・ロツク・マネージャのロック待ち
完了通知部31の処理フローチャートである。通知部3
1は、先ず、ロック完了通知情報を送信せよという指示
を仮想デバイス33に対して発行するように、I10管
理ルーチン22に要求する(ステップ900)。次に、
このI10要求が完了するのを待つ(ステップ901)
。このI10完了通知を受けると、ロック完了通知情報
を解析し、該当するプログラム群22の中のプログラム
のロック待ちを解除する(ステップ902)。そして、
最初に戻って別のロック要求に対する処理を開始する。
FIG. 9 is a processing flowchart of the lock wait completion notification section 31 of the local lock manager. Notification part 3
1 first requests the I10 management routine 22 to issue an instruction to the virtual device 33 to send lock completion notification information (step 900). next,
Wait for this I10 request to complete (step 901)
. Upon receiving this I10 completion notification, the lock completion notification information is analyzed and the locking status of the program in the corresponding program group 22 is released (step 902). and,
Return to the beginning and begin processing another lock request.

第10図は、本発明におけるグローバル・ロツク・マネ
ージャ26の処理フローチャートである。
FIG. 10 is a processing flowchart of the global lock manager 26 in the present invention.

グローバル・ロツク・マネージャ26は、第1図に示す
ように、制御装置16上に存在する。制御装置16上に
は、グローバル・ロツク・マネージャ26以外の機能も
あるが、ここではこの機能に関係する部分のみを示す。
Global lock manager 26 resides on controller 16, as shown in FIG. Although there are functions other than global lock manager 26 on controller 16, only those portions related to this function are shown here.

先ず、受け付けた要求内容を解析する(ステップ100
0)。ロック要求完了情報を送信せよという要求を受け
取った場合には、既に通知すべきロック要求完了情報が
あるか否かをチェックする(ステップ1001)。これ
があれば、ロック完了情報を通知し、■/○処理を終了
させる(ステップ1002)。なければ、仮想デバイス
33を占有させたまま、ロック待ち完了ポインタ71(
第7図参照)を完了通知完了通知有りの状態にする(ス
テップ1003)、次に、ロックの獲得要求を受け取っ
た場合には、ロックが認められるか否かをチェックする
(ステップ1004)。認められなければ、ロック待ち
が生じたことを通知し、I10処理を終了させる(ステ
ップ1005)。ロックが認められた場合には、この要
求がデータ転送を伴う要求であるかをチェックする(ス
テップ1006)。データ転送を伴わない場合には、工
/○要求が正常終了したことを通知し、この処理を終了
させる(ステップ1007)。また、データ転送を伴う
場合には、この後通常のデータ転送処理に入ることにな
る。この処理は、よく知られた動作であるため、説明を
省略する。次に、ロック解放通知を受け付けた場合には
、この解放によって、新たにロックが獲得できるプログ
ラムがあるか否かをチェックする(ステップtook)
。これがあれば、各プログラムのロック待ち完了通知要
求を受信しているローカル・ロツク・マネージャと受信
していないローカル・ロツク・マネージャに分類する(
ステップ1009)。受信要求を出しているものに対し
ては、ロック待ち完了情報を通知する(ステップ101
0)。
First, the content of the received request is analyzed (step 100).
0). When receiving a request to send lock request completion information, it is checked whether there is already lock request completion information to be notified (step 1001). If there is this, lock completion information is notified and the ■/○ processing is terminated (step 1002). If not, the lock wait completion pointer 71 (
(see FIG. 7) is set to a completion notification state (step 1003). Next, when a lock acquisition request is received, it is checked whether the lock is granted (step 1004). If not recognized, it is notified that a lock wait has occurred, and the I10 process is terminated (step 1005). If the lock is approved, it is checked whether this request involves data transfer (step 1006). If data transfer is not involved, it is notified that the work/○ request has ended normally, and the process is ended (step 1007). Furthermore, if data transfer is involved, normal data transfer processing will then begin. Since this process is a well-known operation, a description thereof will be omitted. Next, when a lock release notification is received, it is checked whether there is a program that can newly acquire a lock by this release (step took).
. If this exists, the local lock managers are classified into those that have received lock wait completion notification requests for each program and those that have not received them (
Step 1009). The lock wait completion information is notified to the receiving request (step 101).
0).

また、受信要求を出していないものに対しては、ロック
待ちが完了したプログラムIDを完了通知プログラムI
Dに格納し、ロック待ち完了ポインタ71よりのキュー
に接続する(ステップ1011)。この後、ステップ1
006にジャンプする。
Also, for those that have not issued a reception request, the completion notification program I
D, and connect to the queue from the lock wait completion pointer 71 (step 1011). After this, step 1
Jump to 006.

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

以上説明したように5本発明によれば、ロック処理を■
/○/○の中に組み込んでしまい、かつ装置全体ではな
く、装置の一部をロック単位として、細かいロック範囲
を指定することができ、さらにデータ転送を必要としな
いロック要求のみの処理を効率よく実行するので、計算
機システムのオーバヘッドを非常に小さくすることがで
きる。
As explained above, according to the present invention, the lock processing is
/○/○, and it is possible to specify a detailed lock range by locking a part of the device rather than the entire device, and it is also possible to efficiently process only lock requests that do not require data transfer. Since it is executed frequently, the overhead of the computer system can be made very small.

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

第1図は本発明の一実施例を示すT/○系ロシロツク処
理方式フトウェアの関係図、第2図は本発明を適用する
計算機システムのブロック図、第3図はローカル・ロツ
ク・マネージャの構成とその■/○/○発行対象装置の
関係図、第4図は本発明におけるデータ転送を伴うロッ
ク要求のCCWチェインを示す図、第5図は本発明にお
けるデータ転送を伴わないロック要求のCCWチェイン
を示す図、第6図は本発明のロック獲得要求チェインの
図、第7図は本発明のロック完了通知情報チェインの図
、第8図は本発明におけるロック解析部の処理フローチ
ャート、第9図は本発明のロック待ち完了通知部の処理
フローチャート、第10図は本発明のグローバル・ロツ
ク・マネージャの処理フローチャートである。 10.11:CPU、12,13:チャネル、16:制
御装置、18:I/○/○群、20,23:ローカル・
ロツク・マネージャ、21,24:ユーザ・プログラム
群、22.25: I10管理ルーチン、26:グロー
バル・ロツク・マネージャ、32.33:仮想デバイス
。 特許出願人 株式会社日立製作所 第    1    図 第    2    図 第3図 工10装置郡 第   4   図 第    5    図 第    6    図 第   7   図 第    8    図 第    9   図
Fig. 1 is a relationship diagram of T/○ system lock processing system software showing an embodiment of the present invention, Fig. 2 is a block diagram of a computer system to which the present invention is applied, and Fig. 3 is a configuration of a local lock manager. 4 is a diagram showing the CCW chain of a lock request that involves data transfer in the present invention, and FIG. 5 is a diagram showing the CCW chain of a lock request that does not involve data transfer in the present invention. 6 is a diagram showing the lock acquisition request chain of the present invention; FIG. 7 is a diagram of the lock completion notification information chain of the present invention; FIG. 8 is a processing flowchart of the lock analysis unit in the present invention; 10 is a processing flowchart of the lock wait completion notification section of the present invention, and FIG. 10 is a processing flowchart of the global lock manager of the present invention. 10.11: CPU, 12, 13: Channel, 16: Control device, 18: I/○/○ group, 20, 23: Local
Lock Manager, 21, 24: User Program Group, 22.25: I10 Management Routine, 26: Global Lock Manager, 32.33: Virtual Device. Patent Applicant Hitachi, Ltd. Figure 1 Figure 2 Figure 3 10 Equipment Group Figure 5 Figure 6 Figure 7 Figure 8 Figure 9

Claims (4)

【特許請求の範囲】[Claims] (1)複数のCPUに接続された制御装置と、該制御装
置に接続された複数台の入出力装置とを備える計算機シ
ステムにおいて、各CPU内に、‘それぞれのCPU内
の処理要求から’システムに共有される資源に対するロ
ツク要求を受け付けるローカル・ロツク管理ルーチンを
有し、制御装置内に、共有資源のロツク管理を行うグロ
ーバル・ロツク管理ルーチンを設けた時、該ローカル・
ロツク管理ルーチンにより、通常のデータ転送用のCC
Wと該データ転送の対象となる範囲とは独立したロツク
範囲を示すCCWとをチエインして入出力要求を発行し
、グローバル・ロツク管理ルーチンを有する制御装置側
でロツク範囲とデータ転送範囲を別個に持つロツク処理
とデータ転送処理とを行うことを特徴とする入出力系ロ
ツク処理方式。
(1) In a computer system equipped with a control device connected to multiple CPUs and a plurality of input/output devices connected to the control device, in each CPU there is a system 'from processing requests within each CPU'. When a control device has a local lock management routine that accepts lock requests for shared resources, and a global lock management routine that performs lock management of shared resources is provided in the control device, the local
Lock management routines allow the CC for normal data transfers to be
An input/output request is issued by chaining W and a CCW indicating a lock range independent of the range targeted for data transfer, and the lock range and data transfer range are separated on the control device side having a global lock management routine. An input/output lock processing method characterized by performing lock processing and data transfer processing.
(2)上記ロツク処理は、データ転送を伴わないロツク
要求を発行する場合、仮想的な入出力装置に対する入出
力要求を発行することにより、制御装置に伝達すること
を特徴とする特許請求の範囲第1項記載の入出力系ロツ
ク処理方式。
(2) In the case of issuing a lock request that does not involve data transfer, the lock processing is transmitted to the control device by issuing an input/output request to a virtual input/output device. The input/output system lock processing method described in item 1.
(3)上記ロツク処理は、ロツク獲得が認められない時
には、直ちに該当入出力処理を終了させ、入出力要求の
対象となる入出力装置を開放することを特徴とする特許
請求の範囲第1項記載の入出力系ロツク処理方式。
(3) In the above-mentioned lock processing, when lock acquisition is not recognized, the corresponding input/output processing is immediately terminated and the input/output device that is the target of the input/output request is released. The input/output lock processing method described.
(4)上記ロツク処理は、ロツク獲得要求が認められた
ことの通知を受けたい要求が出されると、データ転送を
伴わないロツク要求のときとは異なる仮想的入出力装置
を用いて、該仮想入出力装置に対する入出力要求を発行
することを特徴とする特許請求の範囲第1項または第2
項記載の入出力系ロツク処理方式。
(4) In the lock processing described above, when a request to receive notification that a lock acquisition request has been approved is issued, a virtual input/output device different from that for a lock request that does not involve data transfer is used to Claim 1 or 2 is characterized in that an input/output request is issued to an input/output device.
The input/output system lock processing method described in Section 1.
JP60241217A 1985-10-28 1985-10-28 Lock processing system for input and output system Pending JPS62100856A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60241217A JPS62100856A (en) 1985-10-28 1985-10-28 Lock processing system for input and output system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60241217A JPS62100856A (en) 1985-10-28 1985-10-28 Lock processing system for input and output system

Publications (1)

Publication Number Publication Date
JPS62100856A true JPS62100856A (en) 1987-05-11

Family

ID=17070936

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60241217A Pending JPS62100856A (en) 1985-10-28 1985-10-28 Lock processing system for input and output system

Country Status (1)

Country Link
JP (1) JPS62100856A (en)

Similar Documents

Publication Publication Date Title
US4480304A (en) Method and means for the retention of locks across system, subsystem, and communication failures in a multiprocessing, multiprogramming, shared data environment
US4791554A (en) Method and apparatus for preventing deadlock in a data base management system
US5987550A (en) Lock mechanism for shared resources in a data processing system
US6105085A (en) Lock mechanism for shared resources having associated data structure stored in common memory include a lock portion and a reserve portion
US4399504A (en) Method and means for the sharing of data resources in a multiprocessing, multiprogramming environment
US5129085A (en) Computer network with shared memory using bit maps including flags to indicate reserved memory areas and task status
JP2533266B2 (en) Locking method of data resource in shared data system and data lock management method between systems
US7100161B2 (en) Method and apparatus for resource access synchronization
JPH1165863A (en) Common resource managing method
JPH0552980B2 (en)
JPH10301834A (en) Management method for shared memory
JPS60128537A (en) Resouce access control
US7770177B2 (en) System for memory reclamation based on thread entry and release request times
JPH1115793A (en) Protection method for resource maintainability
JPH04182858A (en) Shared memory management system
JPH0628049B2 (en) Data transfer method between asynchronous buses
US7069366B2 (en) System and method for handling resource transaction requests
JP2690435B2 (en) Multiprocessor system having microprogram means for dispatching processing to a processor
JPS62100856A (en) Lock processing system for input and output system
JPH1049388A (en) Input and output controller
US6981108B1 (en) Method for locking shared resources connected by a PCI bus
EP0049423B1 (en) Multiprocessor system
JPH09223032A (en) Resources lock control mechanism
JPH08278953A (en) Exclusive control system of computer system
JPH08212064A (en) Switching system and method for shared subroutine