JPH0833836B2 - Shared resource management processing method - Google Patents

Shared resource management processing method

Info

Publication number
JPH0833836B2
JPH0833836B2 JP3393987A JP3393987A JPH0833836B2 JP H0833836 B2 JPH0833836 B2 JP H0833836B2 JP 3393987 A JP3393987 A JP 3393987A JP 3393987 A JP3393987 A JP 3393987A JP H0833836 B2 JPH0833836 B2 JP H0833836B2
Authority
JP
Japan
Prior art keywords
resource
information
management information
area
management
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP3393987A
Other languages
Japanese (ja)
Other versions
JPS63201732A (en
Inventor
陽太郎 北館
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP3393987A priority Critical patent/JPH0833836B2/en
Publication of JPS63201732A publication Critical patent/JPS63201732A/en
Publication of JPH0833836B2 publication Critical patent/JPH0833836B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/503Resource availability

Description

【発明の詳細な説明】 〔概要〕 共有資源を互に独立に占有しつつ処理を進めるに当っ
て、共通資源領域を区分し細分して、ツリー状に体系化
し、排他的占有が生じる範囲を可能な限り小にし、かつ
主記憶要量を比較的小に出来るようにすることが開示さ
れている。
DETAILED DESCRIPTION [Outline] In advancing processing while occupying shared resources independently of each other, a common resource area is divided and subdivided into a tree structure, and the range in which exclusive occupation occurs is divided. It is disclosed that it can be made as small as possible and the main memory requirement can be made relatively small.

〔産業上の利用分野〕[Industrial applications]

本発明は、共有資源管理処理方式、特に複数のデータ
処理装置が共有資源を互いに独立にアクセスしつつ処理
を進めるに当たって、上記共有資源を複数の共有資源領
域に区分し、または上記共有資源を段階的に細分して、
ツリー状に体系化し、排他的占有を限られた最小限に保
つよう占有範囲を可変にするとともに、占有を効率よく
行い、さらに占有処理に要する主記憶容量を少量に保つ
ようにした共有資源管理処理方式に関するものである。
The present invention relates to a shared resource management processing method, in particular, when a plurality of data processing devices access a shared resource independently of each other to proceed with processing, the shared resource is divided into a plurality of shared resource areas, or the shared resource is divided into stages. Subdivided into
Shared resource management systematized in a tree form, variable occupancy range to keep exclusive occupancy to a limited minimum, efficient occupancy, and a small amount of main memory required for occupancy processing It relates to a processing method.

本発明は、既に出願された特開昭55-6666号の共有資
源管理処理方式の改良であり、そこで必要となる主記憶
領域を少量にするようにしたものである。
The present invention is an improvement of the shared resource management processing system of Japanese Patent Laid-Open No. 55-6666, which has already been filed, and reduces the main memory area required there.

〔従来の技術〕[Conventional technology]

複数のデータ処理装置が共有資源を利用しつつ処理を
進める場合、1つのデータ処理装置が処理を行っている
間に他データ処理装置が当該資源を非所望に変更すると
論理矛盾を生ずることがある。このため、上記の如き場
合には、一般に排他的占有を行った上で処理を執行す
る。しかし、複数の処理装置がなるべく多く並行動作で
きるために排他的占有が行われる範囲は可能な限り小で
あることが望まれ、また排他的占有が行われる範囲は処
理の態様に応じて任意に可変であることが望まれる。
When a plurality of data processing devices proceed with processing while using shared resources, if one data processing device performs processing while another data processing device undesirably changes the resource, a logical contradiction may occur. . Therefore, in the above case, generally, exclusive occupation is performed and then the process is executed. However, it is desirable that the range in which exclusive occupation is performed be as small as possible in order that a plurality of processing devices can operate in parallel as much as possible, and the range in which exclusive occupation is performed is arbitrary according to the mode of processing. It is desired to be variable.

〔発明が解決しようとする問題点〕[Problems to be solved by the invention]

このために、本願発明者は先に特開昭55-6666号を出
願した。しかし当該出願の場合、共有資源管理に必要な
主記憶量は資源の分割数に比例して増大し、情報処理シ
ステムを構成するCPUのアーキテクチャによっては、全
資源に対応できない場合もありえた。また、仮想記憶
(VS)を使用する場合には、記憶量は拡大できるが、ペ
ージ・フォルトが発生して、オーバヘッドを伴い、好ま
しくない場合も存在する。そこで、あくまでも出来るか
ぎり主記憶を使用するようにし、資源の占有や解放の頻
度のあまり多くない資源については、各資源領域に対応
した管理情報を予め設けずに、複数の資源領域が共用す
る情報領域を主記憶上に設定しておき、必要に応じて当
該領域を使用することが望まれる。
For this reason, the inventor of the present application previously applied for Japanese Patent Application Laid-Open No. 55-6666. However, in the case of this application, the amount of main memory required for shared resource management increases in proportion to the number of resource divisions, and it may not be possible to handle all resources depending on the architecture of the CPU that constitutes the information processing system. When using virtual memory (VS), the amount of storage can be expanded, but there is a case where a page fault occurs and overhead is involved, which is not preferable. Therefore, the main memory should be used as much as possible, and for resources that do not occupy or release resources very often, information that is shared by multiple resource areas is not provided in advance without providing management information corresponding to each resource area. It is desirable to set an area on the main memory and use the area as needed.

〔問題点を解決するための手段〕[Means for solving problems]

本発明は上記の点を解決しており、上記共通の資源を
複数の資源領域に区分すると共に該各資源領域をツリー
構造に体系化せしめ、そのツリー構造を、ツリーの根を
含む一定の連結したツリー部分αと、それ以外のツリー
部分βとに分割し、ツリー部分αについては主記憶上に
そのツリー部分αに対応して固定管理テーブルを設けて
管理し、ツリー部分βについては主記憶上にそのツリー
部分βに対応して一時管理テーブルを設けて管理するよ
うにしている。
The present invention has solved the above-mentioned point, and divides the common resource into a plurality of resource areas and systematizes each of the resource areas into a tree structure, and the tree structure is fixedly connected including the root of the tree. The tree portion α and the other tree portion β are divided, and the tree portion α is managed by providing a fixed management table corresponding to the tree portion α on the main memory, and the tree portion β is stored in the main memory. A temporary management table is provided above the tree portion β for management.

第1図は本発明の原理構成図を示し、1は主記憶、2
はアクセス・ユニット、3-0、3-1、……は夫々処理装
置、4-0、4-1、……は夫々固有メモリ、5は固定管理テ
ーブル、6は一時管理テーブル、7-0、7-1、……はツリ
ー構造の写し情報を表わしている。またA、B、C……
Kは夫々共通資源の節を表わし、ツリー構造に体系化さ
れている。鎖線で囲た範囲はツリー部分αに対応し、残
余部分はツリー部分βに対応している。
FIG. 1 is a block diagram showing the principle of the present invention.
Are access units, 3-0, 3-1, ... are processing units, 4-0, 4-1, ... are unique memories, 5 are fixed management tables, 6 are temporary management tables, 7-0 , 7-1, ... represent tree-structured copy information. Also A, B, C ...
Each K represents a common resource section and is organized in a tree structure. The range surrounded by the chain line corresponds to the tree part α, and the remaining part corresponds to the tree part β.

第1図においては、情報処理システム内の共有資源
が、A、B、…、Kの節からなるツリー構造に体系化さ
れている。B、C、…、Kのうち少なくとも1つの節を
占有中の処理装置が存在する間には他処理装置が節Aを
占有することは禁止されるべきである。また、Aを占有
している場合、他の処理装置が節B、C、…、Kのいず
れか1つを占有することは禁止されるべきである。
In FIG. 1, the shared resources in the information processing system are systematized in a tree structure composed of nodes A, B, ..., K. It is to be prohibited that another processing device occupies the node A while the processing device occupying at least one of the nodes B, C, ..., K exists. Also, when occupying A, it should be prohibited for another processing device to occupy any one of the clauses B, C, ..., K.

いま,第1図において、斜線で示した節C、G、Hが
占有されるとする。第1図中のツリー部分αについて
は、固定管理テーブル5上にそのツリー部分中の各節A
〜Eに対応して第1管理情報が対応づけられて存在す
る。ツリー部分βはツリー部分α以外の部分で、その中
の節の管理情報は必要に応じて一時管理テーブル6上に
作られる。
Now, in FIG. 1, it is assumed that the shaded sections C, G, and H are occupied. For the tree part α in FIG. 1, each node A in the tree part is recorded on the fixed management table 5.
The first management information is associated with and exists in correspondence with ~ E. The tree portion β is a portion other than the tree portion α, and the management information of the nodes therein is created in the temporary management table 6 as necessary.

各処理装置3-iに対応する固有メモリ4-iに、システム
内の共有資源をツリー構造に体系化した状態を示す写し
情報7-iが格納され、管理テーブル5、6は各処理装置3
-iにより共通にアクセスできる主記憶1内に置かれてい
る。各処理装置3-iは資源領域の占有に当たって、ツリ
ー上のどの節を占有すべきか、また、その節の占有に関
係する管理情報が主記憶1上のどのアドレスに存在する
かを調べるために、自分の固有メモリ4-i上の写し情報7
-iを参照する。アクセスユニット2は各処理装置3-iか
らの主記憶1へのアクセス要求を処理するとともに、後
述するテスト・アンド・セット(TS)命令、コンペア・
アンド・スワップ(CS)命令を、1つの処理装置3-iか
らの実行要求に応じて、他の処理装置3-jからのアクセ
スを排除しつつ実行するための手段を提供するものであ
る。
Copy information 7-i indicating the systematized state of the shared resources in the system is stored in the unique memory 4-i corresponding to each processing device 3-i.
It is located in the main memory 1 that can be accessed commonly by -i. In order to occupy the resource area, each processing device 3-i should occupy which node on the tree should be occupied and which address on the main memory 1 the management information related to the occupancy of the node should be. , Copy information on my own memory 4-i 7
See -i. The access unit 2 processes an access request to the main memory 1 from each processing device 3-i, and executes a test and set (TS) instruction, a compare
The present invention provides a means for executing an And Swap (CS) instruction in response to an execution request from one processing device 3-i while excluding access from another processing device 3-j.

ツリー上で互いに離れた複数の資源領域を処理する場
合に、唯一の節の占有によってこれを行うようにする。
即ち例えば節G、Hを処理しようとする場合、節G、H
共通の上位にある節のうち、最低位のものを占有する。
この例では、共通の上位にある節は図から明らかなごと
く、BとAとである。そして、この中で最も低位の節は
Bである。従って今の場合節Bが占有される節である。
When dealing with multiple resource regions that are separated from each other on the tree, do this by occupying only one clause.
That is, for example, when trying to process the sections G and H, the sections G and H
Occupy the lowest of the common upper clauses.
In this example, the common upper nodes are B and A, as is clear from the figure. The lowest node in this is B. Therefore, in this case, the section B is the occupied section.

固定管理テーブル5はツリー部分αに対応して設けら
れている。また、その内容はツリーの占有状態に対応し
ている。値が正であるのは、処理中指示情報が0で下位
占有カウント値が正であることを、値が−1節であるの
は、処理中指示情報が1で下位処理中カウント値が0で
あることを示している。
The fixed management table 5 is provided corresponding to the tree portion α. Also, the contents correspond to the occupied state of the tree. A positive value means that the in-process instruction information is 0 and the lower occupancy count value is positive, and a value of -1 means that the in-process instruction information is 1 and the lower-order in-process count value is 0. Is shown.

Aの値が+3であるのはツリー上でAの下に位置する
節C、H、Gの3つが占有されていることによる。Cの
値が−1であるのは、節Cが占有されていることによ
る。
The value of A is +3 because three nodes C, H, and G located under A on the tree are occupied. The value of C is -1 because node C is occupied.

ツリー部分βの中の各節に対応づけられたカッコ内の
数値は、一時管理テーブル中の要素番号である。即ち一
時管理テーブル6上で第2管理情報が設定される場所を
示している。この例では、節IとJとが「2」、GとH
が「4」の要素番号を割り当てられている。要素番号が
重複している理由は、次の理由による。即ち占有や解放
の頻度の低い資源領域については、各資源領域に対応し
て、固定した管理情報域を設定するよりも、必要に応じ
て割り当てたほうが管理に必要なメモリ量を削減できる
からである。しかし、この重複は占有や解放の頻度の高
い資源領域に対して発生すると、以下に述べることから
明らかなように、管理処理のオーバヘッドが増大すると
いう好ましくない結果を招く。従って、ツリー部分α、
βへの区切り方、一時管理テーブルの要素の数、ツリー
部分βの各節に対する一時管理テーブル上の要素番号の
割り付け方等は、その情報処理システムに応じて決定さ
れるべきである。
The numerical value in parentheses associated with each section in the tree portion β is the element number in the temporary management table. That is, it shows the place where the second management information is set on the temporary management table 6. In this example, clauses I and J are "2", G and H
Is assigned an element number of "4". The reason why the element numbers are duplicated is as follows. In other words, for resource areas that are rarely occupied or released, it is possible to reduce the amount of memory required for management by allocating as needed, rather than setting a fixed management information area corresponding to each resource area. is there. However, if this duplication occurs in a resource area that is frequently occupied or released, as will be apparent from the following description, the overhead of management processing increases, which is an unfavorable result. Therefore, the tree part α,
How to divide into β, the number of elements of the temporary management table, how to allocate the element number on the temporary management table to each section of the tree portion β, etc. should be decided according to the information processing system.

〔作用〕[Action]

ツリー構造中の根Aを含む例えば図示ツリー部分αと
して示す範囲の節A、B、C、D、Eについては、自分
自身が占有されあるいは下位節のいずれかが占有される
ことに付随して使用される可能性が大であるとして、固
定管理テーブル5によって管理される。即ち管理情報は
常に個々の節に対応して1対1の形で保持される。一
方、図示ツリー部分βとして示す範囲の節F、G、H、
I、J、Kについては、占有される頻度がそれ程大では
なく、個々の節に対応して1対1の形で管理情報を保持
しようとすると主記憶1の容量が非所望に大となりかね
ない。このために当面占有される状態が生じた際に、一
時管理テーブル6上に登録されて管理される。
For example, the nodes A, B, C, D, and E in the range shown as the illustrated tree portion α including the root A in the tree structure are accompanied by the fact that they are occupied by themselves or one of the subordinate nodes is occupied. It is managed by the fixed management table 5 as having a high possibility of being used. That is, the management information is always held in a one-to-one form corresponding to each node. On the other hand, the nodes F, G, H in the range shown as the illustrated tree portion β
For I, J, and K, the frequency of occupation is not so great, and if the management information is held in a one-to-one form corresponding to each clause, the capacity of the main memory 1 may become undesirably large. Absent. Therefore, when an occupied state occurs for the time being, it is registered and managed in the temporary management table 6.

一時管理テーブル6は、番号付要素領域6-1と拡張用
連鎖領域6-2とに区分されている。そして番号付要素領
域内の要素位置に対応して要素番号が付与されていて、
図示の節F、G……はどの要素位置に登録されるべきか
によって要素番号が図示「3」、「4」……の如く対応
づけられている。また拡張用連鎖領域には、番号付要素
領域内の区分域において重複が生じた場合に番号付要素
領域からポイントされて使用される。第1図図示の例の
如く、要素番号「4」をもつ2つの節GとHとが共に占
有されることになった場合には、上記重複が生じ、拡張
用連鎖領域が利用される。
The temporary management table 6 is divided into a numbered element area 6-1 and an extension chain area 6-2. And the element number is given corresponding to the element position in the numbered element area,
In the illustrated nodes F, G, ..., Element numbers are associated with each other, such as "3", "4", etc., depending on which element position should be registered. Further, in the extended chain area, when overlap occurs in the divided areas in the numbered element area, the pointed area is used from the numbered element area for use. When two nodes G and H having the element number "4" are to be occupied together as in the example shown in FIG. 1, the above overlap occurs and the extension chain region is used.

〔実施例〕〔Example〕

第2図は第1図図示のツリー部分βに対する一時管理
テーブルの構成例を示す。上記のように、節G、Hには
要素番号「4」が対応づけられている。節GとHはとも
に占有されているので、第2管理情報で重複が発生して
おり、この第2管理情報はG、Hに対応する2つの第3
管理情報からなる連鎖をポイントしている。
FIG. 2 shows a configuration example of a temporary management table for the tree portion β shown in FIG. As described above, the element numbers “4” are associated with the sections G and H. Since the nodes G and H are both occupied, duplication occurs in the second management information, and the second management information includes two third management information corresponding to G and H.
It points to a chain of management information.

一時管理テーブルは2つの部分からなる。1つは番号
付要素領域6-1で、ツリー部分βの各節に与えられる要
素番号に対応して存在し、また、その要素には第2管理
情報が格納される。他の1つは拡張用連鎖領域6-2で、
これは第2管理情報で重複が生じた場合、つまり占有に
かかわる複数の資源領域が同じ要素番号に対応していた
ときに、第2管理情報が占有を表示する情報としては使
用できず、そのためにこの中に第3管理情報を各節ごと
に設けて夫々の節を個別に管理するための領域である。
この例では、拡張用連鎖領域6-2中の未使用連鎖は、同
じ第2図中に示す未使用連鎖入口ポインタ12により、そ
の先頭がポイントされる。また、未使用連鎖中の要素は
最後の要素を除いて、それぞれが次の未使用要素を連鎖
用ポインタによってポイントしている(主記憶上のアド
レスを格納している)。
The temporary management table has two parts. One is a numbered element area 6-1 that exists corresponding to the element number given to each section of the tree portion β, and the second management information is stored in that element. The other one is the extension chain area 6-2,
This is because when the second management information is duplicated, that is, when a plurality of resource areas involved in occupancy correspond to the same element number, the second management information cannot be used as information indicating occupancy, and therefore This is an area for providing third management information for each section and managing each section individually.
In this example, the unused chain in the extension chain area 6-2 is pointed to by the unused chain entrance pointer 12 shown in FIG. Further, each element in the unused chain points to the next unused element by the chain pointer except the last element (stores the address on the main memory).

第2図中、重複表示情報21は一時管理テーブル6中の
番号付要素領域6-1内の各要素に対応して存在し、ツリ
ー部分βの管理情報の格納に当たって、0は重複なし、
1は重複ありの状態を示す。重複ありの場合には、そこ
から連鎖用ポインタ27によってポイントされる拡張用連
鎖領域6-2中に、各節の占有情報が格納されている。
In FIG. 2, the duplicated display information 21 exists corresponding to each element in the numbered element area 6-1 in the temporary management table 6, and 0 is not duplicated when storing the management information of the tree portion β,
1 indicates a state with overlap. When there is an overlap, the occupation information of each section is stored in the extension chain area 6-2 pointed by the chain pointer 27 from there.

処理中指示情報22は対応する資源領域が処理中(すな
わち占有中)である場合に1とされる情報である。
The processing instruction information 22 is information that is set to 1 when the corresponding resource area is being processed (that is, occupied).

空き中/使用中表示ビット23は同じく番号付要素領域
6-1内の各要素にあり、0は空き中、1は使用中を示
す。空き中というのは、その要素がいずれの資源領域の
占有情報も格納しておらず、また、第3管理情報への連
鎖もないことを示している。従って、空き中/使用中表
示ビット23が0である場合、この要素に対応づけられる
ツリー部分βの節はどれも占有されていない。また、同
じすべての節の処理中指示情報22及び下位処理中カウン
ト値24はいずれも0とみなすことが可能である。
Free / in-use display bit 23 is also a numbered element area
It is in each element in 6-1 and 0 indicates that it is empty and 1 indicates that it is in use. Free means that the element does not store occupancy information of any resource area, and there is no chain to the third management information. Thus, if the free / busy indicator bit 23 is 0, then none of the nodes of the tree portion β associated with this element are occupied. Further, the in-process instruction information 22 and the low-order in-process count value 24 of all the same sections can be regarded as 0.

下位処理中カウント値/重複カウント値24は場合に応
じて持つ意味が異なる。
The meaning of the low-order processing count value / duplication count value 24 differs depending on the case.

(i)番号付要素領域(第1領域)6-1内にあって、空
き中/使用中表示ビット23が1(使用中)であり、かつ
重複表示情報21が0(重複なし)である場合:ツリー部
分βの1つの節の下位処理中カウント値を保有する。
(I) In the numbered element area (first area) 6-1, the free / busy display bit 23 is 1 (in use), and the duplicate display information 21 is 0 (no duplication). Case: Hold the lower processing count value of one node of the tree portion β.

(ii)番号付要素領域(第1領域)6-1内にあって、空
き中/使用中表示ビット23が1(使用中)であり、かつ
重複表示情報21が1(重複あり)である場合:重複度、
すなわち、ここからポイントされる拡張用連鎖領域中の
連鎖の長さ(上記例ではカウント値2)を保有する。
(Ii) In the numbered element area (first area) 6-1, the free / busy display bit 23 is 1 (in use), and the duplicate display information 21 is 1 (duplicate). Case: Multiplicity,
That is, the chain length (count value 2 in the above example) in the expansion chain area pointed from here is held.

(iii)拡張用連鎖領域(第2領域)6-2内にあって、そ
れが使用中の番号付要素領域(第1領域)6-1のいずれ
かの要素より始まる連鎖の中にある場合:ツリー部分β
の1つの節の下位処理中カウント値を保有する。このカ
ウント値が−1である場合は対応する資源領域が処理中
であるとみなす。
(Iii) When it is in the extended chain area (second area) 6-2, and it is in the chain starting from any element of the numbered element area (first area) 6-1 being used. : Tree part β
Holds the in-process count value of one clause of When the count value is -1, it is considered that the corresponding resource area is being processed.

拡張用連鎖領域6-2から1つの空き要素を取り出すに
は、周知のごとく、たとえば未使用連鎖入口ポインタ12
で示される先頭要素を取り出すこととし、その処理とし
ては、先頭要素の中に書かれている次要素ポインタの値
を、改めて未使用連鎖入口ポインタ12内にセットする。
To retrieve one free element from the extension chain area 6-2, as is well known, for example, an unused chain entry pointer 12
The leading element indicated by is taken out, and as the processing, the value of the next element pointer written in the leading element is set again in the unused chain entry pointer 12.

逆に、未使用連鎖に要素を1つ返却するときは、返却
される要素の中の次要素ポインタ域に、その時の未使用
連鎖入口ポインタ12の値をセットし、また、未使用連鎖
入口ポインタ12には、返却される要素のアドレスをセッ
トする。
On the contrary, when returning one element to the unused chain, the value of the unused chain entry pointer 12 at that time is set in the next element pointer area in the returned element, and the unused chain entry pointer In 12, set the address of the element to be returned.

拡張用連鎖領域の空き要素の取り出しと返却の処理
は、1つの処理装置が一連の処理として行う必要がある
ため、第2図に示すように、未使用連鎖アクセス用セマ
フォア13が設けてある。これを獲得するには、値が1で
あるときに、他の処理装置からのアクセスを排除しつつ
0に書き替える。これは、たとえばテスト・アンド・セ
ット命令によって可能である。そして未使用連鎖要素の
取り出し、または返却処理が終了したときには、未使用
連鎖アクセス用セマフォア13の値を0から1とする。
Since it is necessary for one processing device to perform the processing of taking out and returning the empty elements in the extension chain area, an unused chain access semaphore 13 is provided as shown in FIG. To obtain this, when the value is 1, it is rewritten to 0 while excluding access from other processing devices. This is possible, for example, with test and set instructions. When the unused chain element is retrieved or returned, the value of the unused chain access semaphore 13 is changed from 0 to 1.

上記設定例では、節GとHとに対応する第2管理情報
中には節Gに対応する第3管理情報へのポインタが連鎖
用ポインタ27により格納される。節G、Hに対応する2
つの第3管理情報には、値“−1"(処理中指示情報が
1)が格納されている。また、当該第3管理情報中に、
節G、Hのそれぞれの資源領域名“FILE.G"や“FILE.H"
へのポインタが格納されている。
In the above setting example, a pointer to the third management information corresponding to the node G is stored in the second management information corresponding to the nodes G and H by the chain pointer 27. 2 corresponding to sections G and H
The value "-1" (the processing instruction information is 1) is stored in one of the third management information. In addition, in the third management information,
Resource area names "FILE.G" and "FILE.H" for sections G and H, respectively
Stores a pointer to.

