Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP3918641B2 - Exclusive control method and exclusive control system for shared resources - Google Patents
[go: Go Back, main page]

JP3918641B2 - Exclusive control method and exclusive control system for shared resources - Google Patents

Exclusive control method and exclusive control system for shared resources Download PDF

Info

Publication number
JP3918641B2
JP3918641B2 JP2002165487A JP2002165487A JP3918641B2 JP 3918641 B2 JP3918641 B2 JP 3918641B2 JP 2002165487 A JP2002165487 A JP 2002165487A JP 2002165487 A JP2002165487 A JP 2002165487A JP 3918641 B2 JP3918641 B2 JP 3918641B2
Authority
JP
Japan
Prior art keywords
exclusion
exclusive
request
program
shared resource
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 - Fee Related
Application number
JP2002165487A
Other languages
Japanese (ja)
Other versions
JP2004013485A (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.)
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 JP2002165487A priority Critical patent/JP3918641B2/en
Publication of JP2004013485A publication Critical patent/JP2004013485A/en
Application granted granted Critical
Publication of JP3918641B2 publication Critical patent/JP3918641B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、コンピュータシステムにおける共用資源の排他制御方法および排他制御システムに関し、特に、データアクセス処理において排他要資源と排他不要資源とを判別し、排他を行なうか否かを決定して、共用資源の排他区間を短縮する共用資源の排他制御方法および排他制御システムに関するものである。
【0002】
【従来の技術】
従来、コンピュータなどのデータ処理システムにおいて、単一の資源が、その資源へのアクセスを要求し得るプログラムによって共用されるということが行なわれている。同時に複数のプログラムからアクセス要求が出された場合に、一般的に、1つのプログラムが共用資源をアクセスしている間に、他のプログラムが当該共用資源をアクセスできないように、共用資源に排他が施され、順番にアクセスが行なわれる。図14は、従来の共用資源の排他制御システムのブロック図を示す。図14に示すように、従来の共用資源の排他制御システムは、プログラム51からのデータアクセス要求を処理するデータアクセス手段52と、プログラム51からの排他要求および排他解除要求を処理する共用資源排他手段53とから構成されている。
【0003】
プログラム51は、データのアクセスに先立って、共用資源排他手段53を用いて共用資源の排他を要求し、排他が成功すれば、データアクセス手段52を用いてデータアクセスを行なう。データの参照や更新などのデータアクセスが完了すれば、プログラム51は、共用資源排他手段53を用いて共用資源の排他解除を行う。また、プログラム51が、例えばデータl、m、nといった複数の共用資源内のデータのアクセスを行なう場合に、それらのデータアクセスの度毎に共用資源の排他を行うと、それらの動作に伴うオーバヘッドが無視できなくなる場合が発生するため、データl、m、nへのデータアクセスに先立って、それらデータの収容されている共用資源の排他がまとめて実行され、データl、m、nのデータアクセスが全て終了した時点で、それら共用資源の排他解除が実行されるということが行われている。
【0004】
【発明が解決しようとする課題】
上述した従来の技術では、複数のデータのアクセスに先立って、それらのデータの収容されている共用資源の排他が行なわれるが、それらの共用資源が全て、他のプログラムによるアクセスを排他する必要のある共用資源であるとは限らない。共用資源には、共用資源自身への同時アクセス数に有限の制限があるため、プログラムの同時実行数が制限される共用資源と、共用資源自身への同時アクセス数に制限がないため、プログラムの同時実行数が制限されない共用資源とがある。前者は、アクセスの際に、排他が必要とされる共用資源(以後、「排他要資源」という)であり、後者は、排他が必要とされない共用資源(以後、「排他不要資源」という)である。前者の代表がファイルであり、後者の代表がメモリである。ファイルの場合には、システムにより同時にアクセスできるプロセス数の上限が設定されているため、排他が必要となる。メモリの場合には、そのような上限がないため、排他が不要である。
【0005】
図14において、プログラム51がアクセスするデータが全て排他要資源内にあるデータl、m、nである場合には、データl、m、nをアクセスしている間中、共用資源(排他要資源)を排他している必要がある。しかしながら、プログラム51がアクセスするデータが、例えば、排他不要資源内にあるデータl’、m’と排他要資源要内にあるデータnとであるような場合には、データnをアクセスするときだけ排他を行なえば十分であり、データl’、m’、nをアクセスしている間中、排他していると排他区間が不要に長くなる。
【0006】
本発明はこれらの課題に鑑みてなされたものであって、その目的は、プログラムがデータアクセスする際、そのデータの収容されている共用資源が排他要資源であるか排他不要資源であるかをプログラム側で意識することなく、データアクセス処理において、排他要資源と排他不要資源とを判別し、排他を行なうか否かを決定して、共用資源の排他区間を短縮することによって、プログラム間の排他による待ち合わせを削減する共用資源の排他制御方法および排他制御システムを提供することである。
【0007】
【課題を解決するための手段】
上記の目的を達成するため、本発明によれば、プログラムからの排他要求、排他解除要求およびデータアクセス要求を入力して共用資源の排他処理、排他解除処理およびデータアクセス処理を行なう共用資源の排他制御方法であって、前記プログラムからの排他要求に対して、共用資源の排他が行なわれずに、前記プログラムに排他成功が返却され、前記排他処理が、前記データアクセス要求されたデータの格納場所に基づき、前記データが排他を必要としない共用資源内のデータである場合には排他を行なわず、前記データが排他を必要とする共用資源内のデータである場合には排他を行なうことを特徴とする共用資源の排他制御方法、が提供される。
【0008】
また、上記の目的を達成するため、本発明によれば、プログラムからの排他要求、排他解除要求およびデータアクセス要求を入力して共用資源の排他処理、排他解除処理およびデータアクセス処理を行なう共用資源の排他制御方法であって、前記プログラムからの排他要求に対して、共用資源の排他が行なわれずに、前記プログラムに排他成功が返却され、排他の要/不要は、前記プログラムからデータアクセスが要求された際にそのアクセス対象のデータの格納場所に基づいて判断され、前記排他要求が、中間に排他解除要求が要求されることなく、連続して要求されたとき、あるいは/および、前記排他解除要求が、中間に排他要求が要求されることなく、連続して要求されたときに、前記複数の排他要求あるいは/および排他解除要求のうちの最初の要求以外の要求時には前記プログラムに排他失敗あるいは/および排他解除失敗が返却され要求に対する処理が終了することを特徴とする共用資源の排他制御方法、が提供される。
【0009】
また、上記の目的を達成するため、本発明によれば、同時に動作し得る1つまたは複数のプログラムからの排他要求、排他解除要求およびデータアクセス要求を入力して共用資源の排他処理、排他解除処理およびデータアクセス処理を行なう共用資源の排他制御方法であって、前記プログラムからの排他要求に対して、共用資源の排他が行なわれずに、前記プログラムに排他成功が返却され、排他の要/不要は、前記プログラムからデータアクセスが要求された際にそのアクセス対象のデータの格納場所に基づいて判断され、前記各プログラムが動作するプロセス毎の排他状態を記録するプロセス管理表を有し、前記プロセス管理表を参照して排他状態の変化が行なわれることを特徴とする共用資源の排他制御方法、が提
供される。
【0010】
また、上記の目的を達成するため、本発明によれば、上記共用資源の排他制御方法を実行する排他制御システム、が提供される。
【0011】
【発明の実施の形態】
次に、本発明の実施の形態について図面を参照して詳細に説明する。
〔第1の実施の形態〕
図1は、本発明の第1の実施の形態に係る共用資源の排他制御システムのブロック図である。図1に示すように、本実施の形態に係る共用資源の排他制御システムは、プログラム11からのデータアクセス要求を処理するデータアクセス手段12と、プログラム11からの排他要求および排他解除要求を処理する共用資源排他手段13とを有している。データアクセス手段12および共用資源排他手段13の働きは、以下の通りである。
共用資源排他手段13は、プロセス管理表14を持っている。プロセス管理表14には、プログラム11が動作するプロセス毎にプロセス番号が設けられ、各プロセス番号には、仮排他状態15および実排他状態16という2つの欄が備えられている。仮排他状態15および実排他状態16は、排他済みか排他未かのいずれかを取り得る。仮排他状態15および実排他状態16は、そのプロセス番号に対応したプロセスが何らのデータアクセス動作状態にないときに排他未となり、排他要求、データアクセス要求あるいは排他解除要求の状態にあるときに、その状態に応じて変化する。したがって、仮排他状態15および実排他状態16は、プログラム11が動作する各プロセスの状態を表わすものであって、どの共用資源(排他要資源)が排他されているかを示すものではない。
【0012】
共用資源排他手段13は、(1)プログラム11から、データのアクセスに先立って共用資源の排他要求が出されると、(2)プログラム11が動作するプロセス毎にプロセス管理表14の対応したプロセス番号の仮排他状態15を仮排他済みに更新し、実際には共用資源の排他を行わずに、(3)プログラム11に対して排他成功を返却する。この時点では、共用資源には、何らの動作も加えられていない。共用資源排他手段13は、また、(6)データアクセス手段12から実排他要求があれば、(7)プログラム11が動作するプロセス毎にプロセス管理表14の対応したプロセス番号の実排他状態16を参照し、(8)実排他済みでなければ、共用資源(排他要資源)が他のプログラムのプロセスあるいは自プログラムの他プロセス(以下、「他プロセス」と総称する)から排他されていない場合はそのプロセスで排他要資源の排他処理を行い、排他要資源が他プロセスから排他されている場合は他プロセスからの排他が解除されるのを待ってからそのプロセスで排他要資源の排他処理を行い、(9)排他処理が完了したときに、プログラム11が動作するプロセス毎にプロセス管理表14の対応したプロセス番号の実排他状態16を実排他済みに更新し、(10)データアクセス手段12に排他成功を返却する。共用資源排他手段13は、さらに、(12)プログラム11から排他解除要求があれば、(13)プログラム11が動作するプロセス毎にプロセス管理表14の対応するプロセス番号の仮排他状態15および実排他状態16を、それぞれ、仮排他未、実排他未とし、(14)共用資源の排他を解除する。上記の過程(8)において、実排他要求に対して、プロセス管理表14の実排他状態16が実排他済みであれば、共用資源排他手段13は、排他処理を行わずにデータアクセス手段12に排他成功を返却する。
【0013】
データアクセス手段12は、(3)共用資源排他手段13からプログラム11に排他成功が返却されて、(4)プログラム11からデータアクセスが要求されると、そのアクセス対象のデータが排他要資源内にあるか排他不要資源内にあるかを判定し、(5)アクセス対象が排他不要資源内にあった場合は、共用資源排他手段13に実排他要求を行うことなく、排他不要資源内のデータのアクセスを行ない、(6)アクセス対象が排他要資源内にあった場合は、共用資源排他手段13に実排他要求を行う。データアクセス手段12は、また、(10)共用資源排他手段13から排他成功が返却されると、(11)排他要資源内のデータのアクセスを行なう。
【0014】
このようにして、プログラム11では共用資源の排他、データのアクセス、および、共用資源の排他解除の要求を行うという従来通りの処理が変更されることなく、データアクセス手段12が、実際にデータアクセスを行なうときに、排他要資源のみの排他を行うことによって、排他区間を短くすることが可能になる。
【0015】
図2は、図1のデータアクセス手段12および共用資源排他手段13の処理動作を説明するためのフローチャートである。図2のフローチャートを参照して、本実施の形態に係る共用資源の排他制御方法の全体の動作について説明する。
f11:プログラム11から共用資源排他手段13に排他要求が出され、共用資源排他手段13にて、仮排他処理が行なわれる。
f120:共用資源排他手段13からプログラム11に排他成功が返却されると、プログラム11からデータアクセス手段12に、1つあるいは複数のデータアクセス要求が出され、データアクセス手段12が、プログラム11より要求されたデータアクセス要求を順次実行する。
f121:プログラム11は全てのデータアクセス要求が完了したか否かを判定する。完了していればf15に進み、排他解除処理を行なう。完了していなければf122に進む。
f122:データアクセス手段はアクセス要求されたデータを収容している資源が排他要資源であるか否かを判定する。排他要資源でなければステップf123に進み、排他要資源であればステップf124に進む。
f123:データアクセス手段12が、実排他要求を行なうことなく、排他不要資源内のアクセス対象データのアクセスを行なって、ステップf121に戻る。f124:データアクセス手段12が、実排他要求を共用資源排他手段13に出力する。
f13:共用資源排他手段13が、排他要資源の排他を行ない、データアクセス手段12に排他成功を返却する。
f14:データアクセス手段12が、共用資源排他手段13から返却された排他成功をみて、排他された排他要資源内のデータのアクセスを行なう。
ステップf121からステップf14までを、全てのデータアクセス要求について繰り返し、全てのデータアクセス要求が完了するとプログラム11から排他解除要求が出され、ステップf15に進む。
f15:共用資源排他手段13にて、排他要資源の排他解除処理が行なわれる。
【0016】
次に、図3のフローチャートを参照して、図2の仮排他フロー(ステップf11)の動作について詳細に説明する。
先ず、従来通り、プログラム11が、共用資源排他手段13に排他要求を出す。
f110:共用資源排他手段13が、取得された排他要求のプロセスに対応するプロセス管理表14のプロセス番号の仮排他状態15が仮排他済みであるか否かを判定する。仮排他済みでなければステップf111に進み、仮排他済みであればステップf113に進む。
f111:共用資源排他手段13が、仮排他状態15を仮排他済みに更新する。f112:共用資源排他手段13からプログラム11に排他成功を返却する。
f113:共用資源排他手段13からプログラム11に排他失敗を返却する。
【0017】
プログラム11が誤って共用資源排他手段13に、2度連続して排他要求を行った場合は、2度目の排他要求時に、仮排他状態15が仮排他済みになっている。この場合には、ステップf113によって、2度目の排他要求の処理が終了させられる。1度目の排他要求は、ステップf111以降のステップに進んでいく。このように、プロセス管理表14にプロセスの仮排他状態を記録しておくことによって、誤った排他要求による動作が防止される。
【0018】
共用資源排他手段13から排他成功を返却されると、プログラム11は、従来通り、1つもしくは複数のデータアクセス要求を出す。
次に、図4のフローチャートを参照して、図2の実排他フロー(ステップf13)の動作について詳細に説明する。
f130:共用資源排他手段13が、実排他要求のプロセスに対応するプロセス管理表14のプロセス番号の実排他状態16が実排他済みであるか否かを判定する。実排他状態16が実排他済みである場合には、ステップf135に進み、実排他済みでない場合には、ステップf131に進む。
f131:アクセス対象排他要資源が、他プロセスから排他されているか否かを調べる。排他されていない場合には、ステップf132に進み、排他されている場合には、ステップf133に進む。
f132:アクセス対象排他要資源を排他する。
f133:他プロセスからの排他の解除を待ってから、アクセス対象排他要資源を排他する。
f134:プロセス管理表14の対応するプロセス番号の実排他状態16を実排他済みに更新する。
f135:共用資源排他手段13からデータアクセス手段12へ排他成功を返却する。
【0019】
次に、図5のフローチャートを参照して、図2の排他解除フロー(ステップf15)の動作について詳細に説明する。
f150:共用資源排他手段13が、プロセス管理表14の対応するプロセス番号の仮排他状態15が仮排他済みであるか否かを判定する。仮排他状態15が仮排他済みでない場合には、ステップf151に進み、仮排他済みである場合には、ステップf152に進む。
f151:共用資源排他手段13からプログラム11に排他解除失敗を返却して、本実施の形態の排他制御方法の全過程を終了する。
f152:仮排他状態15を仮排他未に更新する。
f153:プロセス管理表14の対応するプロセス番号の実排他状態16が実排他済みであるか否かが判定される。実排他状態16が実排他済みでない場合には、ステップf156に進み、実排他済みである場合には、ステップf154に進む。
f154:実排他状態16を実排他未に更新する。
f155:排他要資源の排他を解除する。
f156:共用資源排他手段13からプログラム11に、排他解除成功を返却して、本実施の形態の排他制御方法の全過程を終了する。
ステップf151は、図3の仮排他フローf11におけるステップf113と同様に、2度目の要求を無効にするためである。
【0020】
以上説明したように、プログラムから排他要求が出されたときには排他を行わず、データアクセス手段が、アクセス対象のデータが排他要資源内にあるか、排他不要資源内にあるかを判定し、アクセス対象のデータが排他不要資源内にあれば、排他を行なうことなく直ちにアクセスが行なわれ、データアクセス手段が実際に排他要資源をアクセスするときに排他が行われる。これによって、共用資源(排他要資源)の排他区間を短くすることが可能である。さらに、プロセス管理表にプロセス毎の仮排他状態、実排他状態を記録しておくことによって、二重排他や二重排他解除の誤りを検出することが可能である。この際、プログラム11から見れば、排他を要求すると排他成功が返却され、次いで、データアクセスを要求するとデータアクセスが実行され、次に、データアクセスが完了した後、排他解除を要求すると排他解除成功が返却されるという、従来通りの過程が変更されることなく実行される。
【0021】
〔第2の実施の形態〕
図6および図7は、本発明の第2の実施の形態に係る共用資源の排他制御システムのブロック図である。図6および図7に示すように、本実施の形態に係る共用資源の排他制御システムは、第1の実施の形態に係る共用資源の排他制御システムと同様に、プログラムからのデータアクセス要求を処理するデータアクセス手段22と、プログラムからの排他要求および排他解除要求を処理する共用資源排他手段23とを有している。共用資源排他手段23は、プログラムが動作する各プロセスの状態を表わすプロセス管理表24を持っている。なお、図6および図7において、データアクセス要求されたデータが排他不要資源内のデータである場合の処理が省略されている。
【0022】
本実施の形態においては、2種類の異なるプログラム群21a、21bが扱われる。プログラム群21a内のプログラム同士およびプログラム群21b内のプログラム同士は、ともに、それぞれのプログラム群内では、第1の実施の形態と同様に、同一の排他要資源に同時にアクセスすることはできない。しかしながら、第1の実施の形態と異なって、プログラム群21a内のプログラムとプログラム群21b内のプログラムとの間では、1つの排他要資源を同時にアクセスすることが可能である。
【0023】
このようなことは、プログラム群21a内のプログラム21Aが共用資源排他手段23にプログラム群21a内だけで有効な排他種別Aで排他要求を行い、プログラム群21b内のプログラム21Bが共用資源排他手段23にプログラム群21b内だけで有効な排他種別Bで排他要求を行うというように2種類の排他を行なうことで実現される。しかしながら、データアクセス手段22から実排他要求を行う場合、従来のようにプログラム21Aやプログラム21Bからデータアクセスが要求されるだけでは、排他要資源内のデータアクセス時に、どちらの排他種別で排他要資源の排他を行えばよいか判定できない。そこで、プログラム21Aやプログラム21Bからデータアクセス手段22にどちらの種類の排他を行なうべきかの情報を提供する方法も考えられるが、それは、従来のアクセス方法を変えることになり、プログラムとデータアクセス手段との間のインターフェースの変更を伴う。そこで、本実施の形態においては、プロセス管理表24で、排他種別ごとに、各プログラムの各プロセスに対応する仮排他状態25A、25Bと実排他状態26A、26Bを管理することにより、従来のプログラムとデータアクセス手段との間のインターフェースの変更を伴うことなく、1つの排他要資源を同時にアクセスすることを可能にする。
【0024】
図8は、図6のデータアクセス手段22および共用資源排他手段23の処理動作を説明するためのフローチャートである。図8におけるステップf220〜f224、f24における処理動作は、第1の実施の形態の図2のステップf120〜f124、f14における処理動作と同じである。また、仮排他フロー(ステップf21)、実排他フロー(ステップf23)、排他解除フロー(ステップf25)における処理動作は、排他種別がAかBかを判定して行われるという点を除けば、各ステップに対応する第1の実施の形態の図2のフローにおける各ステップの処理動作とほぼ同じである。
【0025】
次に、図9のフローチャートを参照して、図8の仮排他フロー(ステップf21)の動作について説明する。
f210A:共用資源排他手段23で、排他要求が排他種別Aであるか否かが判定される。排他要求が排他種別Aでない場合には、ステップf210Bに進み、排他要求が排他種別Aである場合には、ステップf211Aに進む。
f210B:共用資源排他手段23で、排他要求が排他種別Bであるか否かが判定される。排他要求が排他種別Bである場合には、ステップf211Bに進み、排他種別Bでない場合には、ステップf215に進む
f211A/f211B:共用資源排他手段23が、排他要求のプロセスに対応するプロセス管理表24のプロセス番号で排他種別A/Bを選択し、その仮排他状態25A/25Bが仮排他済みであるか否かを判定する。仮排他済みでなければステップf212A/212Bに進み、仮排他済みであればステップf214A/214Bに進む。
f212A/212B:仮排他状態25A/25Bを排他済みに更新する。
f215:ステップ210Bにおいて排他要求が排他種別Bでないときは、その排他要求が、プログラム21Aおよび21B以外のプログラムからの排他要求であり、そのプログラムに排他成功を返却する。
ステップf213A〜f214Aのフロー、および、ステップf213B〜f214Bのフローの動作は、第1の実施の形態の場合の図3のステップf112〜f113のフローの動作と同様である。
【0026】
次に、図10および図11のフローチャートを参照して、図8の実排他フロー(ステップf23)の動作について説明する。
ステップf230A:共用資源排他手段23が、プロセス管理表24の対応するプロセス番号を参照して、その仮排他状態25A、25Bのうち仮排他済みになっている排他種別が排他種別Aであるか否かを判定する。排他種別Aでない場合にはステップf230Bに進む。排他種別Aである場合には、実排他要求が排他種別Aの実排他要求であり、ステップf231Aに進む。
ステップf230B:共用資源排他手段23が、プロセス管理表24の対応するプロセス番号の仮排他状態25Bが仮排他済みになっているか否かを判定する。仮排他済みになっていなければ、ステップf236に進む。仮排他済みになっていれば、実排他要求が排他種別Bの実排他要求であり、ステップf231Bに進む。
ステップf231A〜f236のフロー、および、ステップf231B〜f236のフローの動作は、第1の実施の形態の場合の図4のステップf130〜f135のフローの動作と同様である。
【0027】
次に、図12および図13のフローチャートを参照して、図8の排他解除フロー(ステップf25)の動作について説明する。
ステップf250Aでは、共用資源排他手段23において、排他解除要求が排他種別Aであるか否かが判定される。排他解除要求が排他種別Aである場合には、ステップf251Aに進む。排他解除要求が排他種別Aでない場合には、ステップf250Bに進む。ステップf250Bでは、排他解除要求が排他種別Bであるか否かが判定される。排他解除要求が排他種別Bである場合には、ステップf251Bに進む。排他解除要求が排他種別Bでない場合には、その排他解除要求が、プログラム21Aおよび21B以外のプログラムからの排他解除要求であり、そのプログラムに排他解除成功を返却する。
ステップf251A〜f257Aのフロー、および、ステップf251B〜f257Bのフローの動作は、第1の実施の形態の場合の図6のステップf150〜f156のフローの動作と同様である。
【0028】
本実施の形態においては、第1の実施の形態の場合と同様に、プログラム1Aやプログラム1Bとデータアクセス手段22とのインタフェースを変更することなく、データアクセス手段22で排他要資源をアクセスするのか排他不要資源をアクセスするのかを判別して、排他を行うか否かを決定し、データアクセス手段22が実際にデータアクセスを行うときに排他要資源が排他されるようにすることによって、資源の排他区間の短縮を可能にする。さらに、本実施の形態においては、プロセス管理表24に排他種別ごとに各プロセスの状態を記録して管理することにより、プログラムとデータアクセス手段22との間の従来通りのインタフェースを変更することなく、1つの共用資源を複数のプログラム群中のプログラムで同時にアクセスすることを可能にする。
【0029】
【発明の効果】
以上説明したように、本発明に係る共用資源の排他制御方法は、データアクセス手段で排他要資源をアクセスするのか排他不要資源をアクセスするのかを判別して、排他を行うか否かを決定し、データアクセス手段が実際にデータアクセスを行うときに排他要資源が排他されるようにするものであるから、プログラムから見れば従来通りの動作を変更することなく、共用資源(排他要資源)の排他区間を短くすることが可能である。
また、本発明に係る共用資源の排他制御方法は、プロセス管理表にプロセス毎の仮排他状態、実排他状態を記録して管理するものであるから、二重排他や二重排他解除の誤りを検出することが可能である。
また、本発明に係る共用資源の排他制御方法は、プロセス管理表に排他種別ごとに各プロセスの状態を記録して管理するものであるから、プログラムとデータアクセス手段との間の従来通りのインタフェースを変更することなく、1つの共用資源を複数のプログラム群中のプログラムで同時にアクセスすることを可能にする。
【図面の簡単な説明】
【図1】 本発明の第1の実施の形態に係る共用資源の排他制御システムのブロック図。
【図2】 図1のデータアクセス手段および共用資源排他手段の処理動作を説明するためのフローチャート。
【図3】 図2の仮排他処理のフローチャート。
【図4】 図2の実排他処理のフローチャート。
【図5】 図2の排他解除処理のフローチャート。
【図6】 本発明の第2の実施の形態に係る共用資源の排他制御システムのブロック図の一部。
【図7】 本発明の第2の実施の形態に係る、図6の残りの共用資源の排他制御システムのブロック図。
【図8】 図6のデータアクセス手段および共用資源排他手段の処理動作を説明するためのフローチャート。
【図9】 図8の仮排他処理のフローチャート。
【図10】 図8の実排他処理のフローチャートの一部。
【図11】 図8の実排他処理の、図10に続くフローのフローチャート。
【図12】 図8の排他解除処理のフローチャート。
【図13】 図8の排他解除処理の、図12に続くフローのフローチャート。
【図14】 従来の共用資源の排他制御システムのブロック図。
【符号の説明】
11、21A、21B、51 プログラム
12、22、52 データアクセス手段
13、23、53 共用資源排他手段
14、24 プロセス管理表
15、25A、25B 仮排他状態
16、26A、26B 実排他状態
21a、21b プログラム群
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an exclusive control method and an exclusive control system for a shared resource in a computer system, and more particularly to determining whether or not to perform exclusion in a data access process and determining whether or not to perform exclusion. The exclusive control method and the exclusive control system of the shared resource for shortening the exclusive section.
[0002]
[Prior art]
Conventionally, in a data processing system such as a computer, a single resource is shared by a program that can request access to the resource. When access requests are issued from multiple programs at the same time, in general, a shared resource is excluded so that another program cannot access the shared resource while one program is accessing the shared resource. Access is made in order. FIG. 14 shows a block diagram of a conventional exclusive control system for shared resources. As shown in FIG. 14, a conventional shared resource exclusion control system includes a data access unit 52 that processes a data access request from a program 51, and a shared resource exclusion unit that processes an exclusion request and an exclusion release request from the program 51. 53.
[0003]
Prior to data access, the program 51 requests exclusion of the shared resource using the shared resource exclusion unit 53, and if the exclusion is successful, performs data access using the data access unit 52. When data access such as data reference or update is completed, the program 51 uses the shared resource exclusion unit 53 to release the shared resource. Further, when the program 51 accesses data in a plurality of shared resources such as data l, m, and n, for example, if the shared resource is excluded every time the data is accessed, the overhead associated with these operations Therefore, prior to data access to data l, m, and n, exclusion of shared resources in which the data is stored is executed collectively, and data access of data l, m, and n is performed. When all the processes are completed, the exclusive release of these shared resources is executed.
[0004]
[Problems to be solved by the invention]
In the conventional technology described above, prior to accessing a plurality of data, the shared resources in which these data are stored are excluded. However, all of these shared resources need to exclude access by other programs. It is not necessarily a shared resource. Since shared resources have a finite limit on the number of concurrent accesses to the shared resource itself, there is no limit on the number of concurrent accesses to the shared resource itself and the number of concurrent accesses to the shared resource itself. There are shared resources whose number of concurrent executions is not limited. The former is a shared resource that requires exclusion upon access (hereinafter referred to as “exclusive resource”), and the latter is a shared resource that does not require exclusion (hereinafter referred to as “exclusive resource”). is there. The former representative is a file, and the latter representative is a memory. In the case of a file, since the upper limit of the number of processes that can be accessed simultaneously by the system is set, exclusion is necessary. In the case of a memory, since there is no such upper limit, exclusion is not necessary.
[0005]
In FIG. 14, when all the data accessed by the program 51 is data l, m, n in the exclusive required resources, the shared resources (exclusive required resources) are accessed while the data l, m, n are accessed. ) Must be exclusive. However, when the data accessed by the program 51 is, for example, the data l ′ and m ′ in the resource that does not require exclusion and the data n in the resource that requires exclusion, only when accessing the data n. Exclusion is sufficient, and while the data l ′, m ′, and n are being accessed, if the exclusion is performed, the exclusive section becomes unnecessarily long.
[0006]
The present invention has been made in view of these problems, and it is an object of the present invention to determine whether a shared resource storing the data is an exclusive required resource or an exclusive unnecessary resource when the program accesses the data. Without considering the program side, in the data access process, by determining the exclusion required resource and the exclusion unnecessary resource, decide whether to perform exclusion, shorten the shared resource exclusion section, between the programs An object of the present invention is to provide an exclusive control method and an exclusive control system for shared resources that reduce waiting due to exclusion.
[0007]
[Means for Solving the Problems]
In order to achieve the above object, according to the present invention, an exclusive request, an exclusive release request and a data access request from a program are input to perform an exclusive process, an exclusive release process and a data access process of the shared resource. In the control method, in response to an exclusion request from the program, the exclusion of shared resources is not performed, but exclusion success is returned to the program, and the exclusion process is performed when the data access requested data Based on the storage location of the data Is not in the case of data in a shared resource that does not require exclusion, Said There is provided an exclusive control method for a shared resource, wherein the exclusion is performed when the data is data in a shared resource that requires exclusion.
[0008]
In order to achieve the above object, according to the present invention, a shared resource that performs exclusive processing, exclusive release processing, and data access processing of a shared resource by inputting an exclusive request, an exclusive release request, and a data access request from a program. In this exclusive control method, a shared resource is not excluded in response to an exclusion request from the program, and the exclusion success is returned to the program. Data to be accessed when Storage location The exclusion request is requested continuously without requiring an exclusion release request in the middle, and / or the exclusion request is requested in the middle of the exclusion request. When the request is made continuously, when the request is other than the first request among the plurality of exclusive requests and / or exclusive release requests, exclusive failure or / and exclusive release failure is returned to the program, and processing for the request is performed. There is provided an exclusive control method for a shared resource, characterized by being terminated.
[0009]
In order to achieve the above object, according to the present invention, an exclusive request, an exclusive release request, and a data access request from one or a plurality of programs that can operate simultaneously are input, and an exclusive process and an exclusive release of a shared resource are performed. A method for exclusive control of a shared resource that performs processing and data access processing, and in response to an exclusion request from the program, the exclusion of the shared resource is not performed, and the exclusion success is returned to the program, and exclusion is necessary / unnecessary Is the data to be accessed when data access is requested by the program Storage location And a process management table that records an exclusive state for each process in which each program operates, and the exclusive state is changed with reference to the process management table. Exclusive control method, proposed
Provided.
[0010]
In order to achieve the above object, according to the present invention, there is provided an exclusive control system that executes the shared resource exclusive control method.
[0011]
DETAILED DESCRIPTION OF THE INVENTION
Next, embodiments of the present invention will be described in detail with reference to the drawings.
[First Embodiment]
FIG. 1 is a block diagram of a shared resource exclusive control system according to the first embodiment of the present invention. As shown in FIG. 1, the shared resource exclusive control system according to the present embodiment processes data access means 12 that processes data access requests from the program 11, and exclusive requests and exclusive release requests from the program 11. Shared resource exclusion means 13. The functions of the data access unit 12 and the shared resource exclusion unit 13 are as follows.
The shared resource exclusion means 13 has a process management table 14. In the process management table 14, a process number is provided for each process in which the program 11 operates, and each process number has two columns, a temporary exclusive state 15 and a real exclusive state 16. The temporary exclusion state 15 and the actual exclusion state 16 can take either exclusion or exclusion. The temporary exclusive state 15 and the actual exclusive state 16 are not exclusive when the process corresponding to the process number is not in any data access operation state, and are in an exclusive request, data access request, or exclusive release request state. It changes according to the state. Therefore, the temporary exclusion state 15 and the actual exclusion state 16 represent the state of each process in which the program 11 operates, and do not indicate which shared resource (exclusion required resource) is excluded.
[0012]
When the shared resource exclusion means 13 (1) issues a shared resource exclusion request prior to data access from the program 11, (2) the process number corresponding to the process management table 14 for each process in which the program 11 operates. The temporary exclusion state 15 is updated to provisional exclusion, and (3) the exclusion success is returned to the program 11 without actually performing exclusion of the shared resource. At this point, no action has been added to the shared resource. The shared resource exclusion means 13 also (6) if there is a real exclusion request from the data access means 12, (7) sets the real exclusion state 16 of the corresponding process number in the process management table 14 for each process in which the program 11 operates. Refer to (8) if the shared resource (exclusion required resource) is not exclusive from the process of another program or other process of the own program (hereinafter collectively referred to as "other process") The exclusive resource is excluded from that process, and if the exclusive resource is locked from another process, the process waits for the exclusion from the other process to release the exclusive resource from that process. (9) When the exclusion process is completed, the real exclusion state 16 of the corresponding process number in the process management table 14 is updated to the real exclusion completed for each process in which the program 11 operates, (10) The exclusion success is returned to the data access means 12. The shared resource exclusion means 13 further, (12) if there is an exclusion release request from the program 11, (13) the temporary exclusion state 15 and the actual exclusion of the corresponding process number in the process management table 14 for each process in which the program 11 operates. The state 16 is set as temporary exclusion not yet actual exclusion, respectively (14) The exclusion of the shared resource is released. In the above step (8), if the real exclusion state 16 of the process management table 14 has been actually excluded in response to the real exclusion request, the shared resource exclusion unit 13 does not perform the exclusion process and sends it to the data access unit 12. Returns exclusion success.
[0013]
The data access means 12 (3) when exclusion success is returned from the shared resource exclusion means 13 to the program 11 and (4) data access is requested from the program 11, the data to be accessed is included in the exclusion required resource. (5) If the access target is in the exclusion-unnecessary resource, without making an actual exclusion request to the shared resource exclusion means 13, the data in the exclusion-unnecessary resource is determined. Access is performed. (6) If the access target is in the exclusive resource, an actual exclusive request is made to the shared resource exclusive means 13. When the exclusion success is returned from (10) the shared resource exclusion unit 13, the data access unit 12 (11) accesses the data in the exclusion required resource.
[0014]
In this way, in the program 11, the data access means 12 actually performs data access without changing the conventional processing of requesting exclusion of shared resources, accessing data, and releasing exclusion of shared resources. When performing the exclusion, it is possible to shorten the exclusion section by performing exclusion of only the resources requiring exclusion.
[0015]
FIG. 2 is a flowchart for explaining processing operations of the data access unit 12 and the shared resource exclusion unit 13 of FIG. The overall operation of the shared resource exclusive control method according to this embodiment will be described with reference to the flowchart of FIG.
f11: An exclusive request is issued from the program 11 to the shared resource exclusion means 13, and the shared resource exclusion means 13 performs temporary exclusion processing.
f120: When the exclusion success is returned from the shared resource exclusion means 13 to the program 11, one or more data access requests are issued from the program 11 to the data access means 12, and the data access means 12 requests from the program 11. The received data access requests are sequentially executed.
f121: The program 11 determines whether all data access requests are completed. If completed, the process proceeds to f15 to perform the exclusion release process. If not completed, the process proceeds to f122.
f122: The data access means determines whether or not the resource accommodating the requested data is an exclusive resource. If it is not an exclusive resource, the process proceeds to step f123, and if it is an exclusive resource, the process proceeds to step f124.
f123: The data access means 12 accesses the access target data in the resource not requiring exclusion without making a real exclusion request, and returns to step f121. f124: The data access means 12 outputs a real exclusion request to the shared resource exclusion means 13.
f13: The shared resource exclusion unit 13 performs exclusion of the exclusion required resource, and returns exclusion success to the data access unit 12.
f14: The data access means 12 accesses the data in the exclusive exclusion required resource in view of the exclusion success returned from the shared resource exclusion means 13.
Step f121 to step f14 are repeated for all data access requests. When all the data access requests are completed, an exclusion release request is issued from the program 11, and the process proceeds to step f15.
f15: The exclusive resource exclusion means 13 performs exclusive release processing for the exclusive resource.
[0016]
Next, the operation of the temporary exclusion flow (step f11) in FIG. 2 will be described in detail with reference to the flowchart in FIG.
First, as usual, the program 11 issues an exclusion request to the shared resource exclusion means 13.
f110: The shared resource exclusion means 13 determines whether or not the provisional exclusion state 15 of the process number in the process management table 14 corresponding to the acquired exclusion request process is provisionally excluded. If it is not provisionally exclusive, the process proceeds to step f111. If it is provisionally exclusive, the process proceeds to step f113.
f111: The shared resource exclusion unit 13 updates the provisional exclusion state 15 to provisional exclusion. f112: The exclusion success is returned from the shared resource exclusion means 13 to the program 11.
f113: The exclusion failure is returned from the shared resource exclusion means 13 to the program 11.
[0017]
If the program 11 mistakenly makes an exclusive request to the shared resource exclusion means 13 twice in succession, the temporary exclusion state 15 is temporarily excluded at the time of the second exclusion request. In this case, the process of the second exclusion request is terminated at step f113. The first exclusion request proceeds to steps after step f111. As described above, by recording the temporary exclusion state of the process in the process management table 14, an operation due to an erroneous exclusion request is prevented.
[0018]
When the exclusion success is returned from the shared resource exclusion means 13, the program 11 issues one or more data access requests as usual.
Next, the operation of the actual exclusive flow (step f13) in FIG. 2 will be described in detail with reference to the flowchart in FIG.
f130: The shared resource exclusion means 13 determines whether or not the actual exclusion state 16 of the process number in the process management table 14 corresponding to the process of the actual exclusion request has been actually excluded. When the real exclusion state 16 is the real exclusion, the process proceeds to step f135, and when the real exclusion state 16 is not the actual exclusion, the process proceeds to step f131.
f131: It is checked whether or not the access-target exclusion required resource is exclusive from another process. If it is not exclusive, the process proceeds to step f132. If it is exclusive, the process proceeds to step f133.
f132: Exclude the access target exclusion required resource.
f133: Waiting for the release of exclusion from another process, and then exclude the access-target exclusion required resource.
f134: The real exclusion state 16 of the corresponding process number in the process management table 14 is updated to the real exclusion completed.
f135: The exclusion success is returned from the shared resource exclusion means 13 to the data access means 12.
[0019]
Next, the operation of the exclusion release flow (step f15) in FIG. 2 will be described in detail with reference to the flowchart in FIG.
f150: The shared resource exclusion means 13 determines whether or not the provisional exclusion state 15 of the corresponding process number in the process management table 14 is provisional exclusion. If the provisional exclusion state 15 is not provisional exclusion, the process proceeds to step f151. If provisional exclusion is complete, the process proceeds to step f152.
f151: The exclusion cancellation failure is returned from the shared resource exclusion means 13 to the program 11, and the entire process of the exclusion control method of this embodiment is terminated.
f152: The temporary exclusion state 15 is updated to temporary exclusion not yet performed.
f153: It is determined whether or not the actual exclusion state 16 of the corresponding process number in the process management table 14 has been actually excluded. When the real exclusion state 16 is not actually excluded, the process proceeds to step f156, and when the actual exclusion state is completed, the process proceeds to step f154.
f154: The actual exclusion state 16 is updated to not actual exclusion.
f155: The exclusion of the resource requiring exclusion is released.
f156: The exclusion cancellation success is returned from the shared resource exclusion means 13 to the program 11, and the whole process of the exclusive control method of this embodiment is terminated.
Step f151 is for invalidating the second request, similar to step f113 in the provisional exclusive flow f11 in FIG.
[0020]
As described above, when an exclusion request is issued from a program, no exclusion is performed, and the data access means determines whether the data to be accessed is in an exclusion required resource or an exclusion unnecessary resource, and accesses If the target data is in a resource that does not require exclusion, access is performed immediately without performing exclusion, and exclusion is performed when the data access means actually accesses the resource that requires exclusion. This makes it possible to shorten the exclusive section of the shared resource (exclusive resource requirement). Furthermore, by recording the temporary exclusion status and the actual exclusion status for each process in the process management table, it is possible to detect errors in double exclusion and double exclusion cancellation. At this time, from the viewpoint of the program 11, when exclusion is requested, exclusion success is returned, then when data access is requested, data access is executed, and then, after data access is completed, exclusion cancellation is successful. The conventional process of returning is executed without change.
[0021]
[Second Embodiment]
6 and 7 are block diagrams of the exclusive control system for shared resources according to the second embodiment of the present invention. As shown in FIGS. 6 and 7, the shared resource exclusive control system according to the present embodiment processes a data access request from a program in the same manner as the shared resource exclusive control system according to the first embodiment. Data access means 22 for executing the exclusive access and exclusive resource release means 23 for processing the exclusion request and the exclusion release request from the program. The shared resource exclusion means 23 has a process management table 24 that represents the state of each process in which the program operates. In FIG. 6 and FIG. 7, the processing when the data requested to be accessed is data in the exclusion unnecessary resource is omitted.
[0022]
In the present embodiment, two different types of program groups 21a and 21b are handled. Both the programs in the program group 21a and the programs in the program group 21b cannot access the same exclusive resource simultaneously in the respective program groups, as in the first embodiment. However, unlike the first embodiment, it is possible to simultaneously access one exclusive resource between the program in the program group 21a and the program in the program group 21b.
[0023]
This is because the program 21A in the program group 21a makes an exclusion request to the shared resource exclusion means 23 with an exclusion type A that is valid only in the program group 21a, and the program 21B in the program group 21b is in the shared resource exclusion means 23. This is realized by performing two types of exclusion, such as making an exclusion request with an exclusion type B that is valid only within the program group 21b. However, when a real exclusion request is made from the data access means 22, the exclusive resource requirement for which type of exclusion is required at the time of data access in the exclusive resource requirement only by requesting data access from the program 21 </ b> A or 21 </ b> B as in the prior art. It is not possible to determine whether or not exclusion should be performed. Therefore, a method of providing information on which kind of exclusion should be performed from the program 21A or the program 21B to the data access means 22 is conceivable, but this changes the conventional access method, and the program and the data access means. With interface changes between. Therefore, in the present embodiment, the process management table 24 manages the temporary exclusive states 25A and 25B and the actual exclusive states 26A and 26B corresponding to each process of each program for each exclusion type, so that the conventional program It is possible to simultaneously access one exclusive resource without changing the interface between the data access means and the data access means.
[0024]
FIG. 8 is a flowchart for explaining the processing operations of the data access means 22 and the shared resource exclusion means 23 of FIG. The processing operations in steps f220 to f224 and f24 in FIG. 8 are the same as the processing operations in steps f120 to f124 and f14 in FIG. 2 of the first embodiment. In addition, the processing operations in the temporary exclusion flow (step f21), the actual exclusion flow (step f23), and the exclusion release flow (step f25) are performed by determining whether the exclusion type is A or B. The processing operation of each step in the flow of FIG. 2 of the first embodiment corresponding to the step is almost the same.
[0025]
Next, the operation of the temporary exclusion flow (step f21) in FIG. 8 will be described with reference to the flowchart in FIG.
f210A: The shared resource exclusion means 23 determines whether or not the exclusion request is the exclusion type A. If the exclusion request is not the exclusion type A, the process proceeds to step f210B. If the exclusion request is the exclusion type A, the process proceeds to step f211A.
f210B: The shared resource exclusion means 23 determines whether or not the exclusion request is the exclusion type B. If the exclusion request is the exclusion type B, the process proceeds to step f211B. If the exclusion request is not the exclusion type B, the process proceeds to step f215.
f211A / f211B: The shared resource exclusion means 23 selects the exclusion type A / B with the process number in the process management table 24 corresponding to the process of the exclusion request, and whether or not the provisional exclusion state 25A / 25B is provisionally exclusive. Determine whether. If not provisionally exclusive, the process proceeds to step f212A / 212B. If provisional exclusion has been completed, the process proceeds to step f214A / 214B.
f212A / 212B: The temporary exclusion state 25A / 25B is updated to exclusive.
f215: When the exclusion request is not the exclusion type B in step 210B, the exclusion request is an exclusion request from a program other than the programs 21A and 21B, and the exclusion success is returned to the program.
The flow of steps f213A to f214A and the flow of steps f213B to f214B are the same as the flow of steps f112 to f113 of FIG. 3 in the first embodiment.
[0026]
Next, the operation of the actual exclusive flow (step f23) in FIG. 8 will be described with reference to the flowcharts in FIGS.
Step f230A: The shared resource exclusion means 23 refers to the corresponding process number in the process management table 24, and whether or not the exclusive exclusion type in the temporary exclusion states 25A and 25B is the exclusion type A. Determine whether. If it is not exclusive type A, the process proceeds to step f230B. If the exclusion type is A, the actual exclusion request is an exclusion type A actual exclusion request, and the process proceeds to step f231A.
Step f230B: The shared resource exclusion means 23 determines whether or not the provisional exclusion state 25B of the corresponding process number in the process management table 24 has been provisionally excluded. If it has not been temporarily excluded, the process proceeds to step f236. If the provisional exclusion has been completed, the actual exclusion request is an exclusion type B actual exclusion request, and the process proceeds to step f231B.
The flow of steps f231A to f236 and the flow of steps f231B to f236 are the same as the flow of steps f130 to f135 of FIG. 4 in the first embodiment.
[0027]
Next, the operation of the exclusion release flow (step f25) of FIG. 8 will be described with reference to the flowcharts of FIGS.
In step f250A, the shared resource exclusion unit 23 determines whether or not the exclusion release request is the exclusion type A. When the exclusion release request is the exclusion type A, the process proceeds to step f251A. If the exclusion release request is not the exclusion type A, the process proceeds to step f250B. In step f250B, it is determined whether or not the exclusion release request is the exclusion type B. When the exclusion release request is the exclusion type B, the process proceeds to step f251B. If the exclusion release request is not the exclusion type B, the exclusion release request is an exclusion release request from a program other than the programs 21A and 21B, and the exclusion release success is returned to the program.
The flow of steps f251A to f257A and the flow of steps f251B to f257B are the same as the flow of steps f150 to f156 of FIG. 6 in the first embodiment.
[0028]
In the present embodiment, as in the case of the first embodiment, whether the exclusive resource is accessed by the data access means 22 without changing the interface between the program 1A or program 1B and the data access means 22. By determining whether or not to access the resource that does not require exclusion, it is determined whether or not to perform the exclusion, and the exclusion required resource is excluded when the data access unit 22 actually performs the data access. Allows shortening of exclusive sections. Further, in the present embodiment, the process management table 24 records and manages the status of each process for each exclusion type, so that the conventional interface between the program and the data access means 22 is not changed. One shared resource can be simultaneously accessed by programs in a plurality of program groups.
[0029]
【The invention's effect】
As described above, the shared resource exclusion control method according to the present invention determines whether to access exclusive required resources or exclusive unnecessary resources by data access means, and determines whether to perform exclusion. Since the exclusive resource is excluded when the data access means actually accesses the data, the shared resource (exclusive resource) of the shared resource (exclusive resource) can be changed without changing the conventional operation from the viewpoint of the program. It is possible to shorten the exclusive section.
Also, the shared resource exclusion control method according to the present invention records and manages the temporary exclusion status and the actual exclusion status for each process in the process management table. It is possible to detect errors.
In addition, the shared resource exclusive control method according to the present invention records and manages the status of each process for each exclusion type in the process management table, so that the conventional interface between the program and the data access means is used. It is possible to simultaneously access one shared resource by a program in a plurality of program groups without changing.
[Brief description of the drawings]
FIG. 1 is a block diagram of an exclusive control system for shared resources according to a first embodiment of the present invention.
FIG. 2 is a flowchart for explaining processing operations of a data access unit and a shared resource exclusion unit in FIG. 1;
FIG. 3 is a flowchart of temporary exclusion processing in FIG. 2;
FIG. 4 is a flowchart of real exclusion processing in FIG. 2;
FIG. 5 is a flowchart of exclusive release processing in FIG. 2;
FIG. 6 is a part of a block diagram of a shared resource exclusive control system according to a second embodiment of the present invention.
FIG. 7 is a block diagram of the exclusive control system for remaining shared resources of FIG. 6 according to the second embodiment of the present invention.
8 is a flowchart for explaining processing operations of the data access unit and the shared resource exclusion unit of FIG. 6;
FIG. 9 is a flowchart of temporary exclusion processing in FIG. 8;
10 is a part of a flowchart of real exclusion processing in FIG. 8;
11 is a flowchart of the flow following FIG. 10 in the real exclusion process of FIG. 8;
FIG. 12 is a flowchart of exclusive release processing of FIG. 8;
13 is a flowchart of the flow following FIG. 12 of the exclusive release processing of FIG.
FIG. 14 is a block diagram of a conventional exclusive control system for shared resources.
[Explanation of symbols]
11, 21A, 21B, 51 programs
12, 22, 52 Data access means
13, 23, 53 Shared resource exclusion means
14, 24 Process management table
15, 25A, 25B Temporary exclusive state
16, 26A, 26B Real exclusive state
21a, 21b program group

