JPH03116260A - Spin lock system for multiprocessor system - Google Patents

Spin lock system for multiprocessor system

Info

Publication number
JPH03116260A
JPH03116260A JP25217889A JP25217889A JPH03116260A JP H03116260 A JPH03116260 A JP H03116260A JP 25217889 A JP25217889 A JP 25217889A JP 25217889 A JP25217889 A JP 25217889A JP H03116260 A JPH03116260 A JP H03116260A
Authority
JP
Japan
Prior art keywords
lock
reservation number
resources
resource
reservation
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
JP25217889A
Other languages
Japanese (ja)
Inventor
Takashi Kadohiro
崇 角廣
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 Corp
Original Assignee
NEC Corp
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 Corp filed Critical NEC Corp
Priority to JP25217889A priority Critical patent/JPH03116260A/en
Publication of JPH03116260A publication Critical patent/JPH03116260A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To prevent a sinking phenomenon due to the lock conflict of a specific CPU by giving immediately the reservation numbers to the CPUs requesting the occupation of the resources and controlling the order of CPUs for reception of resources based on those reservation numbers. CONSTITUTION:When a program 11 occupies the resources, the program 11 carries out a lock process 12 to the resources. That is, a reservation number 52 of the lock field corresponding to the resources is acquired by a reservation number acquiring means 14. At the same time, the reservation number is advanced by one step on the field. Then the reservation number obtained previously by a lock right acquiring means 15 is kept waiting in a spin (loop) until the number is coincident with a right number 53. When an unlock process 13 is carried out to the resources, the number 53 of the corresponding lock field is advanced by a step by a lock right transfer means 16. Then the resources are transferred to the CPU having the next reservation number. Thus it is possible to evade such a sinking phenomenon of a CPU where the lock of a specific CPU is kept waiting forever.

Description