第2図の状態のときに“HILE.H"という名前を持つ資
源領域Hの管理情報を読み出す処理手順を述べる。
A processing procedure for reading the management information of the resource area H having the name "HILE.H" in the state of FIG. 2 will be described.

まず、資源領域Hはツリー上でツリー部分βにあるこ
とがわかる。そこで、少なくとも節Bによって定まる
(あるいはツリー全体で共通でもよいし、ツリー部分β
の、節Bを含むツリー部分βの分割領域によって決まる
ものでもよい)アルゴリズムによってHの名前“FILE.
H"を要素番号に変換する(このような変換を行い得るア
ルゴリズムが用意されている)。
First, it can be seen that the resource area H is in the tree portion β on the tree. Therefore, it is determined at least by section B (or may be common to the entire tree, or the tree part β
, Which may be determined by the divided area of the tree portion β including the section B) of the H name "FILE.
Convert H "to element number (algorithm is available to do such conversion).

この結果、図示の如く値4が得られたとする。続いて
一時管理テーブル6上の上記値「4」に対応する第4要
素(1つの第2管理情報)を読み出す。当該第2管理情
報中で、その空き中/使用中表示ビットは1で、かつ重
複表示情報が1で、かつ重複カウント値は2であるか
ら、H以外にこの要素を第2管理情報として使っている
節が存在する(今の場合、節Gである)。そこで、該第
4要素中の拡張連鎖アクセス用セマフォア25を獲得し、
その連鎖用ポインタ27の値をアドレスとして、主記憶1
から要素を読み出す。すると、この例では、まず節Gに
対応する第3管理情報が得られる。その要素の資源領域
固有名へのポインタは“FILE.G"を指しているが、比較
の結果、求める資源領域のものではないことがわかる。
そこで、さらに連鎖用ポインタ27をたどって、次の要素
を読む。今度は“FILE.H"の名前が求める資源領域の名
前と一致するので、資源領域Hに対する管理情報が得ら
れたことになる。
As a result, it is assumed that the value 4 is obtained as illustrated. Then, the fourth element (one piece of second management information) corresponding to the value “4” on the temporary management table 6 is read. In the second management information, the free / busy display bit is 1, the duplicate display information is 1, and the duplicate count value is 2. Therefore, in addition to H, this element is used as the second management information. There is a section (in this case, section G). Therefore, the semaphore 25 for extended chain access in the fourth element is acquired,
Main memory 1 using the value of the chain pointer 27 as an address
Read an element from. Then, in this example, first, the third management information corresponding to the section G is obtained. The pointer to the resource area unique name of the element points to "FILE.G", but as a result of the comparison, it is found that the resource area does not belong to the desired resource area.
Therefore, the chain pointer 27 is further traced to read the next element. This time, the name of "FILE.H" matches the name of the required resource area, so the management information for the resource area H has been obtained.

なお重複表示情報が1である場合において用いられる
第2管理情報中の重複カウント値は次の目的で設けられ
ている。
The duplicate count value in the second management information used when the duplicate display information is 1 is provided for the following purpose.

1つの資源領域を解放した場合、もし、重複カウント
値が2より1になったら、拡張用連鎖領域6-2の使用は
不要になったことがわかるので、残った拡張用連鎖領域
6-2中の管理情報を番号付要素領域6-1における第2管理
情報に移す。そして、重複表示情報を0にする。また、
不要になった拡張用連鎖領域6-2の要素は前述の方法に
より、未使用連鎖に返却する。
When releasing one resource area, if the duplicate count value becomes 1 from 2, it can be seen that the use of the extension chain area 6-2 is no longer necessary, so the remaining extension chain area
The management information in 6-2 is transferred to the second management information in the numbered element area 6-1. Then, the duplicate display information is set to 0. Also,
The elements of the extension chain area 6-2 that are no longer needed are returned to the unused chain by the method described above.

第2管理情報中に、上述の如く重複する可能性がある
にもかかわらず節の管理情報を格納する理由は、管理情
報が重複する確率が一定以下であることが期待される場
合、重複が発生する場合としない場合との平均オーバヘ
ッドを少なくできるためである。重複しない場合は、第
2管理情報にアクセスするだけで済むので、処理時間が
少なくて足りることとなる。
The reason why the management information of the section is stored in the second management information although there is a possibility of duplication as described above is that if the probability of duplication of the management information is expected to be less than a certain value, duplication will occur. This is because it is possible to reduce the average overhead in the case of occurrence and the case of not occurring. If they do not overlap, only the second management information needs to be accessed, and the processing time is short.

また、第2図に示した拡張連鎖アクセス用セマフォア
25は一部既に述べたように拡張連鎖を変更する処理が一
つづきでおこなわれることを保証するためのもので、次
の場合に使用される。
In addition, the semaphore for extended chained access shown in FIG.
Part 25 is for ensuring that the process of changing the extension chain is performed one by one as described above, and is used in the following cases.

占有処理において、第2管理情報から重複発生してい
ることが明らかにされたため、拡張用連鎖領域6-2中に
第3管理情報域を確保して新たに連鎖を作る場合、また
は既存の第3管理情報の連鎖に追加する場合、または第
3管理情報を変更する場合。
In the occupancy process, it was revealed from the second management information that duplication has occurred. Therefore, when a third management information area is secured in the extension chain area 6-2 to create a new chain, When adding to the chain of 3 management information, or when changing the 3rd management information.

資源解放処理において、第3管理情報の連鎖を縮小す
る場合、または第3管理情報をなくして、管理情報を第
2管理情報に移す場合、または第3管理情報を変更する
場合。
In the resource releasing process, when the chain of the third management information is reduced, or when the third management information is deleted and the management information is transferred to the second management information, or when the third management information is changed.

第3管理情報の内容を読み出す場合。When reading the contents of the third management information.

本実施例においては、、の処理にはそれに先立っ
て原則としてが対になって行われるため、で同セマ
フォアを獲得し、続くまたはの終了時に同セマフォ
アを返却する。但し第2管理情報の内容を読み出したの
ち、新たに拡張連鎖を設定する場合は、改めて第2管理
情報中のセマフォアを獲得する。該セマフォアを獲得す
る場合は同セマフォアが1であることを確認し、つづい
て他の処理装置からのアクセスを排除しつつ1から0に
し、逆に返却する場合は0から1にする。
In the present embodiment, since the processing of and is performed in pairs prior to the processing, the same semaphore is acquired in and the same semaphore is returned at the end of or. However, when the extension chain is newly set after reading the contents of the second management information, the semaphore in the second management information is acquired again. When the semaphore is acquired, it is confirmed that the semaphore is 1, and then it is changed from 1 to 0 while excluding access from other processing devices. Conversely, when it is returned, it is changed from 0 to 1.

