JPH1097507A - System and method for lock control - Google Patents

System and method for lock control

Info

Publication number
JPH1097507A
JPH1097507A JP25125896A JP25125896A JPH1097507A JP H1097507 A JPH1097507 A JP H1097507A JP 25125896 A JP25125896 A JP 25125896A JP 25125896 A JP25125896 A JP 25125896A JP H1097507 A JPH1097507 A JP H1097507A
Authority
JP
Japan
Prior art keywords
lock
state
request
variable
lock control
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
JP25125896A
Other languages
Japanese (ja)
Inventor
Kazuya Matsumoto
和也 松本
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.)
NEC Computertechno Ltd
Original Assignee
NEC Computertechno 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 NEC Computertechno Ltd filed Critical NEC Computertechno Ltd
Priority to JP25125896A priority Critical patent/JPH1097507A/en
Publication of JPH1097507A publication Critical patent/JPH1097507A/en
Pending legal-status Critical Current

Links

Landscapes

  • Multi Processors (AREA)

Abstract

PROBLEM TO BE SOLVED: To realize fast lock control by locally performing lock control for sharing main storage. SOLUTION: The lock control for respective processors 201-204 is performed by lock request controllers in cache units 205 and 206 to which the processors 201 to 204 are connected according to the state of a lock variable. Each lock request controller once receiving a lock request or unlock request looks up in a lock address register which holds the address of the lock variable to refer to the lock state stored in the corresponding lock status register. As the state of the lock variable, not only a table which merely shows that individual devices are in lock or unlock states, but also various states are defined. For example, ULE shows a state wherein it is confirmed that none of the devices secures a lock. Consequently, a lock is speedily obtained without confirming the states of other devices.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明はデータ処理システム
のためのロック制御に関し、特に主記憶を共有する複数
のデータ処理装置を有するデータ処理システムにおける
ロック制御システムおよび方法に関する。
The present invention relates to lock control for a data processing system, and more particularly to a lock control system and method for a data processing system having a plurality of data processing devices sharing a main memory.

【0002】[0002]

【従来の技術】データ処理システムにおいては、従来、
複数のデータ処理装置が主記憶を共有するように構成さ
れる場合がある。かかる場合において、ある共有領域の
データをある特定のデータ処理装置が一定期間排他的に
使用する必要が生じる場合がある。例えば、あるデータ
処理装置がある共有領域のデータに1を加える操作をす
る場合には、その共有領域のデータを読み出して1を加
えた後再びその共有領域に書き込む一連の処理の間は、
他のデータ処理装置からの当該データヘのアクセスを禁
止しなけれはならない。そうでなければ、データの更新
結果が保証されないことになる。
2. Description of the Related Art In a data processing system, conventionally,
A plurality of data processing devices may be configured to share a main memory. In such a case, it may be necessary for a certain data processing device to exclusively use data in a certain shared area for a certain period. For example, when a certain data processing device performs an operation of adding 1 to data of a certain shared area, during a series of processing of reading data of the shared area, adding 1, and then writing the same again to the shared area,
Access to the data from other data processing devices must be prohibited. Otherwise, the result of updating the data will not be guaranteed.

【0003】この排他的アクセスを保証するために使用
されるのがロック変数である。共有領域にアクセスする
際には必ずこのロック変数をチェックして、ロック状態
にないことを確認する必要がある。そのロック変数がア
ンロック状態であれば、それをロック状態にしてから対
応する共有領域にアクセスする。排他的な処理が終了し
た後にロック変数をアンロック状態に戻す。このような
制御をロック制御という。
A lock variable is used to guarantee this exclusive access. When accessing the shared area, it is necessary to check this lock variable to make sure that it is not locked. If the lock variable is in the unlocked state, it is locked and then the corresponding shared area is accessed. Return the lock variable to the unlocked state after exclusive processing is completed. Such control is called lock control.

【0004】例えば、特開昭56ー21260号公報に
は、複数の処理装置からの主記憶アクセスについてのロ
ック制御を行うアクセス装置の技術思想が開示されてい
る。この従来技術では、ロック変数の状態として、ロッ
クが取得されているかまたはロックが取得されていない
かの2つの状態を使用している。従って、ある記憶制御
装置でロックを取得しようとするリクエスト(以下、
「ロックリクエスト」という)やロックを解放しようと
するリクエスト(以下、「アンロックリクエスト」とい
う)を受け取ると、他の記憶制御装置におけるロック変
数の状態のチェックや更新が発生してしまう。例えは、
あるデータ処理装置からロックリクエストが発行された
場合、そのデータ処理装置が接続する記憶制御装置内で
保持されているロック変数がアンロック状態を示してい
れば他の記憶制御装置におけるロック変数の状態を検索
しなけれはならなくなる。そして、その索引の結果、ロ
ック状態であれは、そのロックリクエストは失敗とな
り、データ処理装置は再度ロックリクエストを発行する
ことになる。このような動作をスピンロックという。
For example, Japanese Patent Application Laid-Open No. 56-21260 discloses a technical idea of an access device for performing lock control on main memory access from a plurality of processing devices. In this conventional technique, two states, that is, a lock is acquired and a lock is not acquired, are used as the state of the lock variable. Therefore, a request to acquire a lock by a certain storage control device (hereinafter referred to as a request)
When a request to release a lock (hereinafter, referred to as an "unlock request") or a request to release a lock (hereinafter, referred to as an "unlock request"), the state of a lock variable in another storage control device is checked or updated. For example,
If a lock request is issued from a certain data processing device and the lock variable held in the storage controller connected to the data processing device indicates an unlocked state, the state of the lock variable in another storage control device Will have to be searched. If the result of the index indicates that the lock request is locked, the lock request fails, and the data processing device issues the lock request again. Such an operation is called spin lock.

