JPH0454662A - Exclusive access control system for shared resources - Google Patents
Exclusive access control system for shared resourcesInfo
- Publication number
- JPH0454662A JPH0454662A JP16416590A JP16416590A JPH0454662A JP H0454662 A JPH0454662 A JP H0454662A JP 16416590 A JP16416590 A JP 16416590A JP 16416590 A JP16416590 A JP 16416590A JP H0454662 A JPH0454662 A JP H0454662A
- Authority
- JP
- Japan
- Prior art keywords
- resources
- access
- shared resource
- shared
- instruction
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 230000007246 mechanism Effects 0.000 claims abstract description 16
- 238000000034 method Methods 0.000 claims description 11
- 238000010586 diagram Methods 0.000 description 7
- 230000000694 effects Effects 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 238000007796 conventional method Methods 0.000 description 1
Abstract
Description
【発明の詳細な説明】
(産業上の利用分野)
本発明は、複数のプロセッサと共有資源とから成るマル
チプロセッサシステムにおける共有資源の排他的アクセ
ス制御方式に関する。DETAILED DESCRIPTION OF THE INVENTION (Field of Industrial Application) The present invention relates to an exclusive access control method for shared resources in a multiprocessor system comprising a plurality of processors and shared resources.
(従来の技術)
マルチプロセッサシステムにおいては、複数のプロセッ
サが主記憶装置や磁気ディスク装置等の資源を共有して
いる。このような資源を共有資源という。また、マルチ
プロセッサシステムでは、あるプロセッサがある共有資
源を使用する際に、その共有資源が他のプロセッサによ
って使用されないようにしている。これは、共有資源に
記憶されたデータの破壊等を防止するためである。この
ように、あるプロセッサによって共有資源を独占するア
クセスを排他的アクセスと呼ぶ。(Prior Art) In a multiprocessor system, a plurality of processors share resources such as a main storage device and a magnetic disk device. Such resources are called shared resources. Furthermore, in a multiprocessor system, when a certain processor uses a certain shared resource, the shared resource is prevented from being used by other processors. This is to prevent data stored in the shared resource from being destroyed. Such access to monopolize shared resources by a certain processor is called exclusive access.
第2図は、従来の共有資源の排他的アクセス制御方式を
適用したシステムの構成図である。FIG. 2 is a configuration diagram of a system to which a conventional shared resource exclusive access control method is applied.
図示のシステムは、システムバス20に接続された、複
数のプロセッサ21.22.23と、資源24.25と
から成る。The illustrated system consists of a plurality of processors 21, 22, 23 and resources 24, 25 connected to a system bus 20.
プロセッサ21.22.23は、それぞれシステムバス
20を介して資源24又は25をアクセスする。これら
のプロセッサ21.22.23は、資源24又は25の
いずれもアクセスすることができる。Processors 21, 22, 23 each access resources 24 or 25 via system bus 20. These processors 21.22.23 can access any of the resources 24 or 25.
資源24.25は、主記憶装置又は磁気ディスク装置等
から成るものである。資源24内には、共有資源26及
び27がある。共有資源26及び27は、あるプロセッ
サによって独占されているか否かが他の共有資源内にあ
る共有変数によって表わされる。The resources 24 and 25 consist of a main storage device, a magnetic disk device, or the like. Within resources 24 are shared resources 26 and 27. Whether or not shared resources 26 and 27 are monopolized by a certain processor is represented by a shared variable in another shared resource.
第3図は、プロセッサが共有資源をアクセスする処理手
順を示すフローチャートである。FIG. 3 is a flowchart showing a processing procedure for a processor to access a shared resource.
例えば、プロセッサ21が共有資源24をアクセスする
場合について、説明する。まず、共有資源26の共有変
数P。を読む(ステップ531)。この共有変数PDは
、共有資源27内に記憶されている。共有変数Poは、
例えば、“O”又は“l”の1ビツトから成り、“0”
が共有資源が独占されていない状態を示し、“1′。For example, a case where the processor 21 accesses the shared resource 24 will be described. First, the shared variable P of the shared resource 26. (step 531). This shared variable PD is stored within the shared resource 27. The shared variable Po is
For example, it consists of one bit of “O” or “l”, and “0”
indicates that the shared resource is not monopolized, and is "1'".
が共有資源が独占されている状態を示す。indicates that a shared resource is monopolized.
共有変数Poによって共有資源26の独占状態を判別し
くステップ532) 、独占されていなければ、その共
有変数PDを独占されている状態“l”に書き替える(
ステップ533)。その後、プロセッサ21は、共有資
源26を独占し、所定の処理を行なう(ステップ534
) そして、この処理の終了後は、共有変数を○゛に戻
す(ステップ535)。The monopolized state of the shared resource 26 is determined by the shared variable Po (step 532), and if it is not monopolized, the shared variable PD is rewritten to the monopolized state "l" (
Step 533). Thereafter, the processor 21 monopolizes the shared resource 26 and performs predetermined processing (step 534
) After this process is completed, the shared variable is returned to ○゛ (step 535).
このとき、プロセッサ21とプロセッサ22が共有資源
26を同時に使おうとしたとする。プロセッサ21は、
共有資源Poを読んで独占されていないことを検知して
、この共有変数PDを独占する旨“l”に書き替える。At this time, it is assumed that the processor 21 and the processor 22 try to use the shared resource 26 at the same time. The processor 21 is
It reads the shared resource Po, detects that it is not monopolized, and rewrites the shared variable PD to "l" indicating that it is monopolized.
その書き替えの直前に、プロセッサ22が同じ共有変数
P。を読んだとすると、プロセッサ22は、まだ独占さ
れていないと検知する。従って、プロセッサ22もプロ
セッサ21と同時に共有資源26を使うことができる。Immediately before the rewriting, the processor 22 uses the same shared variable P. , the processor 22 detects that it is not yet monopolized. Therefore, the processor 22 can also use the shared resource 26 at the same time as the processor 21 .
この結果、共有資源26に対し、アクセスの衝突が起こ
り、データが破壊される。As a result, an access conflict occurs with respect to the shared resource 26, and data is destroyed.
このようなアクセスの衝突が生じないように、共有変数
を読んでから再び書込むまでは、他のプロセッサからの
アクセスを排除するようにされる。このため、従来は、
システムバス2oを独占していた。これをバスロックと
いう。To prevent such an access conflict from occurring, access from other processors is excluded from the time the shared variable is read until it is written again. For this reason, conventionally,
It monopolized system bus 2o. This is called bass lock.
そして、共有資源の書込みが終了した時点でバスのロッ
クを解除する。バスがロックされている間は、共有資源
には他からのアクセスはないのでアクセスが衝突する心
配はない。Then, when writing of the shared resource is completed, the bus is unlocked. While the bus is locked, there are no other accesses to the shared resources, so there is no need to worry about access conflicts.
(発明が解決しようとする課題)
しかしながら、上述した従来の技術には、次のような問
題があった。(Problems to be Solved by the Invention) However, the above-described conventional technology has the following problems.
即ち、共有変数の内容をプロセッサ21によって読まれ
てから更新し終わるまで他のプロセッサ22.23は、
何もできない状態である。つまり、従来のシステムパス
20全体をロックする方式では、特定の共有変数PD以
外で管理される資源に対してもアクセスを禁止してしま
うため、システムバス2oの占有率が高くなるだけでな
く、資源24.25の占有率が高くなってしまった。That is, after the content of the shared variable is read by the processor 21 until it is updated, the other processors 22 and 23
I am in a state where I can't do anything. In other words, the conventional method of locking the entire system path 20 prohibits access to resources managed other than the specific shared variable PD, which not only increases the occupancy rate of the system bus 2o, but also The occupancy rate of resource 24.25 has become high.
従って、データ処理が合理的に行なわれず、システムの
スルーブツトが低下するという問題があった。Therefore, there is a problem in that data processing is not performed rationally and the throughput of the system is reduced.
本発明は以上の点に着目して、なされたもので、排他的
アクセスによるシステムのスルーブツトの低下を防止す
るため、システムバス及び資源の占有率を低くできるよ
うにした共有資源の排他的アクセス制御方式を提供する
ことを目的とするものである。The present invention has been made in view of the above points, and is an exclusive access control for shared resources that can reduce the occupation rate of the system bus and resources in order to prevent a decrease in system throughput due to exclusive access. The purpose is to provide a method.
(課題を解決するための手段)
本発明の共有資源の排他的アクセス制御方式は、各々別
個の処理を行なう複数のプロセッサと、当該複数のプロ
セッサにより共通に使用される共有資源と、前記プロセ
ッサが前記共有資源をアクセスするときに、当該共有資
源にロック及びアンロックを通知する通知手段と、当該
通知手段からの通知によって前記共有資源をロック及び
アンロックする制御機構とを備えたことを特徴とするも
のである。(Means for Solving the Problems) The shared resource exclusive access control system of the present invention provides for a plurality of processors that each perform separate processing, a shared resource that is commonly used by the plurality of processors, and a shared resource that the processors When accessing the shared resource, the shared resource is characterized by comprising: a notification unit that notifies the shared resource of locking and unlocking; and a control mechanism that locks and unlocks the shared resource based on the notification from the notification unit. It is something to do.
(作用)
本発明の共有資源の排他的アクセス制御方式においては
、プロセッサが共有資源をアクセスする場合に、通知手
段によって共有資源のロックを通知し、制御機構がこの
通知を受けて当該共有資源のみをロックする。この状態
で当該プロセッサは、共有資源をアクセスする。アクセ
スの終了後は、通知手段が共有資源のアンロックを通知
し、制御機構がこの通知を受けてロックを解除する。(Operation) In the shared resource exclusive access control system of the present invention, when a processor accesses a shared resource, the notification means notifies the locking of the shared resource, and upon receiving this notification, the control mechanism only controls the shared resource. lock. In this state, the processor accesses the shared resource. After the access is completed, the notification means notifies the shared resource to be unlocked, and the control mechanism receives this notification and releases the lock.
従って、システムバスがロックされることはなく、資源
の有効利用が図れ、システムのスルーブツトが向上する
。Therefore, the system bus is not locked, resources can be used effectively, and system throughput is improved.
(実施例)
第1図は、本発明の共有資源の排他的アクセス制御方式
を適用したシステムの実施例のブロック図である。(Embodiment) FIG. 1 is a block diagram of an embodiment of a system to which the shared resource exclusive access control method of the present invention is applied.
図示のシステムは、システムバス10に接続された、複
数のプロセッサ11.12.13と、資源14.15と
、制御機構18.19とから成る。The illustrated system consists of a plurality of processors 11.12.13, resources 14.15 and control mechanisms 18.19 connected to a system bus 10.
プロセッサ11.12.13は、それぞれシステムバス
10を介して資源14又は15をアクセスする。これら
のプロセッサ11.12.13は、資源14又は15の
いずれもアクセスすることができる。また、これらのプ
ロセッサ11.12.13は、通知手段41.42.4
3を備えている。Processors 11, 12, 13 each access resources 14 or 15 via system bus 10. These processors 11.12.13 can access any of the resources 14 or 15. These processors 11.12.13 also have notification means 41.42.4.
It has 3.
通知手段41.42.43は、制御機構18又は19に
共有資源のロック又はアンロックを通知する。The notification means 41, 42, 43 notifies the control mechanism 18 or 19 of locking or unlocking of the shared resource.
資源14.15は、主記憶装置又は磁気ディスク装置等
から成るものである。これらの資源14.15は、同様
のものであるので、資源14についてのみ説明する。資
源14内には、共有資源16及び17がある。共有資源
16及び17は、あるプロセッサによって独占されてい
るか否かが制御機構18によって管理される。また、資
源14内には、特定のプロセッサからしかアクセスでき
ない専用資源44がある。The resources 14 and 15 consist of a main storage device, a magnetic disk device, and the like. Since these resources 14, 15 are similar, only resource 14 will be described. Within resources 14 are shared resources 16 and 17. A control mechanism 18 manages whether the shared resources 16 and 17 are monopolized by a certain processor. Further, within the resources 14, there is a dedicated resource 44 that can only be accessed by a specific processor.
制御機構18及び19は、それぞれ資源14及び15の
ロック及びアンロックを制御する。これらは、同様の構
成であるので、制御機構18についてのみ説明する。Control mechanisms 18 and 19 control locking and unlocking of resources 14 and 15, respectively. Since these have similar configurations, only the control mechanism 18 will be described.
制御機構18は、資源14についてその排他制御の管理
を行なう。共有資源16.17へのアクセスは、読み出
し、更新、書込みのように、命令1−更新−命令2の形
を取る。命令1から命令2の間にアクセスされている共
有資源16又は17は、ロックされなければならない。The control mechanism 18 manages exclusive control of the resources 14. Access to shared resources 16.17 takes the form of instruction 1-update-instruction 2, such as read, update, write. The shared resource 16 or 17 being accessed between instruction 1 and instruction 2 must be locked.
即ち、初めの命令1でアクセスのあった部分をロックし
、命令2でロックを解除する。そのため、命令1は、ロ
ック付アクセスとし、命令2はアンロック付アクセスと
する。That is, the first instruction 1 locks the accessed portion, and the instruction 2 unlocks it. Therefore, instruction 1 is access with lock, and instruction 2 is access with unlock.
第4図は、制御機構の機能図である。FIG. 4 is a functional diagram of the control mechanism.
図示の■〜■は、入力で、■〜■は、出力である。In the figure, ■ to ■ are inputs, and ■ to ■ are outputs.
■は、その資源内のアクセスがあったことを通知する。■ notifies that the resource has been accessed.
■は、■のアクセスがロック付であることを示す。■ indicates that the access of ■ is locked.
■は、■のアクセスがアンロック付であることを示す。■ indicates that access to ■ is unlocked.
■は、■とともにアクセスするアドレスを通知する。こ
のアドレスにより、共有資源16又は17へのアクセス
か専用資源44へのアクセスかが区別される。そして、
制御機構18の内部でそれぞれのアドレスについてロッ
ク中であるかアンロック中であるかを記憶しておく。■ together with ■ notifies the address to be accessed. This address distinguishes whether the access is to the shared resource 16 or 17 or the dedicated resource 44. and,
Inside the control mechanism 18, it is stored whether each address is locked or unlocked.
■〜■は、(1)共有資源へのアクセスの場合、及び(
2)専用資源へのアクセスの場合に以下の応答を行なう
。■~■: (1) In the case of access to shared resources, and (
2) Perform the following response when accessing a dedicated resource.
(1)共有資源へのアクセスの場合
共有資源におけるあるアドレスの状態とそのとききたア
クセスの種類との関係による応答は、次の(a)〜(d
)のようになる。(1) In the case of access to a shared resource, the response based on the relationship between the state of a certain address in the shared resource and the type of access that occurred at that time is as follows (a) to (d)
)become that way.
(a)アンロック状態でロック付アクセスがきたときは
、■のアクルッジ通知が出力されるとともに、ロック状
態になる。(a) When access with lock comes in the unlocked state, the access notification (■) is output and the device becomes locked.
(b)アンロック状態でアンロック付アクセスがきたと
きは、■のアクルッジ通知が出力されるとともに、■の
エラー通知が出力される。(b) When an unlocked access is received in the unlocked state, an access notification (■) is output, and an error notification (■) is output.
(c)ロック状態でロック付アクセスがきたときは、■
のアクルッジ通知が出力されるとともに、■のビジー通
知が出力される。(c) When access with lock comes in the locked state, ■
At the same time, the ``Access'' notification is output, and the ``Busy'' notification is output.
(d)ロック状態でアンロック付アクセスがきたときは
、■のアクルッジ通知が出力されるとともに、アンロッ
ク状態になる。(d) When an unlocked access is received in the locked state, the access notification (■) is output and the device becomes in the unlocked state.
(2)専用資源へのアクセスの場合
専用領域におけるアドレスの状態は、常に同じであり、
アクセスがきたときは、アクノレツジを出すのみである
。(2) When accessing a dedicated resource, the state of the address in the dedicated area is always the same,
When access is received, it only issues an acknowledgement.
第5図は、本発明に係るシステムの動作を示すタイムチ
ャートである。FIG. 5 is a time chart showing the operation of the system according to the present invention.
図中アクセスな■〜■で示し、トランザクションを■〜
■で示す。In the diagram, access is indicated by ■~■, and transactions are indicated by ■~
Indicated by ■.
アドレスdで始まる共有資源りがアンロック状態の時に
、ロック付リードがきたとき(第5図の■のアクセス時
)の出力は、受は取ったことを通知するアクノレツジ(
e)を出す。共有資源りは、ロックされ、共有資源りの
データをアクセスしたプロセッサに渡す(トランザクシ
ョン@)。When the shared resource starting at address d is in the unlocked state and a read with lock is received (at the time of access marked ■ in Figure 5), the output is an acknowledgment (
Issue e). The shared resource is locked and the data in the shared resource is passed to the processor that accessed it (transaction@).
その後、アドレスeで始まる共有資源Eにロック付リー
ドがきても、アクセス■のとき、同様に共有資源Eをア
クセスできる(トランザクション■)。After that, even if a read with lock comes to the shared resource E starting at address e, the shared resource E can be accessed in the same way when accessing ■ (transaction ■).
アドレスdで始まる共有資源りがロック状態のとき、ロ
ック付リードがきた場合(■のアクセス時)は、アクノ
レツジ(e)と、ロック中であることを示すビジー(f
)を出す。このときのプロセッサは共有資源りからデー
タを読み出すことができないので、リトライする。When the shared resource starting at address d is in the locked state, if a read with lock comes (when accessing ■), an acknowledge (e) and a busy (f
). Since the processor at this time cannot read data from the shared resource, it retries.
共有資源りがロック状態のとき、アンロック付ライトが
きた場合(■のアクセス時)、アクノレツジ(e)を返
し、データを共有資源りに書込み(トランザクション■
)、アドレスdのロック状態を解除し、アンロック状態
となる。When the shared resource is locked and a write with unlock is received (when accessing ■), an acknowledgment (e) is returned and data is written to the shared resource (transaction ■).
), the address d is unlocked and becomes unlocked.
共有資源りがアンロック状態のときに、アンロック付ア
クセスがきたとき(■のアクセス時)、アクノレツジ(
e)を出し、エラー(g)を出す。When the shared resource is in the unlocked state, when access with unlock comes (when accessing ■), acknowledgment (
e) and error (g).
一方、専用資源へのアクセスの場合は、その資源を占有
しているプロセッサは、第6図に示すようにアクノレツ
ジを出すことにより、データを自由にアクセスできる。On the other hand, when accessing a dedicated resource, the processor occupying the resource can freely access data by issuing an acknowledgment as shown in FIG.
(発明の効果)
以上説明したように、本発明によれば、あるプロセッサ
が共有資源をアクセスするときに、システムバスなロッ
クするのではなく、アクセスの対象となる部分のみをロ
ックできるようにしたので、次のような効果がある。(Effects of the Invention) As explained above, according to the present invention, when a processor accesses a shared resource, it is possible to lock only the part to be accessed, instead of locking the system bus. Therefore, it has the following effects.
即ち、資源のロック中もシステムバスを使用でき、他の
プロセッサが資源のロックされていない部分へのアクセ
スを行なうことができる。従って、メモリ等の資源の占
有率を下げることができる。この結果、スループットを
向上させることができ、システムの性能の向上を図るこ
とができる。That is, the system bus can be used even while the resources are locked, and other processors can access unlocked portions of the resources. Therefore, the occupation rate of resources such as memory can be reduced. As a result, throughput can be improved and system performance can be improved.
第1図は本発明の共有資源の排他的アクセス制御方式を
適用したシステムの実施例のブロック図、第2図は従来
の共有資源の排他的アクセス制御方式を適用したシステ
ムの構成図、第3図は共有資源をアクセスする処理手順
を示すフローチャート、第4図は制御機構の機能図、第
5図は本発明に係るシステムの動作を示すタイムチャー
トである。
O・・・システムバス、
1.12.13・・・プロセッサ、
4.15・・・資源、16.17・・・共有資源、8.
19・・・制御機構。
: 共有変数
: 独占されていない
: 独占されている
共有資源をアクセスする処理手順
第3図FIG. 1 is a block diagram of an embodiment of a system to which the shared resource exclusive access control method of the present invention is applied, FIG. 2 is a block diagram of a system to which the conventional shared resource exclusive access control method is applied, and FIG. The figure is a flowchart showing the processing procedure for accessing shared resources, FIG. 4 is a functional diagram of the control mechanism, and FIG. 5 is a time chart showing the operation of the system according to the present invention. O...System bus, 1.12.13...Processor, 4.15...Resource, 16.17...Shared resource, 8.
19...Control mechanism. : Shared variable: Not monopolized: Processing procedure for accessing monopolized shared resources Figure 3
Claims (1)
のプロセッサにより共通に使用される共有資源と、 前記プロセッサが前記共有資源をアクセスするときに、
当該共有資源にロック及びアンロックを通知する通知手
段と、 当該通知手段からの通知によって前記共有資源をロック
及びアンロックする制御機構とを備えたことを特徴とす
る共有資源の排他的アクセス制御方式。[Scope of Claims] A plurality of processors each performing separate processing, a shared resource commonly used by the plurality of processors, and when the processor accesses the shared resource,
An exclusive access control method for a shared resource, comprising: a notification unit that notifies the shared resource of locking and unlocking; and a control mechanism that locks and unlocks the shared resource based on the notification from the notification unit. .
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP16416590A JPH0454662A (en) | 1990-06-25 | 1990-06-25 | Exclusive access control system for shared resources |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP16416590A JPH0454662A (en) | 1990-06-25 | 1990-06-25 | Exclusive access control system for shared resources |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH0454662A true JPH0454662A (en) | 1992-02-21 |
Family
ID=15787966
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP16416590A Pending JPH0454662A (en) | 1990-06-25 | 1990-06-25 | Exclusive access control system for shared resources |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH0454662A (en) |
-
1990
- 1990-06-25 JP JP16416590A patent/JPH0454662A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10353749B2 (en) | Lock-free dual queue with condition synchronization and time-outs | |
US5987550A (en) | Lock mechanism for shared resources in a data processing system | |
JP2820752B2 (en) | Cache Memory Coincidence Control Method in Tightly Coupled Multiprocessor System | |
JPH04268649A (en) | Method for controlling entry of data block into memory | |
US6076126A (en) | Software locking mechanism for locking shared resources in a data processing system | |
US6941308B1 (en) | Methods and apparatus for accessing a doubly linked list in a data storage system | |
US20090198920A1 (en) | Processing Units Within a Multiprocessor System Adapted to Support Memory Locks | |
US20090198849A1 (en) | Memory Lock Mechanism for a Multiprocessor System | |
US20090198695A1 (en) | Method and Apparatus for Supporting Distributed Computing Within a Multiprocessor System | |
JP2829115B2 (en) | File sharing method | |
JP2001222466A (en) | Multiprocessor system, shared memory control system, its method, and recording medium | |
JP2000003302A (en) | Method for controlling exclusive access of common memory | |
JPH0454662A (en) | Exclusive access control system for shared resources | |
JP3381079B2 (en) | Exclusive control system using cache memory | |
JPS58107977A (en) | Accessing system for storage device | |
JPS5827255A (en) | Controlling system of file used for plural electronic computers in common | |
JP3206453B2 (en) | Shared file update control method | |
WO1993003436A1 (en) | Method and apparatus for reducing lock period of shared buffer | |
JPS6238743B2 (en) | ||
JP2852149B2 (en) | Semaphore bit circuit | |
JPH01300365A (en) | Exclusive control system for multi-processor system | |
JPS6118223B2 (en) | ||
JP2000003287A (en) | Exclusive controller for shared resource, method therefor and recording medium for recording exclusive control program | |
JPH06266621A (en) | Data access method | |
JPH0374759A (en) | Multiprocessor system |