第2管理情報を読み出す場合には、同セマフォアを事
前に獲得する必要はないが、同セマフォアが0であった
場合に読み出されたデータを有効とし、1であった場合
は変更中とみなして、0になるまで読み出しを繰り返す
ようにする。なお第2管理情報を変更する場合には、同
セマフォアが0である状態で一度読み出し、つづいて処
理装置内で第2管理情報を変更したのち、CS(コンペア
・アンド・スワップ)命令で、以前読み出した値と同じ
であることを確認しつつ、また他の処理装置からのアク
セスを排除しつつ変更後の情報を書き戻すようにする。
もし、以前と内容が変わっていた場合は、第2管理情報
の再読み出しから繰り返すようにする。また、第2管理
情報が空きであった状態から、新たにそこに管理情報を
セットする場合、およびその逆の処理においても、おな
じようにCS命令を使用して行う。もし、以前に読み出し
た時と内容が異なっていた場合には、第2管理情報の再
読み出しから繰り返す。
When reading the second management information, it is not necessary to acquire the same semaphore in advance, but if the same semaphore is 0, the read data is valid, and if it is 1, it is considered as being changed. Then, the reading is repeated until it becomes 0. In addition, when changing the second management information, it is read once with the same semaphore being 0, then the second management information is changed in the processing device, and then the previous command (CS (compare and swap)) is executed. The information after the change is written back while confirming that the value is the same as the read value and excluding access from other processing devices.
If the contents have changed from before, the process is repeated from the rereading of the second management information. Also, when the second management information is empty and the management information is newly set therein, and vice versa, the same CS instruction is used. If the contents are different from those previously read, the second management information is read again and repeated.