【0005】[0005]

【発明が解決しようとする課題】上述した従来技術で
は、データ処理装置が新たなロックリクエストを発行し
た際、当該記憶制御装置においてロック変数がアンロッ
ク状態を示していればロックを取得するために他の記憶
制御装置のロック変数にアクセスしなければならなくな
る。このため、従来技術ではロック取得に必要な時間が
長くなり、また、不要なバスアクセスによりバストラフ
ィックが増大するという問題がある。
In the above-mentioned prior art, when the data processing device issues a new lock request, the lock is acquired if the lock variable indicates an unlocked state in the storage control device. Access to lock variables in other storage controllers will have to be accessed. For this reason, in the related art, there is a problem that the time required for acquiring the lock becomes longer and bus traffic increases due to unnecessary bus access.

【0006】従って、本発明の目的は、主記憶を共有す
るための改良されたロック制御システムを提供すること
にある。
Accordingly, it is an object of the present invention to provide an improved lock control system for sharing main memory.

【0007】また、本発明の他の目的は、ロック制御の
ための処理を局所的にかつ高速に行うロック制御方法を
提供することにある。
Another object of the present invention is to provide a lock control method for locally and quickly performing a process for lock control.

【0008】[0008]

【課題を解決するための手段】本発明は、主記憶を共有
する複数のデータ処理装置を有するデータ処理システム
における複数のデータ処理装置の少なくとも1つに関す
るロック変数の状態をそれぞれ制御する複数のロック制
御装置を有するロック制御システムにおいて、ロック変
数の状態を少なくとも1つ登録する登録手段と、登録手
段に登録されたロック変数の状態を保持する状態保持手
段とを備え、状態保持手段が、ロック変数の状態とし
て、複数のロック制御装置の一部がロックを取得してお
らず、かつ他のロック制御装置がロックを取得している
かは不明である旨を表す第1の状態と、いずれのロック
制御装置においてもロック取得されていない旨を表す第
2の状態と、複数のロック制御装置の一部がロックを取
得しておりかつ他のロック制御装置が第1の状態にある
旨を表し、かつアンロックリクエストに対しては第2の
状態に遷移する旨を表す第3の状態と、いずれかのロッ
ク制御装置がロックを確保しており、かつアンロックリ
クエストに対しては第2の状態に遷移する旨を表す第4
の状態とを有し、ロック取得を高速にすることを特徴と
するロック制御システムである。
SUMMARY OF THE INVENTION The present invention provides a plurality of locks for controlling the state of a lock variable for at least one of a plurality of data processing devices in a data processing system having a plurality of data processing devices sharing a main memory. In a lock control system having a control device, there is provided a registration unit for registering at least one state of a lock variable, and a state holding unit for holding a state of the lock variable registered in the registration unit, wherein the state holding unit includes The first state indicates that it is unknown whether some of the plurality of lock control devices have acquired the lock and the other lock control devices have acquired the lock. A second state indicating that the lock has not been acquired also in the control device, and a case where some of the lock control devices have acquired the lock and other A third state indicating that the lock control device is in the first state, and indicating that the lock control device transitions to the second state in response to the unlock request; And a fourth state indicating that the state is changed to the second state in response to the unlock request.
The lock control system is characterized in that lock acquisition is performed at high speed.

【0009】また、第2の状態にあるロック変数に関し
てロックリクエストが発行された場合には他のロック制
御装置の状態を参照せずにロック確保成功であることを
判断する用にすれば好ましい。
[0009] Further, when a lock request is issued for a lock variable in the second state, it is preferable to determine success of lock securing without referring to the state of another lock control device.

【0010】さらに、第3,第4の状態にあるロック変
数に関してロックリクエストが発行された場合には他の
ロック制御装置にロックリクエストを伝えないようにす
ればより好ましい。
Further, when a lock request is issued for a lock variable in the third or fourth state, it is more preferable that the lock request is not transmitted to another lock control device.

【0011】またさらに、第3の状態にあるロック変数
に関してアンロックリクエストが発行された場合には他
のロック制御装置にアンロックリクエストを伝えないよ
うにすればより好ましい。
Furthermore, when an unlock request is issued for a lock variable in the third state, it is more preferable not to transmit the unlock request to another lock control device.