【発明の詳細な説明】 〔産業上の利用分野] 本発明は、メモリ共有型[密結合コマルチプロセッサシ
ステムにおけるスピンロック方式に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a spinlock method in a memory sharing type [tightly coupled co-multiprocessor system].

[従来の技術] 従来のスピンロック方式は、 TS (テスト アンド
 セット)操作によるロックバイトの検査設定をTRU
E (成功)となるまで繰り返してロックを行い、ロッ
クバイトにTRUEを設定してアンロックを行なってい
た。
[Conventional technology] In the conventional spinlock method, the test setting of the lock bite by TS (test and set) operation is
Locking was performed repeatedly until E (success) was obtained, and TRUE was set in the lock byte to unlock.

[発明が解決しようとする課題] 従来のスピンロック方式は、あるCPUがロックを行な
って資源占有中に他の複数のCPUがこの資源にロック
を行うと、この資源がアンロックされたとき次にどのC
PUが資源を占有できるか定まっていない。このため、
場合によっては特定のCPUのロックがいつまでも待た
されることがある。これはCPUの沈み込みと呼ばれて
いる。
[Problems to be Solved by the Invention] In the conventional spinlock method, if a CPU locks a resource and other CPUs lock the resource while it is occupying the resource, when the resource is unlocked, the next Nido C
It is not determined whether the PU can occupy resources. For this reason,
In some cases, locking a particular CPU may be kept waiting indefinitely. This is called CPU sinking.

[課題を解決するための手段] 本発明のスピンロック方式は、資源の占有できる順番を
定める予約番号の取得手段と、その予約番号に従って資
源占有権利を得るロック権利取得手段、占有していた資
源を解放するロック権利譲渡手段を有することを特徴と
している。
[Means for Solving the Problems] The spinlock system of the present invention includes a means for acquiring a reservation number that determines the order in which resources can be occupied, a lock right acquisition means for acquiring the right to occupy the resource according to the reservation number, and a means for acquiring the right to occupy the resource, and a means for acquiring the right to occupy the resource according to the reservation number. It is characterized by having a lock right transfer means to release the lock.

[実施例] 本発明の実施例について図面を参照して説明する。[Example] Embodiments of the present invention will be described with reference to the drawings.

第1図は本発明の一実施例の構成図で、ロック処理12
は予約番号取得手段14とロック権利取得手段15によ
り資源占有を行い、アンロック処理13はロック権利譲
渡手段16によりロックされた資源を解放するものであ
る。
FIG. 1 is a block diagram of an embodiment of the present invention, in which lock processing 12
The reservation number acquisition means 14 and the lock right acquisition means 15 occupy resources, and the unlock processing 13 releases the resources locked by the lock right transfer means 16.

第2図は、予約番号取得手段14の一実施例で。FIG. 2 shows one embodiment of the reservation number acquisition means 14.

対象資源に対する予約番号を得て、同時に予約番号に1
加算しておく。本実施例では、従来のTS操作によるス
ピンロックによりこの同時性を保証している。
Obtain the reservation number for the target resource and at the same time add 1 to the reservation number.
Add it up. In this embodiment, this concurrency is guaranteed by a spin lock based on conventional TS operation.

第3図は、ロック権利取得手段15の一実施例で、対象
資源の占有権利番号が取得した予約番号と一致するまで
スピンして待つ仕組みとなっている。
FIG. 3 shows an embodiment of the lock right acquisition means 15, which spins and waits until the exclusive right number of the target resource matches the acquired reservation number.

第4図は、第3図で示したロック権利取得手段15に対
するロック権利譲渡手段の一実施例で。
FIG. 4 shows an embodiment of the lock right transfer means for the lock right acquisition means 15 shown in FIG.

占有資源の解放に際しては対象資源の占有権利番号を1
加算して権利を次に譲る。
When releasing an occupied resource, change the exclusive right number of the target resource to 1.
Add and transfer the rights to the next person.

第5図は2本実施例における排他資源毎のロックフィー
ルド(管理テーブル)で、上述した通り予約番号とその
ロックバイト、そして占有権利番号から成る。初期値は
予約番号−権利番号であればよい。
FIG. 5 shows a lock field (management table) for each exclusive resource in the two embodiments, and as described above, it consists of a reservation number, its lock byte, and an exclusive right number. The initial value may be the reservation number minus the right number.

次に、動作について説明する。Next, the operation will be explained.

第1図で、プログラム11がある資源を占有する場合、
その資源に対してロック処理12を行う。
In FIG. 1, when the program 11 occupies a certain resource,
Lock processing 12 is performed on the resource.

ロック処理は、予約番号取得手段14でその資源に対応
するロックフィールド[第5図]の予約番号52を得る
と同時に、フィールド上の予約番号は1歩進させる。つ
まり1次に予約番号を取得するものには1加算された番
号が与えられることになる。次に、ロック権利取得手段
15で先に得られた予約番号がロックフィールドの権利
番号53と一致するまでスピン(ループ)して待機する
In the lock processing, the reservation number acquisition means 14 obtains the reservation number 52 of the lock field (FIG. 5) corresponding to the resource, and simultaneously increments the reservation number on the field by one step. In other words, the person who obtains the reservation number first will be given a number incremented by 1. Next, it spins (loop) and waits until the reservation number previously obtained by the lock right acquisition means 15 matches the right number 53 of the lock field.

一致すれば資源占有完了としてロック処理は終了する。If they match, the resource occupancy is determined to be complete and the locking process ends.

プログラム11がこのようにして占有していた資源を解
放する場合には、その資源に対してアンロック処理13
を行う。アンロック処理13はロッ0り権利譲渡手段1
6により対応するロックフィールドの権利番号53を1
歩進することによって次の予約番号を持つCPUに資源
を譲る。
When releasing the resources occupied by the program 11 in this way, an unlock process 13 is performed for the resources.
I do. Unlock process 13 is a lottery right transfer method 1
6 to the corresponding Lockfield right number 53 to 1
By incrementing, the resource is given over to the CPU with the next reservation number.

[発明の効果] 以上のように本発明は、資源占有を要求するCPUに直
ちに予約番号を与え、これに従って資源を与えるCPU
を順序制御するので、特定CPUのロック競合による沈
み込みが起こらないという効果がある。
[Effects of the Invention] As described above, the present invention immediately gives a reservation number to a CPU that requests resource occupancy, and provides the CPU with the resource in accordance with the reservation number.
Since the order of the CPUs is controlled, there is an effect that no slump due to lock contention of a specific CPU occurs.

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

第1図は本発明の一実施例の構成図、第2図は第1図に
示された予約番号取得手段の流れ図、第3図は第1図に
示された権利取得手段の流れ図。 第4図は第1図に示されたロック権利譲渡手段の流れ図
、第5図は本発明の一実施例のある資源の占有順序を管
理するテーブル(ロックフィールド)の図である。 図中、14は予約番号取得手段、15はロック権利取得
手段、16はロック権利譲渡手段。 第2図 第 3図 第4図 第 5図
FIG. 1 is a block diagram of an embodiment of the present invention, FIG. 2 is a flowchart of the reservation number acquisition means shown in FIG. 1, and FIG. 3 is a flowchart of the right acquisition means shown in FIG. 1. FIG. 4 is a flowchart of the lock right transfer means shown in FIG. 1, and FIG. 5 is a diagram of a table (lock field) for managing the order of resource occupancy according to an embodiment of the present invention. In the figure, 14 is a reservation number acquisition means, 15 is a lock right acquisition means, and 16 is a lock right transfer means. Figure 2 Figure 3 Figure 4 Figure 5

Claims (1)

【特許請求の範囲】 1)メモリ共有型[密結合]マルチプロセッサシステム
において、ロック資源の占有できる順番を定める予約番
号取得手段とその予約番号にもとづいて資源占有権利を
得るロック権利取得手段とにより構成されるロック操作
と、占有していた資源を解放するロック権利譲渡手段に
より構成されるアンロック操作を用いることを特徴とす
るマルチプロセッサシステムにおけるスピンロック方式
。 2)請求項1記載のスピンロック方式において、前記予
約番号取得手段は、対象資源に対する予約番号を得ると
同時に、該予約番号に1を加算してセットするものであ
り、前記ロック権利取得手段は、前記対象資源の占有権
利番号が取得した前記予約番号と一致するまで待つもの
であることを特徴とするマルチプロセッサシステムにお
けるスピンロック方式。 3)請求項1記載のスピンロック方式において、前記ロ
ック権利譲渡手段は、資源の解放に際しその資源の占有
権利番号を1加算して占有権利を次に譲るものであるこ
とを特徴とするマルチプロセッサシステムにおけるスピ
ンロック方式。
[Scope of Claims] 1) In a memory sharing type [tightly coupled] multiprocessor system, a reservation number acquisition means that determines the order in which lock resources can be occupied, and a lock right acquisition means that acquires resource occupation rights based on the reservation number. A spinlock method in a multiprocessor system characterized by using a lock operation configured by a lock operation and an unlock operation configured by a lock right transfer means to release occupied resources. 2) In the spin lock method according to claim 1, the reservation number acquisition means obtains a reservation number for the target resource and at the same time adds 1 to the reservation number and sets the reservation number, and the lock right acquisition means , a spin lock method in a multiprocessor system, characterized in that the method waits until the exclusive right number of the target resource matches the acquired reservation number. 3) A multiprocessor according to claim 1, wherein the lock right transfer means, when releasing a resource, increments the resource's exclusive right number by 1 and transfers the exclusive right to the next one. Spinlock method in the system.
JP25217889A 1989-09-29 1989-09-29 Spin lock system for multiprocessor system Pending JPH03116260A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP25217889A JPH03116260A (en) 1989-09-29 1989-09-29 Spin lock system for multiprocessor system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP25217889A JPH03116260A (en) 1989-09-29 1989-09-29 Spin lock system for multiprocessor system