第3図は資源領域占有処理に関する全体処理フロー、
第4図は管理情報読み出し処理に関する処理フロー、第
5図は資源領域処理中指示情報を設定する部分の処理フ
ロー、第6図は解放処理に関する全体処理フローを示
す。
Fig. 3 shows the overall processing flow for resource area occupation processing.
FIG. 4 shows a processing flow relating to management information reading processing, FIG. 5 shows a processing flow of a portion for setting resource area in-process instruction information, and FIG. 6 shows an overall processing flow relating to release processing.

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

以上のように、本発明によれば、メモリ容量を軽減し
つつ、共用資源を有効に管理できる。
As described above, according to the present invention, it is possible to effectively manage shared resources while reducing the memory capacity.

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

第1図は本発明の原理構成図、第2図は一時管理テーブ
ルの構成例、第3図ないし第6図は夫々本発明の場合に
おける処理フローを示す。 図中、1は主記憶、2はアクセス・ユニット、3は処理
装置、4は固有メモリ、5は固定管理テーブル、6は一
時管理テーブルを表わす。
FIG. 1 is a block diagram of the principle of the present invention, FIG. 2 is a structural example of a temporary management table, and FIGS. 3 to 6 are process flows in the case of the present invention. In the figure, 1 is a main memory, 2 is an access unit, 3 is a processing device, 4 is a specific memory, 5 is a fixed management table, and 6 is a temporary management table.

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】複数のデータ処理装置を含むデータ処理シ
ステムであって、該処理システムに含まれる複数の資源
を上記データ処理装置が互いに独立にアクセスしつつ処
理を進め、上記少なくとも1つのデータ処理装置が上記
共通の資源をアクセスする際に自己の処理が関与する資
源領域を占有するデータ処理システムにおいて、 上記共通の資源を複数の資源領域に区分すると共に該各
資源領域をツリー構造に体系化せしめ、そのツリー構造
を、ツリーの根を含む一定の連結したツリー部分αと、
それ以外のツリー部分βとに分割し、 ツリー部分αについては主記憶上にそのツリー部分αに
対応して固定管理テーブルを設け、該固定管理テーブル
中にはツリー部分αの各節に1対1に対応して第1管理
情報を設け、該第1管理情報中には(i)自資源領域が
処理されつつあることを表わす少なくとも1ビットの処
理中指示情報、(ii)自資源領域よりも下位に位置する
資源領域が処理されつつあることを表わす下位処理中カ
ウント値を用意し、 ツリー部分βについては主記憶上にそのツリー部分βに
対応して一時管理テーブルを設け、該一時管理テーブル
には、上記ツリー部分βの中の節に対応する資源領域の
うち、いずれかの処理装置による占有にかかわっている
資源領域のみに対して一時的に設定される第2管理情報
を格納し、該第2管理情報中には、少なくとも上記第1
管理情報中と同じく上記(i)、(ii)の情報を設け、 処理装置の1つが新しく上記資源領域または当該資源領
域よりも下位に位置する資源領域のいくつかを処理しよ
うとするとき、それらの1つまたは複数の資源領域に対
応する節全体の上位にあって、かつそのうち最も低位に
ある節に対応する資源領域に対して、(A)当該資源領
域がツリー部分αにある場合、その節に対応する第1管
理情報中の処理中指示情報が立っているか、下位処理中
カウント値が「0」でない場合に、(B)当該資源領域
がツリー部分βにある場合、その節に対応する第2管理
情報が一時管理テーブル中に存在していて、その処理中
指示情報が立っているか、下位処理中カウント値が
「0」でない場合に、 当該資源領域に対する処理を禁止するようにしたことを
特徴とする共有資源管理処理方式。
1. A data processing system including a plurality of data processing devices, wherein the data processing device advances processing while independently accessing a plurality of resources included in the processing system, and the at least one data processing. In a data processing system in which a device occupies a resource area where its own processing is involved when accessing the common resource, the common resource is divided into a plurality of resource areas and each resource area is organized into a tree structure. At the very least, the tree structure is defined by a certain connected tree part α including the root of the tree,
The tree part β is divided into other parts, and a fixed management table is provided for the tree part α in the main memory in correspondence with the tree part α. In the fixed management table, one pair is provided for each node of the tree part α. 1. The first management information is provided corresponding to 1, and in the first management information, (i) at least 1-bit in-process instruction information indicating that the own resource area is being processed, (ii) from the own resource area Also prepares a lower processing count value indicating that the resource area located in the lower order is being processed. For the tree part β, a temporary management table is provided in the main memory in correspondence with the tree part β, and the temporary management is performed. The table stores the second management information temporarily set only for the resource area that is involved in the occupation by any one of the resource areas corresponding to the nodes in the tree portion β. , The second tube During information, at least the first
When the information of (i) and (ii) above is provided as in the management information, and one of the processing devices newly attempts to process the resource area or some of the resource areas located lower than the resource area, those (A) If the resource area is in the tree part α, which is higher than the entire clause corresponding to the one or more resource areas of the above, and corresponding to the lowest clause among them, If the in-process instruction information in the first management information corresponding to the section is set or the lower processing count value is not "0", (B) if the relevant resource area is in the tree portion β, then the corresponding section When the second management information that exists is present in the temporary management table and the in-process instruction information stands or the lower in-process count value is not "0", the process for the resource area is prohibited. That Shared resource management processing system in which the butterflies.
【請求項2】一時管理テーブルを複数の同一の大きさよ
りなる要素の並びの部分(これを番号付要素領域とす
る)(6-1)と、互いにポインタによって1本の連鎖に
なた拡張用連鎖領域(6-2)とに分割し、番号付要素領
域(6-1)の各要素には上記情報(i)、(ii)と、該
要素がいずれかの資源領域の占有のために使用されてい
るか否かを示す使用中指示情報(23)と、拡張用連鎖領
域へのポインタ用領域(27)を設け、上記ツリー部分β
の各節には、占有時に使用する番号付要素領域中の要素
の番号をあらかじめ付与し、該要素がツリー部分β中の
節のいずれか1つの資源領域の占有に関わっている場合
には、その節に対応した要素位置に第2管理情報として
上記(i)、(ii)の情報と、使用中指示情報(23)を
1として格納し、もし複数の資源領域が一時管理テーブ
ル上で同じ要素番号を付与されており、かつそれらの複
数の資源領域が現在の占有に関わっている場合には、該
要素中の上記情報(i)、(ii)を使用せずに、使用中
指示情報及び重複表示情報を1として第2管理情報を格
納するとともに、該第2管理情報よりポイントされる第
3管理情報の連鎖上に、上記第1管理情報中と同じ
(i)、(ii)の情報を上記複数の資源領域に対応して
格納し、該第3管理情報を上記請求範囲(1)に述べた
第2管理情報の代わりとして使用することを特徴とする
上記特許請求の範囲第(1)項記載の共有資源管理処理
方式。
2. A temporary management table for expanding an array of elements having the same size (this is a numbered element area) (6-1) and a pointer to each other to form a chain. It is divided into a chained area (6-2) and each element of the numbered element area (6-1) has the above information (i) and (ii) and the element is occupied by one of the resource areas. In-use instruction information (23) indicating whether or not it is used, and a pointer area (27) to the extended chain area are provided, and the tree portion β
Each node of is assigned a number of the element in the numbered element area to be used at the time of occupancy, and when the element is involved in occupying any one resource area of the nodes in the tree portion β, The above-mentioned information (i) and (ii) and the in-use instruction information (23) are stored as 1 as the second management information in the element position corresponding to the section, and if plural resource areas are the same on the temporary management table. When the element number is given and the plurality of resource areas are involved in the current occupation, the in-use instruction information is used without using the above information (i) and (ii) in the element. And the second management information is stored with the overlapping display information as 1, and the same (i) and (ii) as in the first management information is stored on the chain of the third management information pointed by the second management information. Information is stored corresponding to the plurality of resource areas, and the third management information is stored. The shared resource management processing method according to claim (1), which is used as a substitute for the second management information described in claim (1).
【請求項3】上記ツリー部分βの各節に対応する各資源
領域にシステム内で一意の固有名を与え、かつ、少なく
とも各資源領域に対して定まる、その固有名から一時管
理テーブル上の要素番号に変換するアルゴリズムを処理
システムに与え、かつ上記第2、第3管理情報中には、
上記第1管理情報中の(i)、(ii)の情報に加え、資
源領域固有名を指すポインタ情報を設けたことを特徴と
する上記特許請求の範囲第(2)項記載の共有資源管理
処理方式。
3. A unique name in the system is given to each resource area corresponding to each section of the tree portion β, and an element on the temporary management table is determined from the unique name at least for each resource area. An algorithm for converting into a number is given to the processing system, and in the second and third management information,
Shared resource management according to claim (2), characterized in that pointer information indicating a resource area unique name is provided in addition to the information (i) and (ii) in the first management information. Processing method.
【請求項4】上記第2管理情報中には、該第2管理情報
及びそれからポイントされる第3管理情報の連鎖へのア
クセス処理、及び連鎖を変更する処理に先立って占有す
べきセマフォアを表示する占有ビットを設け、該第2、
第3管理情報にアクセスする場合には、処理装置はアク
セスに先立って、その占有ビットを占有することを特徴
とする特許請求の範囲第(1)項記載の共有資源管理処
理方式。
4. The semaphore to be occupied in the second management information prior to the access processing to the chain of the second management information and the third management information pointed to by the second management information and the processing of changing the chain are displayed. An occupied bit to
When accessing the third management information, the processing device occupies the occupied bit prior to the access, and the shared resource management processing method according to claim (1).
JP3393987A 1987-02-17 1987-02-17 Shared resource management processing method Expired - Lifetime JPH0833836B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3393987A JPH0833836B2 (en) 1987-02-17 1987-02-17 Shared resource management processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3393987A JPH0833836B2 (en) 1987-02-17 1987-02-17 Shared resource management processing method

Publications (2)

Publication Number Publication Date
JPS63201732A JPS63201732A (en) 1988-08-19
JPH0833836B2 true JPH0833836B2 (en) 1996-03-29

Family

ID=12400476

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3393987A Expired - Lifetime JPH0833836B2 (en) 1987-02-17 1987-02-17 Shared resource management processing method

Country Status (1)

Country Link
JP (1) JPH0833836B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2671804B2 (en) * 1994-05-27 1997-11-05 日本電気株式会社 Hierarchical resource management method

Also Published As

Publication number Publication date
JPS63201732A (en) 1988-08-19

Similar Documents

Publication Publication Date Title
EP0586550A4 (en) Relational data base memory utilization analyzer
JPH0346043A (en) Real storage allocation method
US6424970B1 (en) Sorting system and method executed by plural computers for sorting and distributing data to selected output nodes
US6442553B1 (en) Hash system and hash method for transforming records to be hashed
JP3609841B2 (en) File management device
JPH0833836B2 (en) Shared resource management processing method
JP2704028B2 (en) File area management method
US7130857B2 (en) Method for accessing a memory unit in which sequences of notes are stored, corresponding memory unit and corresponding program
JPS63247848A (en) Data input/output system
CN116166203B (en) Method, device, equipment and medium for managing naming space of RAID card
JPH08115238A (en) File system
JP2633342B2 (en) Information retrieval device
JPH0423143A (en) Data storing system
US20020124164A1 (en) Method for starting computer system
JPH0869399A (en) File management device
JPS63192126A (en) Processing system for space control of data set
JP2604787B2 (en) Two-dimensional data storage method
JPS593549A (en) File management system
JP2743857B2 (en) Data area management system for area shared files
JPS60129852A (en) File managing method
JP3265993B2 (en) Sorting device
JPH07210431A (en) Method for managing data base
JPH07134673A (en) Memory managing method
JPS58150186A (en) System for controlling buffer memory
JPH08249225A (en) Memory management device