【0012】また、主記憶を共有する複数のデータ処理
装置を有するデータ処理システムにおける複数のデータ
処理装置の少なくとも1つに関するロック変数の状態を
それぞれ制御する複数のロック制御装置を制御するロッ
ク制御方法において、ロック変数の状態を少なくとも1
つ登録する登録手順と、登録手段に登録されたロック変
数の状態を保持する状態保持手順とを含み、状態保持手
順が、ロック変数の状態として、複数のロック制御装置
の一部がロックを取得しておらず、かつ他のロック制御
装置がロックを取得しているかは不明である旨を表す第
1の状態と、いずれのロック制御装置においてもロック
取得されていない旨を表す第2の状態と、複数のロック
制御装置の一部がロックを取得しておりかつ他のロック
制御装置が第1の状態にある旨を表し、かつアンロック
リクエストに対しては第2の状態に遷移する旨を表す第
3の状態と、いずれかのロック制御装置がロックを確保
しており、かつアンロックリクエストに対しては第2の
状態に遷移する旨を表す第4の状態とを含み、第2の状
態にあるロック変数に関してロックリクエストが発行さ
れた場合には他のロック制御装置の状態を参照せずにロ
ック確保成功であることを判断し、第3,第4の状態に
あるロック変数に関してロックリクエストが発行された
場合には他のロック制御装置にロックリクエストを伝え
ず、第3の状態にあるロック変数に関してアンロックリ
クエストが発行された場合には他のロック制御装置にア
ンロックリクエストを伝えないことを特徴とするロック
制御方法であれば良い。
Further, a lock control method for controlling a plurality of lock control devices for controlling a state of a lock variable relating to at least one of the plurality of data processing devices in a data processing system having a plurality of data processing devices sharing a main memory. The state of the lock variable is at least 1
And a state holding procedure for holding the state of the lock variable registered in the registration means, wherein the state holding procedure acquires a lock as a state of the lock variable by a part of the plurality of lock control devices. And a second state indicating that it is unknown whether another lock control device has acquired a lock and a second state indicating that no lock control device has acquired a lock. Indicates that some of the lock control devices have acquired the lock, and that the other lock control devices are in the first state, and that the lock control apparatus transitions to the second state in response to the unlock request. And a fourth state indicating that one of the lock control devices has secured the lock and that the lock control device transitions to the second state in response to the unlock request. Lock change When the lock request is issued, it is determined that the lock securing is successful without referring to the state of the other lock control devices, and the lock request is issued with respect to the lock variables in the third and fourth states. In this case, the lock request is not transmitted to the other lock control device, and when the unlock request is issued for the lock variable in the third state, the unlock request is not transmitted to the other lock control device. Any lock control method may be used.

【0013】[0013]

【発明の実施の形態】まず、本発明が適用されるデータ
処理システムについて図面を参照しながら詳細に説明す
る。
DESCRIPTION OF THE PREFERRED EMBODIMENTS First, a data processing system to which the present invention is applied will be described in detail with reference to the drawings.

【0014】図1は、本発明が適用されるデータ処理シ
ステムの全体構成を示すブロック図である。このシステ
ムは、記憶装置207を共有する4つの処理装置201
〜204を有する。そして、処理装置201および20
2がキャッシュユニット205に接続し、処理装置20
3および204がキャッシュユニット206に接続す
る。また、キャッシュユニット205および206と記
憶装置207とはシステムバス208を介して接続して
いる。キャッシュユニット205および206はそれぞ
れ接続する処理装置201〜204のためのキャッシュ
メモリとしての機能を有するとともに、ロック変数を保
持する機能をも有する。また、システムバス208は、
アドレスバスとデータバスとを含み、これらアドレスバ
スとデータバスとは独立して動作できる。ロックの取得
を要求するロックリクエストおよびロックの解放を要求
するアンロックリクエストはアドレスバスのみを使用す
る。さらに、システムバス208は、キャッシュ情報を
伝えるためのバスを含み、このバスを使用してロックリ
クエストに対するロック取得の可否が伝えられる。
FIG. 1 is a block diagram showing the overall configuration of a data processing system to which the present invention is applied. This system includes four processing devices 201 sharing the storage device 207.
To 204. Then, the processing devices 201 and 20
2 is connected to the cache unit 205 and the processing device 20
3 and 204 connect to the cache unit 206. The cache units 205 and 206 and the storage device 207 are connected via a system bus 208. Each of the cache units 205 and 206 has a function as a cache memory for the processing devices 201 to 204 to be connected, and also has a function of holding a lock variable. In addition, the system bus 208
An address bus and a data bus are included, and the address bus and the data bus can operate independently. A lock request that requests acquisition of a lock and an unlock request that requests release of a lock use only the address bus. Further, system bus 208 includes a bus for transmitting cache information, and is used to transmit whether or not a lock request can be acquired for a lock request.

【0015】図2は、本発明のキャシュユニットの構成
を示すブロック図である。キャッシュユニット205ま
たは206は、処理装置からのリクエストを保持するリ
クエストバッファ21およぴ22と、システムバス20
8に発行されたリクエストまたはリクエストバッファ2
1または22を選択するセレクタ23と、キャッシュメ
モリのアドレスアレイ24と、ロックリクエスト制御装
置25と、セレクタ23で選択されたリクエストまたは
ロックリクエスト制御装置25からのロック判定結果を
選択するセレクタ26および27とを有している。
FIG. 2 is a block diagram showing the configuration of the cache unit of the present invention. The cache unit 205 or 206 includes a request buffer 21 and a request buffer 22 for holding a request from the processing device, and a system bus 20.
Request or request buffer 2 issued to 8
A selector 23 for selecting 1 or 22; an address array 24 of the cache memory; a lock request controller 25; and selectors 26 and 27 for selecting a request selected by the selector 23 or a lock determination result from the lock request controller 25. And

【0016】リクエストバッファ21および22は、複
数のリクエストを保持し、それぞれ先入れ先出しバッフ
ァとして機能する。セレクタ23は、あらかじめ定めら
れた規則に従って、3入力の内から1つを選択する。例
えは、各入力から順番に選択するラウンドロビン方式を
使用することができる。また、システムバスからのリク
エストを最優先として扱う方式を使用することもでき
る。アドレスアレイ24は、通常のキャッシュメモリと
同様の構成を有し(図示しない)、データメモリの各エ
ントリに対応するタグアドレスを格納する。
The request buffers 21 and 22 hold a plurality of requests and each function as a first-in first-out buffer. The selector 23 selects one of the three inputs according to a predetermined rule. For example, a round robin method in which each input is sequentially selected can be used. Further, a method in which a request from the system bus is treated as the highest priority can be used. The address array 24 has the same configuration as a normal cache memory (not shown), and stores a tag address corresponding to each entry of the data memory.

【0017】セレクタ26及び27は、ロックリクエス
トに対するリプライを返す場合にはロックリクエスト制
御装置25の出力を選択し、キャッシュメモリの一致制
御を行う場合にはセレクタ23の出力を選択する。
The selectors 26 and 27 select the output of the lock request controller 25 when returning a reply to the lock request, and select the output of the selector 23 when performing cache memory match control.

【0018】図3は、本発明のロックリクエスト制御装
置の構成を示すブロック図である。ロックリクエスト制
御装置25は、セレクタ23により選択されたリクエス
トについてのロック変数のアドレスを格納するロックア
ドレスレジスタ1および2と、ロックアドレスレジスタ
1および2に格納されている各ロック変数に対するロッ
ク状態を格納するロックステータスレジスタ5および6
と、セレクタ23からのロック変数のアドレスとロック
アドレスレジスタ1およぴ2に保持されたアドレスを入
力してそれらの一致を検出するロックアドレス一致検出
回路3および4と、ロックアドレスー致検出回路3また
は4で一致が検出されたエントリに対するロックステー
タスレジスタ5または6の内容を選択するセレクタ7
と、ロックアドレスレジスタ1および2やロックステー
タスレジスタ5および6の状態を制御するロックリクエ
スト制御回路8とを備えている。
FIG. 3 is a block diagram showing the configuration of the lock request control device of the present invention. The lock request control device 25 stores the lock address registers 1 and 2 for storing the addresses of the lock variables for the request selected by the selector 23, and the lock state for each lock variable stored in the lock address registers 1 and 2. Lock status registers 5 and 6
Lock address match detection circuits 3 and 4 for inputting the address of the lock variable from selector 23 and the addresses held in lock address registers 1 and 2 to detect a match therebetween, and a lock address match detection circuit A selector 7 for selecting the contents of the lock status register 5 or 6 for the entry for which a match is detected in 3 or 4
And a lock request control circuit 8 for controlling the states of the lock address registers 1 and 2 and the lock status registers 5 and 6.

【0019】次に上記データ処理装置における、本発明
の実施例について図面を参照して説明する。
Next, an embodiment of the present invention in the data processing apparatus will be described with reference to the drawings.

【0020】図4は、本発明の実施例におけるロック変
数の状態を示す図である。本実施例におけるロック変数
は、ULE,ULS,LKE,およぴLKSの4つの状
態のいずれかをとる。LKEとは、当該キャッシュユニ
ットに接続するデータ処理装置がロックを確保してお
り、他のデータ処理装置がロックを確保していない状態
を表す。LKSは、システム内のいずれかのキャッシュ
ユニットにおいてロックが取得されていることを意味す
る。ロックを取得しているキャッシュユニットは自分自
身であるかもしれないし、他のキャッシュユニットであ
るかもしれない。また、ULSとは、当該キャッシュユ
ニットに接続するデータ処理装置はロックを確保してお
らず、他のデータ処理装置がロックを確保しているかは
不明である状態を表す。また、ULEとは、いずれのキ
ャッシュユニットに接続するデータ処理装置もロックを
確保していないことが確認されている状態を表す。ロッ
ク変数の状態がULEであれは、他のキャッシュユニッ
トのロック変数の状態をあらためて確認することなく、
ロックを取得することが可能となる。
FIG. 4 is a diagram showing the state of the lock variable in the embodiment of the present invention. The lock variable in the present embodiment takes one of four states, ULE, ULS, LKE, and LKS. LKE indicates a state in which the data processing device connected to the cache unit has secured the lock, and the other data processing devices have not secured the lock. LKS means that a lock has been acquired in any of the cache units in the system. The cache unit acquiring the lock may be itself or another cache unit. The ULS indicates a state in which the data processing device connected to the cache unit has not secured the lock, and it is unknown whether another data processing device has secured the lock. ULE indicates a state in which it has been confirmed that the lock is not secured by the data processing device connected to any of the cache units. If the state of the lock variable is ULE, the state of the lock variable of another cache unit is not checked again,
It becomes possible to acquire a lock.