Publications (1)

Publication Number Publication Date
JPH03116260A true JPH03116260A (en) 1991-05-17

Family

ID=17233579

Family Applications (1)

Application Number Title Priority Date Filing Date
JP25217889A Pending JPH03116260A (en) 1989-09-29 1989-09-29 Spin lock system for multiprocessor system

Country Status (1)

Country Link
JP (1) JPH03116260A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06119232A (en) * 1992-06-16 1994-04-28 Internatl Business Mach Corp <Ibm> Shared-data-memory control system, setting method for master processing device and data-copy method
JP2008143685A (en) * 2006-12-13 2008-06-26 Martec Kk Smooth turnable sling rig
US8965473B2 (en) 2005-09-29 2015-02-24 Covidien Lp Medical sensor for reducing motion artifacts and technique for using the same

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06119232A (en) * 1992-06-16 1994-04-28 Internatl Business Mach Corp <Ibm> Shared-data-memory control system, setting method for master processing device and data-copy method
US8965473B2 (en) 2005-09-29 2015-02-24 Covidien Lp Medical sensor for reducing motion artifacts and technique for using the same
JP2008143685A (en) * 2006-12-13 2008-06-26 Martec Kk Smooth turnable sling rig

Similar Documents

Publication Publication Date Title
US6141720A (en) Method and apparatus for coordination of a shared object in a distributed system
Raynal A distributed solution to the k-out of-m resources allocation problem
US5307483A (en) Synchronization instruction for multiple processor network
US4445197A (en) Weak synchronization and scheduling among concurrent asynchronous processors
WO1998003912A1 (en) Method and apparatus for coordination of a shared object in a distributed system
US5202966A (en) Centralized bus arbitration circuit
KR20200117405A (en) Distributed sysetm for managing distributed lock and operating method thereof
JPH03116260A (en) Spin lock system for multiprocessor system
JPH1021098A (en) Exclusive control unit
JPH0478932A (en) Shared resource exclusion control system
JPS62177641A (en) Exclusive priority control system
JP2898012B2 (en) Exclusive control method for computer resources
JPS6320634A (en) Exclusive control system for computer resource
JPS63228367A (en) Main storage access system
JPH0383142A (en) Shared resource exclusive control system
JPH0330027A (en) Exclusive control system
JPH03257568A (en) Exclusive control system for shared resources
EP0377133B1 (en) Wait depth limited concurrency control method
JPH08202567A (en) Inter-system lock processing method
JPH07200321A (en) Integrated exclusive control system
JPH052569A (en) Exclusive control system for multi-processor system
JP3904251B2 (en) Exclusive control method
JPH02194442A (en) Shared resource controller
JPH0355656A (en) Spin lock control system
JPH04148453A (en) Arbitration control system