Claims (10)

プログラムからの排他要求、排他解除要求およびデータアクセス要求を入力して共用資源の排他処理、排他解除処理およびデータアクセス処理を行なう共用資源の排他制御方法であって、
前記プログラムからの排他要求に対して、共用資源の排他が行なわれずに、前記プログラムに排他成功が返却され、
前記排他処理が、前記データアクセス要求されたデータの格納場所に基づき、前記データが排他を必要としない共用資源内のデータである場合には排他を行なわず、前記データが排他を必要とする共用資源内のデータである場合には排他を行なうことを特徴とする共用資源の排他制御方法。
An exclusive control method for a shared resource that performs an exclusive process, an exclusive release process, and a data access process of a shared resource by inputting an exclusive request, an exclusive release request, and a data access request from a program,
In response to the exclusion request from the program, the exclusion success of the shared resource is not performed, but the exclusion success is returned to the program,
Shared the exclusion process, based on the storage location of the data access request data, without exclusion if the data is data in the shared resource that does not require an exclusive, said data requires exclusive An exclusive control method for a shared resource, wherein the exclusive control is performed when the data is in the resource.
プログラムからの排他要求、排他解除要求およびデータアクセス要求を入力して共用資源の排他処理、排他解除処理およびデータアクセス処理を行なう共用資源の排他制御方法であって、
前記プログラムからの排他要求に対して、共用資源の排他が行なわれずに、前記プログラムに排他成功が返却され、
排他の要/不要は、前記プログラムからデータアクセスが要求された際にそのアクセス対象のデータの格納場所に基づいて判断され、
前記排他要求が、中間に排他解除要求が要求されることなく、連続して要求されたとき、あるいは/および、前記排他解除要求が、中間に排他要求が要求されることなく、連続して要求されたときに、前記複数の排他要求あるいは/および排他解除要求のうちの最初の要求以外の要求時には前記プログラムに排他失敗あるいは/および排他解除失敗が返却され要求に対する処理が終了することを特徴とする共用資源の排他制御方法。
An exclusive control method for a shared resource that performs an exclusive process, an exclusive release process, and a data access process of a shared resource by inputting an exclusive request, an exclusive release request, and a data access request from a program,
In response to the exclusion request from the program, the exclusion success of the shared resource is not performed, but the exclusion success is returned to the program,
The necessity / unnecessity of exclusion is determined based on the storage location of the data to be accessed when data access is requested from the program,
The exclusion request is continuously requested without requiring an exclusion request in the middle, and / or the exclusion request is continuously requested without requiring an exclusion request in the middle. When a request other than the first request among the plurality of exclusive requests and / or exclusive release requests is issued, an exclusive failure or / and exclusive release failure is returned to the program, and the processing for the request ends. To control exclusive use of shared resources.
同時に動作し得る1つまたは複数のプログラムからの排他要求、排他解除要求およびデータアクセス要求を入力して共用資源の排他処理、排他解除処理およびデータアクセス処理を行なう共用資源の排他制御方法であって、
前記プログラムからの排他要求に対して、共用資源の排他が行なわれずに、前記プログラムに排他成功が返却され、
排他の要/不要は、前記プログラムからデータアクセスが要求された際にそのアクセス対象のデータの格納場所に基づいて判断され、前記各プログラムが動作するプロセス毎の排他状態を記録するプロセス管理表を有し、前記プロセス管理表を参照して排他状態の変化が行なわれることを特徴とする共用資源の排他制御方法。
An exclusive control method for a shared resource that performs an exclusive process, an exclusive release process, and a data access process of a shared resource by inputting an exclusive request, an exclusive release request, and a data access request from one or more programs that can operate simultaneously. ,
In response to the exclusion request from the program, the exclusion success of the shared resource is not performed, but the exclusion success is returned to the program,
The necessity / unnecessity of exclusion is determined based on the storage location of the data to be accessed when data access is requested from the program, and a process management table that records the exclusion status for each process in which each program operates. An exclusive control method for a shared resource, wherein the exclusive state is changed with reference to the process management table.
前記プロセス管理表が、前記プログラムから排他要求された際、共用資源の排他を行なわずに前記プログラムに排他成功を返却したことを排他済みとして示す仮排他状態表示項目と、前記プログラムからデータアクセス要求された際、前記データアクセス要求されたデータが排他を必要とする共用資源内にある場合、該排他を必要とする共用資源の排他が行なわれたことを排他済みとして示す実排他状態表示項目とを有し、前記プログラムから排他解除要求された際、前記排他されていた共用資源の排他が解除されたことを前記仮排他状態表示項目および前記実排他状態表示項目を排他未とすることによって示すことを特徴とする請求項3に記載の共用資源の排他制御方法。  When the process management table receives an exclusion request from the program, a temporary exclusion status display item indicating that exclusion success has been returned to the program without exclusion of shared resources, and a data access request from the program When the data requested for data access is in a shared resource that requires exclusion, an actual exclusion status display item that indicates that exclusion of the shared resource that requires exclusion has been performed, and And when the exclusive release request is issued from the program, the exclusion of the exclusive shared resource is indicated by setting the temporary exclusive status display item and the real exclusive status display item as exclusive. The exclusive control method for shared resources according to claim 3. 前記プログラムから排他要求された際、前記仮排他状態表示項目が排他済みとなっているときに、該排他要求を無効にすることを特徴とする請求項4に記載の共用資源の排他制御方法。  5. The exclusive control method for a shared resource according to claim 4, wherein when the exclusive request is issued from the program, the exclusive request is invalidated when the temporary exclusive state display item is already excluded. 前記プログラムから排他解除要求された際、前記仮排他状態表示項目が排他未となっているときに、該排他解除要求を無効にすることを特徴とする請求項4に記載の共用資源の排他制御方法。  5. The exclusive control of a shared resource according to claim 4, wherein when the exclusive release request is issued from the program, the exclusive release request is invalidated when the temporary exclusive state display item is not exclusive. Method. 前記プロセス管理表が、2種類以上の前記排他要求および排他解除要求の要求種別に、前記各プロセス毎の排他状態を記録することを特徴とする請求項3から6のいずれかに記載の共用資源の排他制御方法。  The shared resource according to any one of claims 3 to 6, wherein the process management table records an exclusive state for each process in a request type of two or more types of the exclusive request and exclusive release request. Exclusive control method. プログラムからの排他要求、排他解除要求およびデータアクセス要求を入力して、共用資源の排他処理および排他解除処理を行なう共用資源排他手段と、データアクセス処理を行なうデータアクセス手段とを有する共用資源の排他制御システムであって、
前記プログラムからの排他要求に対して、共用資源の排他が行なわれず、前記プログラムに排他成功が返却され、
前記データアクセス手段が、前記データアクセス要求されたデータの格納場所に基づき、前記データが排他を必要としない共用資源内のデータである場合には該共用資源の排他を行なわずに該データのアクセスを行い、前記データが排他を必要とする共用資源内のデータである場合には前記共用資源排他手段に該共用資源の排他を要求することを特徴とする共用資源の排他制御システム。
Exclusion of shared resources having shared resource exclusion means for performing exclusive processing and exclusive release processing of shared resources and data access means for performing data access processing by inputting an exclusive request, an exclusive release request and a data access request from a program A control system,
In response to an exclusion request from the program, exclusion of shared resources is not performed, and exclusion success is returned to the program,
If the data access means is based on the storage location of the data requested to be accessed, and the data is data in a shared resource that does not require exclusion, the access to the data without performing exclusion of the shared resource was carried out, exclusive control system of the shared resources if the data in the shared resource, characterized in that request exclusive of co resources for the shared resource exclusion means the data requires exclusive.
同時に動作し得る1つまたは複数のプログラムからの排他要求、排他解除要求およびデータアクセス要求を入力して、共用資源の排他処理および排他解除処理を行なう共用資源排他手段と、データアクセス処理を行なうデータアクセス手段とを有する共用資源の排他制御システムであって、
前記共用資源排他手段が、前記プログラムからの排他要求に対して、共用資源の排他が行なわれず、前記プログラムに排他成功を返却し、
排他の要/不要は、前記プログラムからデータアクセスが要求された際にそのアクセス対象のデータの格納場所に基づいて判断され、かつ、前記各プログラムが動作するプロセス毎の排他状態を記録するプロセス管理表を有することを特徴とする共用資源の排他制御システム。
Shared resource exclusion means for performing exclusion processing and exclusion cancellation processing of shared resources by inputting exclusion requests, exclusion cancellation requests, and data access requests from one or more programs that can operate simultaneously, and data for data access processing An exclusive control system for shared resources having access means,
In response to the exclusion request from the program, the shared resource exclusion means does not perform exclusion of the shared resource, and returns an exclusion success to the program,
Whether or not exclusion is required is determined based on the storage location of the data to be accessed when data access is requested from the program, and the process management records the exclusion status for each process in which each program operates A shared resource exclusive control system comprising a table.
前記プロセス管理表が、2種類以上の前記排他要求および排他解除要求の要求種別に、前記各プロセス毎の排他状態を記録することを特徴とする請求項9に記載の共用資源の排他制御システム。  10. The exclusive control system for a shared resource according to claim 9, wherein the process management table records an exclusive state for each process in the request types of the two or more types of exclusive requests and exclusive release requests.
JP2002165487A 2002-06-06 2002-06-06 Exclusive control method and exclusive control system for shared resources Expired - Fee Related JP3918641B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002165487A JP3918641B2 (en) 2002-06-06 2002-06-06 Exclusive control method and exclusive control system for shared resources

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002165487A JP3918641B2 (en) 2002-06-06 2002-06-06 Exclusive control method and exclusive control system for shared resources