【0021】図5は、本発明の実施例におけるロックリ
クエスト発生時の動作を示す図である。この図により、
データ処理装置からロックリクエストが発行された場合
の本実施例における動作について説明する。最左欄はロ
ックリクエストを発行したデータ処理装置に接続するキ
ャッシュユニットにおけるロック変数の状態を表し、中
欄はそれ以外のキャッシュユニットにおけるロック変数
の状態を表す。また、最右欄はそれぞれの場合における
動作を表す。なお、以下では、リクエストを発行したデ
ータ処理装置に接続するキャッシュユニットのことをロ
ーカルキャッシュユニットという。
FIG. 5 is a diagram showing an operation when a lock request occurs in the embodiment of the present invention. From this figure,
The operation in this embodiment when a lock request is issued from the data processing device will be described. The leftmost column shows the state of the lock variable in the cache unit connected to the data processing device that issued the lock request, and the middle column shows the state of the lock variable in the other cache units. The rightmost column shows the operation in each case. Hereinafter, a cache unit connected to the data processing device that has issued the request is referred to as a local cache unit.

【0022】例えば、ローカルキャッシュユニットのロ
ック変数の状態がLKSあるいはLKEであれは、すで
にロックが確保されていることになるので、ロック制御
装置は“ロック失敗”の結果を返す。また、ローカルキ
ャッシュユニットの状態がULEであれば、いずれのデ
ータ処理装置もロックを確保していないことがわかるの
で、ロック制御装置は“ロック成功”の結果を返すとと
もに、当該ロック変数の状態をLKEにする。
For example, if the state of the lock variable of the local cache unit is LKS or LKE, the lock has already been secured, and the lock control device returns a "lock failed" result. If the state of the local cache unit is ULE, it is known that no data processing device has secured the lock. Therefore, the lock control device returns a result of “lock succeeded” and changes the state of the lock variable. LKE.

【0023】また、ローカルキャッシュユニットのロッ
ク変数の状態がULSの場合は、ローカルキャッシュユ
ニット以外のキャッシュユニットのロック変数の状態を
参照しなけれはならなくなる。すなわち、ローカルキャ
ッシュユニット以外のキャッシュユニットのロック変数
の状態がLKSあるいはLKEであれば、ロック制御装
置は“ロック失敗”の結果を返す。また、その状態がU
LEであれば、ロック制御装置は“ロック成功”の結果
を返すとともに、ローカルキャッシュユニットのロック
変数の状態をLKEに、それ以外のキャッシュユニット
のロック変数の状態をULSにする。また、ローカルキ
ャッシュユニット以外のキャッシュユニットのロック変
数の状態がULSであるかまたはそのロックアドレスレ
ジスタに当該ロック変数が登録されていなけれは、ロッ
ク制御装置は“ロック成功”の結果を返すとともに、ロ
ーカルキャッシュユニットのロック変数の状態をLKE
にする。
When the state of the lock variable of the local cache unit is ULS, it is necessary to refer to the state of the lock variable of a cache unit other than the local cache unit. That is, if the state of the lock variable of the cache unit other than the local cache unit is LKS or LKE, the lock control device returns a result of “lock failure”. If the state is U
If it is LE, the lock control device returns a result of “lock succeeded”, and sets the state of the lock variable of the local cache unit to LKE and the state of the lock variable of the other cache units to ULS. If the status of the lock variable of the cache unit other than the local cache unit is ULS or the lock variable is not registered in the lock address register, the lock control device returns the result of “lock succeeded” and the local LKE status of lock variable of cache unit
To

【0024】また、ローカルキャッシュユニットに該当
するロック変数が登録されていない場合には、ローカル
キャッシュユニットのロック変数がULSの場合とはぼ
同様の処理を行う。但し、この場合には当該ロックアド
レスにかかるロック変数のアドレスをロックアドレスレ
ジスタに登録する。また、この時、ロックを確保できれ
ばそのロック変数の状態をLKEに、確保できなけれは
そのロック変数の状態をULSにする。
When the lock variable corresponding to the local cache unit is not registered, the same processing as when the lock variable of the local cache unit is ULS is performed. However, in this case, the address of the lock variable related to the lock address is registered in the lock address register. At this time, if the lock can be secured, the state of the lock variable is set to LKE. If the lock variable cannot be secured, the state of the lock variable is set to ULS.

【0025】図6は、本発明の実施例におけるアンロッ
クリクエスト発生時の動作を示す図である。この図によ
り、データ処理装置からアンロックリクエストが発行さ
れた場合の本実施例における動作について説明する。左
欄はロックリクエストを発行したデータ処理装置に接続
するキャッシュユニットにおけるロック変数の状態を表
し、右欄はそれぞれの場合における動作を表す。すなわ
ち、ローカルキャッシュユニットのロック変数の状態が
LKEであれば、ロックリクエスト制御装置はそのロッ
ク変数の状態をULEにする。また、ロックが取得され
ていない場合にアンロックリクエストは通常発生し得な
いため、ローカルキャッシュユニットのロック変数の状
態がULEやULSであることはあり得ない。また、該
当するロック変数が登録されていない場合にもアンロッ
クリクエストは通常発生し得ない。
FIG. 6 is a diagram showing an operation when an unlock request occurs in the embodiment of the present invention. With reference to this figure, an operation in the present embodiment when an unlock request is issued from the data processing device will be described. The left column shows the state of the lock variable in the cache unit connected to the data processing device that issued the lock request, and the right column shows the operation in each case. That is, if the state of the lock variable of the local cache unit is LKE, the lock request control device changes the state of the lock variable to ULE. Further, when a lock has not been acquired, an unlock request cannot normally occur, so that the state of the lock variable of the local cache unit cannot be ULE or ULS. In addition, even when the corresponding lock variable is not registered, an unlock request cannot normally occur.

【0026】図7は、本発明の実施例における動作の具
体例を示す図である。この図により、上記本実施例の特
徴について説明する。(A)は初期状態、(B)はアン
ロックリクエスト発行後の状態、(C)はロック取得後
の状態、(D)はロック確保失敗時の状態、(E)はロ
ックリクエスト解除後の状態を示している。
FIG. 7 is a diagram showing a specific example of the operation in the embodiment of the present invention. The features of the present embodiment will be described with reference to FIG. (A) is an initial state, (B) is a state after issuing an unlock request, (C) is a state after acquiring a lock, (D) is a state when lock securing fails, and (E) is a state after releasing a lock request. Is shown.

【0027】まず、(A)のように、左側のキャッシュ
ユニット205のロック変数の状態がULSで、右側の
キャッシュユニット206のロック変数の状態がLKE
であった場合に、右側のキャッシュユニット206でア
ンロックリクエストが発行されると、(B)のように、
この右側のキャッシュユニット206のロック変数の状
態がLKEからULEに更新される(図6参照)。この
状態で、右側のキャッシュユニット206で再びロック
リクエストが発行されると、(C)のように、他のキャ
ッシュユニット205の状態にかかわらず右側のキャッ
シュユニット206でロックを取得できる。すなわち、
右側のキャッシュユニット206のロック変数の状態が
LCKに更新される(図5参照)。この状態で左側のキ
ャッシュユニット205でロックリクエストが発行され
ると、ロック確保は失敗し、(D)のように、左側のキ
ャッシュユニット205のロック変数の状態がULSか
らLKSに更新され右側のキャッシュユニット206の
ロック変数の状態がLKEからLKSに更新される(図
5参照)。これにより、左側のキャッシュユニット20
5はロックリクエストを外部に発行しなくなる。この状
態が解放されるのは、右側のキャッシュユニット206
でアンロックリクエストが発行されたときである。すな
わち、この場合には、(E)のように、左側のキャッシ
ュユニット205のロック変数の状態がULSとなるた
め(図6参照)、再びロックリクエストを外部へ発行す
ることが可能となる。
First, as shown in (A), the state of the lock variable of the left cache unit 205 is ULS, and the state of the lock variable of the right cache unit 206 is LKE.
When an unlock request is issued by the right cache unit 206, as shown in FIG.
The state of the lock variable of the right cache unit 206 is updated from LKE to ULE (see FIG. 6). In this state, when the lock request is issued again by the right cache unit 206, the lock can be acquired by the right cache unit 206 regardless of the state of the other cache units 205 as shown in FIG. That is,
The state of the lock variable of the right cache unit 206 is updated to LCK (see FIG. 5). When a lock request is issued in the left cache unit 205 in this state, lock securing fails, and the state of the lock variable of the left cache unit 205 is updated from ULS to LKS and the right cache The state of the lock variable of the unit 206 is updated from LKE to LKS (see FIG. 5). As a result, the left cache unit 20
No. 5 does not issue a lock request to the outside. This state is released by the right cache unit 206.
Is when the unlock request is issued. That is, in this case, as shown in (E), the state of the lock variable of the left cache unit 205 becomes ULS (see FIG. 6), so that the lock request can be issued to the outside again.

【0028】このように、本発明の実施例によれば、ロ
ック変数の状態ULEを設けたことにより、ロック解放
後のロック取得を高速に行うことができ、また、ロック
変数の状態LK8を設けたことによりロック確保失敗後
の無駄なロックリクエスト発行を抑制することができ
る。更にロック変数の状態LKEを設けたことにより、
LKEの状態からロックを解放するために他のキャッシ
ュユニットを操作する必要がなくなるという効果があ
る。
As described above, according to the embodiment of the present invention, by providing the lock variable state ULE, it is possible to obtain the lock after releasing the lock at high speed, and to provide the lock variable state LK8. As a result, it is possible to suppress unnecessary issuance of a lock request after lock failure. Furthermore, by providing the lock variable state LKE,
There is an effect that it is not necessary to operate another cache unit to release the lock from the LKE state.

【0029】[0029]

【発明の効果】以上説明したように本発明によれは、ロ
ックアドレスレジスタに対応して各種ロック変数の状態
を設けることにより、ロックリクエストを発行した中央
処理装置に直接接続されていないセカンドキャッシュヘ
のロック変数の参照を不要にする。これにより、ロック
取得を高速にするとともに、不必要なバスアクセスを無
くしてバストラフィックの増大を削減するという効果が
ある。
As described above, according to the present invention, by providing the status of various lock variables in correspondence with the lock address register, the status of the second cache which is not directly connected to the central processing unit which has issued the lock request is provided. Eliminates the need to reference a lock variable. This has the effect of increasing the speed of lock acquisition and eliminating unnecessary bus access to reduce the increase in bus traffic.

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

【図1】本発明が適用されるデータ処理システムの全体
構成を示すブロック図である。
FIG. 1 is a block diagram showing an overall configuration of a data processing system to which the present invention is applied.

【図2】本発明のキャッシュユニットの構成を示すブロ
ック図である。
FIG. 2 is a block diagram illustrating a configuration of a cache unit according to the present invention.

【図3】本発明のロックリクエスト制御装置の構成を示
すブロック図である。
FIG. 3 is a block diagram showing a configuration of a lock request control device of the present invention.

【図4】本発明の実施例におけるロック変数の状態を示
す図である。
FIG. 4 is a diagram illustrating a state of a lock variable according to the embodiment of the present invention.

【図5】本発明の実施例におけるロックリクエスト発生
時の動作を示す図である。
FIG. 5 is a diagram illustrating an operation when a lock request occurs in the embodiment of the present invention.

【図6】本発明の実施例におけるアンロックリクエスト
発生時の動作を示す図である。
FIG. 6 is a diagram illustrating an operation when an unlock request occurs in the embodiment of the present invention.

【図7】本発明の実施例における動作の具体例を示す図
である。(A)は初期状態、(B)はアンロックリクエ
スト発行後の状態、(C)はロック取得後の状態、
(D)はロック確保失敗時の状態、(E)はロックリク
エスト解除後の状態を示す。
FIG. 7 is a diagram showing a specific example of an operation in the embodiment of the present invention. (A) is an initial state, (B) is a state after issuing an unlock request, (C) is a state after acquiring a lock,
(D) shows the state at the time of lock failure, and (E) shows the state after the lock request is released.

【符号の説明】[Explanation of symbols]

1,2 ロックアドレスレジスタ 3,4 ロックアドレスー致検出回路 5,6 ロックステータスレジスタ 7 セレクタ 8 ロックリクエスト制御回路 21,22 リクエストバッファ 23 セレクタ 24 アドレスアレイ 25 ロックリクエスト制御装置 26,27 セレクタ 28,29 バッファ 201〜204 処理装置 205、206 キャッシュユニット 207 記憶装置 208 システムバス 1, 2 Lock Address Register 3, 4 Lock Address Match Detection Circuit 5, 6 Lock Status Register 7 Selector 8 Lock Request Control Circuit 21, 22 Request Buffer 23 Selector 24 Address Array 25 Lock Request Control Device 26, 27 Selector 28, 29 Buffers 201 to 204 Processing device 205, 206 Cache unit 207 Storage device 208 System bus

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】主記憶を共有する複数のデータ処理装置を
有するデータ処理システム内にあり、前記複数のデータ
処理装置の少なくとも1つに関するロック変数の状態を
それぞれ制御する複数のロック制御装置を有するロック
制御システムにおいて、 前記ロック変数の状態を少なくとも1つ登録する登録手
段と、 前記登録手段に登録されたロック変数の状態を保持する
状態保持手段と、 を備え、 前記状態保持手段が、 前記ロック変数の状態として、前記複数のロック制御装
置の一部がロックを取得しておらず、かつ他のロック制
御装置がロックを取得しているかは不明である旨を表す
第1の状態と、 いずれのロック制御装置においてもロック取得されてい
ない旨を表す第2の状態と、 前記複数のロック制御装置の一部がロックを取得してお
りかつ他のロック制御装置が前記第1の状態にある旨を
表し、かつアンロックリクエストに対しては前記第2の
状態に遷移する旨を表す第3の状態と、 いずれかのロック制御装置がロックを確保しており、か
つアンロックリクエストに対しては前記第2の状態に遷
移する旨を表す第4の状態とを有し、 ロック取得を高速にすることを特徴とするロック制御シ
ステム。
1. A data processing system having a plurality of data processing devices sharing a main memory, wherein the plurality of lock control devices respectively control a state of a lock variable relating to at least one of the plurality of data processing devices. A lock control system, comprising: a registration unit that registers at least one state of the lock variable; and a state holding unit that holds a state of the lock variable registered in the registration unit. A first state indicating that some of the plurality of lock control devices have not acquired a lock and it is unknown whether another lock control device has acquired a lock, as the state of the variable; A second state indicating that lock has not been acquired also in the lock control device of the above, and a part of the plurality of lock control devices has acquired a lock. And a third state indicating that another lock control device is in the first state, and indicating that the lock control device makes a transition to the second state in response to an unlock request. A lock control system that secures a lock, and has a fourth state that indicates a transition to the second state in response to an unlock request, so that lock acquisition is performed at high speed. .
【請求項2】前記第2の状態にあるロック変数に関して
ロックリクエストが発行された場合には他のロック制御
装置の状態を参照せずにロック確保成功であることを判
断することを特徴とする請求項1に記載のロック制御シ
ステム。
2. When a lock request is issued for a lock variable in the second state, it is determined that lock securing has succeeded without referring to the state of another lock control device. The lock control system according to claim 1.
【請求項3】前記第3,第4の状態にあるロック変数に
関してロックリクエストが発行された場合には他のロッ
ク制御装置に前記ロックリクエストを伝えないことを特
徴とする請求項1または2に記載のロック制御システ
ム。
3. The lock control device according to claim 1, wherein when a lock request is issued for the lock variables in the third and fourth states, the lock request is not transmitted to another lock control device. A lock control system as described.
【請求項4】前記第3の状態にあるロック変数に関して
アンロックリクエストが発行された場合には他のロック
制御装置に前記アンロックリクエストを伝えないことを
特徴とする、請求項1〜3のいずれかに記載のロック制
御システム。
4. The lock control device according to claim 1, wherein when an unlock request is issued for the lock variable in the third state, the unlock request is not transmitted to another lock control device. The lock control system according to any one of the above.
【請求項5】主記憶を共有する複数のデータ処理装置を
有するデータ処理システム内において、前記複数のデー
タ処理装置の少なくとも1つに関するロック変数の状態
をそれぞれ制御する複数のロック制御装置を制御するロ
ック制御方法において、 前記ロック変数の状態を少なくとも1つ登録する登録手
順と、 前記登録手段に登録されたロック変数の状態を保持する
状態保持手順と、 を含み、 前記状態保持手順が、 前記ロック変数の状態として、前記複数のロック制御装
置の一部がロックを取得しておらず、かつ他のロック制
御装置がロックを取得しているかは不明である旨を表す
第1の状態と、 いずれのロック制御装置においてもロック取得されてい
ない旨を表す第2の状態と、 前記複数のロック制御装置の一部がロックを取得してお
りかつ他のロック制御装置が前記第1の状態にある旨を
表し、かつアンロックリクエストに対しては前記第2の
状態に遷移する旨を表す第3の状態と、 いずれかのロック制御装置がロックを確保しており、か
つアンロックリクエストに対しては前記第2の状態に遷
移する旨を表す第4の状態とを含み、 前記第2の状態にあるロック変数に関してロックリクエ
ストが発行された場合には他のロック制御装置の状態を
参照せずにロック確保成功であることを判断し、 前記第3,第4の状態にあるロック変数に関してロック
リクエストが発行された場合には他のロック制御装置に
前記ロックリクエストを伝えず、前記第3の状態にある
ロック変数に関してアンロックリクエストが発行された
場合には他のロック制御装置に前記アンロックリクエス
トを伝えないことを特徴とするロック制御方法。
5. In a data processing system having a plurality of data processing devices sharing a main memory, a plurality of lock control devices for controlling states of lock variables relating to at least one of the plurality of data processing devices are controlled. A lock control method, comprising: a registration step of registering at least one state of the lock variable; and a state holding step of holding the state of the lock variable registered in the registration unit. A first state indicating that some of the plurality of lock control devices have not acquired a lock and it is unknown whether another lock control device has acquired a lock, as the state of the variable; A second state indicating that lock has not been acquired also in the lock control device of the above, and a part of the plurality of lock control devices has acquired a lock. And a third state indicating that another lock control device is in the first state, and indicating that the lock control device makes a transition to the second state in response to an unlock request. A lock request is issued for a lock variable in the second state, and a fourth state indicating that the lock state is transited to the second state in response to the unlock request. If the lock request is issued for the lock variables in the third and fourth states, it is determined that the lock securing is successful without referring to the state of the other lock control device. If the lock request is not transmitted to the lock controller and an unlock request is issued for the lock variable in the third state, the unlock request is sent to another lock controller. Lock control method, characterized in that it does not convey.
JP25125896A 1996-09-24 1996-09-24 System and method for lock control Pending JPH1097507A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP25125896A JPH1097507A (en) 1996-09-24 1996-09-24 System and method for lock control

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP25125896A JPH1097507A (en) 1996-09-24 1996-09-24 System and method for lock control

Publications (1)

Publication Number Publication Date
JPH1097507A true JPH1097507A (en) 1998-04-14

Family

ID=17220107

Family Applications (1)

Application Number Title Priority Date Filing Date
JP25125896A Pending JPH1097507A (en) 1996-09-24 1996-09-24 System and method for lock control

Country Status (1)

Country Link
JP (1) JPH1097507A (en)

Similar Documents

Publication Publication Date Title
US5875485A (en) Lock control for a shared main storage data processing system
US4733352A (en) Lock control for a shared storage in a data processing 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
US7472237B1 (en) Apparatus to offload and accelerate pico code processing running in a storage processor
US6076126A (en) Software locking mechanism for locking shared resources in a data processing system
JPH03118649A (en) Memory subsystem input que
US20040059818A1 (en) Apparatus and method for synchronizing multiple accesses to common resources
JPH0532775B2 (en)
US6490662B1 (en) System and method for enhancing the reliability of a computer system by combining a cache sync-flush engine with a replicated memory module
JP2776759B2 (en) Lock request control device
EP0291907B1 (en) Interprocessor communication system in information processing system enabling communication between execution processor units during communication between other processor units
JP2000003302A (en) Method for controlling exclusive access of common memory
JP2826483B2 (en) Lock control device
JPH1097507A (en) System and method for lock control
US6389519B1 (en) Method and apparatus for providing probe based bus locking and address locking
JP3037241B2 (en) Lock control device
JP3381079B2 (en) Exclusive control system using cache memory
JPH10333973A (en) Exclusive controller and data processing system
JP2742246B2 (en) Lock request control mechanism
JP2848437B2 (en) Multi-cluster exclusive control unit
JPH11353232A (en) Cache control method of hierarchical bus constitution multiprocessor system
JPH0962633A (en) Network control unit
JP2636760B2 (en) Multiprocessor system
JPH08320828A (en) Multiprocessor system