Publications (2)

Publication Number Publication Date
JP2004013485A JP2004013485A (en) 2004-01-15
JP3918641B2 true JP3918641B2 (en) 2007-05-23

Family

ID=30433317

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002165487A Expired - Fee Related JP3918641B2 (en) 2002-06-06 2002-06-06 Exclusive control method and exclusive control system for shared resources

Country Status (1)

Country Link
JP (1) JP3918641B2 (en)

Also Published As

Publication number Publication date
JP2004013485A (en) 2004-01-15

Similar Documents

Publication Publication Date Title
CN110058880B (en) Exclusive instruction simulation
US8880488B1 (en) Efficient extent-based B-tree insertion
US10540119B2 (en) Distributed shared log storage system having an adapter for heterogenous big data workloads
JP7088897B2 (en) Data access methods, data access devices, equipment and storage media
KR20090127689A (en) Memory test device and memory test method
CN119621149A (en) Memory access instruction processing method and processor
CN113760451B (en) A method and device for correcting migration of virtual machines across host architectures
JP3918641B2 (en) Exclusive control method and exclusive control system for shared resources
WO2023184907A1 (en) Multi-control storage system io processing method and system, and related component
US7886205B2 (en) Verification of a data processing system using overlapping address ranges
US20140195776A1 (en) Memory access for a vector processor
CN112817717B (en) Scheduling method and device for timing tasks
JP2004118553A (en) Workflow execution method and system, and program therefor
US7689864B2 (en) Processor comprising an integrated debugging interface controlled by the processing unit of the processor
CN113742198B (en) Test method, test device, electronic equipment and storage medium
CN116150247A (en) Data writing method, device, computer equipment and storage medium
US5146458A (en) Data transfer checking system
TWI488040B (en) Buffer managing method and buffer controller thereof
US5893928A (en) Data movement apparatus and method
JP2003085026A (en) Shared resource exclusive control system and method
CN115934732A (en) Data topology updating method and device, computer equipment and storage medium
US7210007B2 (en) Method of verifying a system in which a plurality of master devices share a storage device
CN117632511B (en) Hard disk expansion method, device, equipment and readable storage medium based on multithreading
JP4333749B2 (en) Arithmetic system, arithmetic device and program
CN110727465B (en) Protocol reconfigurable consistency implementation method based on configuration lookup table

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20060104

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060123

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060315

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20060629

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060727

RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20060727

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A821

Effective date: 20060727

A911 Transfer to examiner for re-examination before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20060904

TRDD Decision of grant or rejection written
RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20070118

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20070123

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20070205

R150 Certificate of patent or registration of utility model

Ref document number: 3918641

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100223

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110223

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110223

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120223

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120223

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130223

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130223

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140223

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees