JP3711642B2 - Processing management system - Google Patents
Processing management system Download PDFInfo
- Publication number
- JP3711642B2 JP3711642B2 JP19548696A JP19548696A JP3711642B2 JP 3711642 B2 JP3711642 B2 JP 3711642B2 JP 19548696 A JP19548696 A JP 19548696A JP 19548696 A JP19548696 A JP 19548696A JP 3711642 B2 JP3711642 B2 JP 3711642B2
- Authority
- JP
- Japan
- Prior art keywords
- execution
- priority
- unit
- processing
- difference
- 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
Links
- 238000012545 processing Methods 0.000 title claims description 185
- 238000000034 method Methods 0.000 claims description 558
- 238000007726 management method Methods 0.000 claims description 67
- 238000001514 detection method Methods 0.000 claims description 32
- 206010000210 abortion Diseases 0.000 claims description 6
- 238000004364 calculation method Methods 0.000 claims description 6
- 230000004044 response Effects 0.000 description 11
- 239000002699 waste material Substances 0.000 description 6
- 238000010586 diagram Methods 0.000 description 4
- 238000007616 round robin method Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 3
- 238000003672 processing method Methods 0.000 description 3
- 230000009118 appropriate response Effects 0.000 description 2
- 230000000903 blocking effect Effects 0.000 description 2
- 241001522296 Erithacus rubecula Species 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 230000002035 prolonged effect Effects 0.000 description 1
Images
Description
【0001】
【発明の属する技術分野】
本発明は、実行優先度に基づいて複数の処理に与える計算機資源等を管理して処理を実行する処理管理システムに関し、特に、処理間で発生する優先度逆転を解消する処理管理システム及び方法に関する。
【0002】
【従来の技術】
処理管理システムは、CPUといった計算機資源の割り当て等を管理して複数の処理の実行を可能にする方式として、例えば、一定時間毎に計算機資源を割り当てる処理を切り換えて、複数の処理を実行するラウンドロビン方式等があり、また、ラウンドロビン方式において実行優先度に従って上記した計算機資源を割り当てる処理を決定する方式もある。
【0003】
また、上記したラウンドロビン方式に対して、例えば、映像や音声といった連続メディア・データの再生、ユーザから時間の制約を受けたデータベースへの検索といった実時間処理等に適した実行を実現する方式として、計算機資源を実行優先度に従って占有させて処理を実行する方式(以下、従優先度占有方式という。)がある。
【0004】
この従優先度占有方式は、処理を実行する際に実行優先度に従って計算機資源を占有させるために、高実行優先度が指定された処理を実行する際に、他の低実行優先度が指定された処理によって計算機資源を奪われることを防ぐことができ、多くの計算機資源を高実行優先度が指定された処理へ与えることができる。
【0005】
したがって、高実行優先度が指定された処理に対して、開始から終了にかかる応答時間を短縮することができ、指定された終了期限内まで或いは早期に終了しなければ処理の価値が無効或いは低下してしまうといった性質を持った実時間処理に対して適した実行が可能となっている。
【0006】
上記した処理管理システムにおいては、計算機資源を有効に使用してより多くの処理を実行することが望ましく、さらに、実行優先度を使用している処理管理システムにおいては、実行優先度に従った順番で処理を実行することが望ましい。
このことは、従優先度占有方式で処理を実行する処理管理システムにおいては、他方式で処理を実行する処理管理システムよりも強く望まれている。
【0007】
このような処理管理システムにおいて、ラウンドロビン方式を実行している場合、従優先度占有方式を実行している場合等に限らず、実行優先度に従って処理を実行する場合には、高実行優先度の処理Thighがロックを要求したデータに対して低実行優先度の処理Tlowがロックを確保しているために、高実行優先度の処理Thighのロックがブロックされるといった優先度逆転が発生し、高実行優先度の処理Thighの応答時間が長くなってしまうといった問題が生じていた。
【0008】
上記した問題は従優先度占有方式においては特に致命的な問題となっている。
例えば、1つのCPUを備えている場合(所謂、シングルプロセッサの場合)には、占有して行うことのできる処理の個数は1つのみであり、高実行優先度の処理Thigh以外の処理が実行されることがなく、高実行優先度の処理Thighは低実行優先度の処理Tlowにロックされているデータを使用できないために実行を進行させることができず応答時間が限りなく延びてしまうこととなる。
また、複数のCPUを備えている場合(所謂、マルチプロセッサの場合)には、上記した高実行優先度の処理Thighの応答時間が限りなく延びてしまう事態は避けることができるものの、高実行優先度Thighの応答時間が長いことには変わりがない。
【0009】
すなわち、マルチプロセッサの場合には、占有して行うことのできる処理の個数を複数とすることができ、低実行優先度の処理より高実行優先度の処理(処理Thigh以外)の実行が終了した後に低実行優先度Tlowの処理が実行されるので、低実行優先度の処理Tlowが終了した後に高実行優先度の処理Thighの実行を進行させることができる。しかしながら、高実行優先度の処理Thighの実行が進行するのは、低実行優先度の処理より高実行優先度の処理(処理Thigh以外)の実行が終了した後、さらに低実行優先度の処理Tlowが終了した後といった長時間経過した後である。
【0010】
前記したような優先度逆転が引き起こす問題に対する解決策として、R.Abbott and H.Garcia-Molina,Scheduling Real-Time Transactions: A Performance Evaluation,ACM Transactions on Database Systems,Vol.17,No.3,1992.(以下、文献1という。)には、低実行優先度の処理Tlowをアボート(無効化)し、高実行優先度の処理Thighによるデータへのロック確保を可能にして処理を進行させるHP(High Priority)方式が提案されている。
【0011】
このHP方式は、高実行優先度の処理を最優先に実行させるといった点に関しては優れた方式ではあるが、複数の処理をできるだけ効率よく実行するといった点においては優れたものということができなかった。すなわち、低実行優先度の処理をアボートするために、低実行優先度の処理に与えた計算機資源を無駄にしてしまっており、複数の処理を実行する場合において処理に対する実行効率を低下させていた。
【0012】
上記したHP方式に対して、複数の処理に対する実行効率を向上させる方式として、文献1にはWP(Wait Promote)方式が記載されている。
このWP方式は計算機資源の無駄を削減することを考えた方式であり、高実行優先度の処理Thighと低実行優先度の処理Tlowとの間で優先度逆転が発生した際に、処理Tlowの実行優先度を処理Thighと同じ実行優先度に引き上げることによって、処理Tlowを実行させ、その後に処理Thighを実行させる。したがって、処理Tlowをアボートする等の計算機資源の無駄を減少させることができる。
【0013】
さらに、低実行優先度の処理Tlowの実行優先度を高実行優先度の処理Thighと同じ実行優先度へ引き上げるために、処理Tlowが実行されて終了した後に、直ちに処理Thighが実行されることとなり、例えば、上記説明したマルチプロセッサにおいて発生していた、処理Thighより実行優先度の低い処理(処理Tlow以外)が終了すること待たなければ処理Thighを実行できなかったといった状況を防ぐことができ、処理Thighの応答時間を短縮をすることができる。
【0014】
また、文献1には、実行優先度の高い処理を期限内に終了させることを目的としてWP方式及びHP方式を組み合わせたCR(Conditional Restart)方式が提案されている。
このCR方式は、高実行優先度の処理Thighと低実行優先度の処理Tlowとの間で優先度逆転が発生した場合に、WP方式を適用しても処理Thighが期限内に終了するか否かを判断し、終了期限内に終了させることができるときにはWP方式を適用し、終了させることができないときにはHP方式を適用する方式である。
【0015】
【発明が解決しようとする課題】
上記したように優先度逆転が発生した場合の対応策として、HP方式、WP方式、CR方式等がある。
しかしながら、上記した各方式は処理管理システムにおいて複数の処理を実行することに適したものではなかった。
例えば、HP方式は実行優先度の順番に処理を実行するといった点では優れた方式であるものの、処理をアボートするといった計算機資源を無駄にしており、効率よく処理を実行することができなかった。
また、WP方式は、処理をアボートするといった計算機資源の無駄を削減し、処理を効率よく実行するといった点では優れた方式であるものの、実行優先度の順番に従って処理を実行することはできなかった。
【0016】
また、CR方式はHP方式及びWP方式を選択的に利用して両者の利点を併せ持つことによって処理を期限内に終了させるといった点では優れた方式であるものの、このCR方式を利用するためには、処理にかかる実行時間を予め把握しておくことが必要であり、例えば、処理量を確定することのできないデータベースへの検索等といった処理実行前に実行時間を把握することができない処理に対しては、適用できず何ら効果を得ることができなかった。
【0017】
そこで、本発明は上記した従来の事情に鑑みなされたもので、処理にかかる実行時間の分かっていない場合でも、優先度逆転への対応としてWP方式とHP方式とを選択して適用する等でき、実行優先度にできるだけ忠実に処理を実行するとともに、計算機資源の無駄を省いて効率よく処理を実行することのできる処理管理システム及び方法を提供することを目的としている。
【0018】
【課題を解決するための手段】
上記目的を達成するために本発明は、2つの処理間の実行優先度の差が比較的小さいときには、前記処理を実行する順番に対する制約は弱いものであり、また、2つの処理間の実行優先度の差が比較的大きいときには、前記実行を実行する順番に対する制約が強いものであることに着目してなされたもので、優先度逆転が生じたときに、優先度逆転が起きている2つの処理間の実行優先度差に基づいて、優先度逆転への対応方式を選択して適用する。
すなわち、実行優先度差が比較的小さいといった処理に対する実行順番の制約が弱いときには、計算機資源の無駄を防ぐWP方式を適用し、実行優先度差が比較的大きいといった実行優先度の制約が強いときにはHP方式を適用する。
【0019】
さらに、本発明は、比較的高い実行優先度が指定される計算機資源を占有して実行される占有処理と、比較的低い実行優先度が指定される計算機資源を占有せずに実行される非占有処理との間には、処理を実行する順番に対する制約が強いことに着目してなされたもので、占有処理と非占有処理との間に優先度逆転が生じたときには、非占有処理をアボートして占有処理を実行する。
【0020】
そこで、請求項1に係る処理管理システムは、処理を実行する処理実行部を備え、指定された実行優先度に従って処理実行部が処理を実行する処理管理システムにおいて、実行途中の2つの処理についての実行状態を管理することにより当該2つの処理間で優先度逆転が発生していることを検出する優先度逆転検出部と、
優先度逆転検出部が優先度逆転を検出したことに基づいて、前記2つの処理のうちで高い実行優先度が指定された第1処理と低い実行優先度が指定された第2処理との実行優先度の差を算出する優先度差算出部と、算出された実行優先度差と予め設定された規定値とを比較する優先度差判定部と、優先度差判定部により実行優先度差が規定値未満と判定されたことに基づいて、第2処理の実行優先度を第1処理の実行優先度以上にして処理実行部に第2処理を実行させる実行制御対応部と、優先度差判定部により実行優先度差が規定値以上と判定されたことに基づいて、第2処理をアボートするアボート対応部と、を備えたことを特徴とする。
【0021】
上記した請求項1に係る処理管理システムでは、優先度逆転検出部が実行途中の2つの処理についての実行状態を管理することにより当該2つの処理間で優先度逆転が発生していることを検出し、検出したことに基づいて、優先度算出部が比較的高い実行優先度が指定された第1処理と比較的低い実行優先度が指定された第2処理との実行優先度の差を算出する。次いで、優先度差判定部が算出された実行優先度差と予め設定された規定値とを比較し、実行優先度差が規定値未満と判定された場合には、実行制御対応部が第2処理の実行優先度を第1処理の実行優先度以上にして処理実行部に第2処理を実行させる一方、実行優先度差が規定値以上と判定された場合には、アボート対応部が第2処理をアボートする。
【0022】
請求項2に係る処理管理システムは、処理を実行する処理実行部を備え、指定された実行優先度に従って処理実行部が処理を実行する処理管理システムにおいて、前記実行優先度として指定可能な範囲は、処理実行部を占有して実行される処理に指定する高実行優先度の範囲と、処理実行部を占有せずに実行される処理に指定する低実行優先度の範囲とを有し、実行途中の2つの処理についての実行状態を管理することにより当該2つの処理間で優先度逆転が発生していることを検出する優先度逆転検出部と、優先度逆転検出部が優先度逆転を検出したことに基づいて、前記2つの処理のうちで高い実行優先度が指定された第1処理と低い実行優先度が指定された第2処理との実行優先度がそれぞれ上記したいずれの範囲に属するかを判定する優先度逆転判定部と、優先度逆転判定部により第1処理が高実行優先度の範囲に属するとともに、第2処理が低実行優先度の範囲に属すると判定されたことに基づいて第2処理をアボートする第2アボート対応部と、を備えたことを特徴とする。
【0023】
上記した請求項2に係る処理管理システムでは、優先度逆転検出部が実行途中の2つの処理についての実行状態を管理することにより当該2つの処理間で優先度逆転が発生していることを検出する。この検出に基づいて、優先度逆転判定部が比較的高い実行優先度が指定された第1処理と比較的低い実行優先度が指定された第2処理との実行優先度がそれぞれ、処理実行部を占有して実行される処理に指定する高実行優先度の範囲と、処理実行部を占有せずに実行される処理に指定する低実行優先度の範囲とのいずれの範囲に属するかを判定する。そして、優先度逆転判定部により第1処理が高実行優先度の範囲に属するとともに、第2処理が低実行優先度の範囲に属すると判定された場合には、第2アボート対応部が第2処理をアボートする。
【0024】
請求項3に係る処理管理システムは、請求項2に記載した処理管理システムにおいて、前記優先度逆転判定部により第1処理及び第2処理が共に高実行優先度の集合に属すると判定されたことに基づいて、第1処理と第2処理との実行優先度の差を算出する優先度差算出部と、算出された実行優先度差と予め設定された規定値とを比較する優先度差判定部と、優先度差判定部により実行優先度差が規定値未満と判定されたことに基づいて、第2処理の実行優先度を第1処理の実行優先度以上にして処理実行部に第2処理を実行させる実行制御対応部と、優先度差判定部により実行優先度差が規定値以上と判定されたことに基づいて、第2処理をアボートするアボート対応部と、を備えたことを特徴とする。
【0025】
上記した請求項3に係る処理管理システムでは、優先度逆転判定部により第1処理及び第2処理が共に高実行優先度の集合に属すると判定された場合に、優先度差算出部が第1処理と第2処理との実行優先度の差を算出し、優先度差判定部が算出された実行優先度差と予め設定された規定値とを比較する。そして、優先度差判定部により実行優先度差が規定値未満と判定された場合には、実行制御対応部が第2処理の実行優先度を第1処理の実行優先度以上にして処理実行部に第2処理を実行させる一方、実行優先度差が規定値以上と判定された場合には、アボート対応部が第2処理をアボートする。
また、請求項4に係る処理管理方法及び請求項5に係る処理管理方法を提供する。
【0026】
【発明の実施の形態】
本発明の第1実施例に係る処理管理システムを図1を参照して説明する。
この処理管理システムは、処理の要求を受け付ける処理要求受け付け部1と、処理に対する実行優先度を指定する優先度決定部2と、処理に関する情報を保持する処理情報管理テーブル3と、処理情報管理テーブルに保持させる情報を管理する処理情報管理部4と、処理を実行するオペレーティングシステム5(以下、OSという。)と、実行途中の処理に優先度逆転が発生したことを検出する優先度逆転検出部6と、優先度逆転の発生に対する対応を行う優先度逆転対応部7と、実行中の処理が終了期限を超えて実行されているオーバーロード状態を検出するオーバーロード検出部8と、オーバーロード状態となった処理に対して対応を行うオーバーロード対応部9と、処理の終了を行う終了処理部10と、を備えている。
【0027】
処理要求受け付け部1は、実行要求のあった処理を複数格納する待ち行列を有しており、定期的にOS5に割込をかけて起動され、処理要求を受け取った場合には、受け取った処理を順次待ち行列に格納し、格納している処理を順次優先度決定部2へ渡す。
【0028】
優先度決定部2は、処理要求受け付け部1から受け取った処理に基づいて当該処理に対する実行優先度を指定し、当該処理とともに指定した実行優先度を処理情報管理部4に渡す。
なお、実行優先度は、ユーザからの指示、処理の実行にかかる時間の長さ、処理を要求したユーザに与えられている優先度、処理を要求したターミナルに与えられている優先度、処理に与えられた期限等といった基準のいずれか一つ或いは複数に基づいて指定される。
【0029】
処理情報管理テーブル3は、処理に関する情報を保持しており、保持する情報には、例えば、図2に示すように処理の識別番号(処理ID)、処理の終了期限、処理に対して指定された実行優先度等がある。
【0030】
処理情報管理部4は、優先度決定部2から処理を受け取ると起動され、当該処理に関する情報を処理情報管理テーブル3に設定し、当該処理をOS5に渡す。
すなわち、優先度決定部2から処理を受け取って起動されると、処理情報管理部4は受け取った処理に関する情報のテーブルを新たに処理情報管理テーブル3に追加し、追加したテーブルへ当該処理の処理ID、処理の終了期限、指定された実行優先度を設定し、当該処理をOS5に渡す。
次いで、処理情報管理部4は、他の処理が実行要求受け付け部1に格納されているか否かをチェックして、処理が格納されていない場合にはOS5に制御を移す一方、処理が格納されている場合には処理要求受け付け部1に制御を移す。
【0031】
OS5は、処理情報管理部4から渡された処理を格納する実行待ち処理保持部5aと、処理に対して実行権を与える実行処理決定部5bと、実行権が与えられた処理を実行する処理実行部5cと、新たな処理に実行権を奪われた処理等を格納する中断処理保持部5dと、を有している。
【0032】
実行待ち処理保持部5aは、処理を一時格納させるための待ち行列を備え、当該待ち行列には実行優先度が設定され実行待ち状態にある処理が格納され、実行優先度の高い処理から順に並んだ状態となっている。
【0033】
実行処理決定部5bは、実行待ち処理保持部5aに新たな処理が格納された直後、処理実行部5cが実行している処理終了した直後、若しくは優先度逆転対応部7による指示があった直後に起動され、実行待ち処理保持部5aに格納されている処理、処理実行部6cで実行されている処理、中断処理保持部5dに格納されている処理、から最も実行優先度の高い処理を検出し、その処理に実行権を与える。
【0034】
例えば、実行待ち処理保持部5aに格納されている処理へ実行権が与えられた場合には、当該処理を実行待ち処理保持部5aの待ち行列から取り出して、処理実行部5cに渡す。この時に処理実行部5cが処理を実行中であれば、実行中の処理を中断処理保持部5dに格納する。
また、中断処理保持部5dに格納されている処理へ実行権が与えられた場合には、当該処理を中断処理保持部5dの待ち行列から取り除き、処理実行部5cに渡す。
なお、同一の実行優先度が与えられている処理が複数ある場合には、先に実行要求のあった処理から順に実行権が与えられる。
【0035】
処理実行部5cは、実行処理決定部5bから渡された処理を実行し、処理要求受け付け部1によって割り込まれるまで、若しくは実行している処理が終了するまで継続して実行する。なお、処理が正常に終了した場合には、終了処理部10に処理が正常終了したことを通知する。
【0036】
中断処理保持部5dは、処理実行部5cで実行がされていたが、新たな処理要求を行った実行優先度の高い処理に実行権を奪われた処理、或いは優先度逆転対応部7から渡された処理を中断された状態で格納する待ち行列であり、当該待ち行列は実行優先度の高い処理から順に並べて格納した状態となっている。
なお、中断された状態とは、例えば、処理がデータに対してロックを確保している場合は、ロックを確保したままの状態を表している。
【0037】
優先度逆転検出部6は、処理実行部5cが実行している処理、或いは、中断処理保持部5dが保持している処理といった実行途中の処理において優先度逆転が発生しているか否かを定期的にチェックし、優先度逆転が発生していた場合には、優先度逆転が発生している2つの処理を優先度逆転対応部7に渡す。
【0038】
なお、優先度逆転の発生は、例えば、或る一定単位量のデータ毎に当該データに対してロックを確保している処理を把握するようにしておき、或る処理がデータを使用するときに当該データに対して他の処理がロックを確保しているかを否かによって検出できる。すなわち、本実施例では処理実行部5cが一つであり、従優先度占有方式によって処理を実行しているので、処理実行部5cが実行している処理の実行優先度が最も高く、当該処理が使用したいデータに対して他の処理がロックを確保している場合は優先度逆転が発生していることを表しており、そのため、処理が使用したいデータに対して他の処理がロックを確保しているか否かを検出することによって優先度逆転の発生が検出できる。
【0039】
優先度逆転対応部7は、優先度逆転が発生した2つの処理間の実行優先度の差を算出する優先度差算出部と、実行優先度差と予め設定した規定値とを比較する優先度差判定部と、実行優先度差が規定値未満と判定されたことに基づいて対応する実行制御対応部と、実行優先度差が規定値以上と判定されたことに基づいて対応するアボート対応部とを有し、優先度逆転が発生した場合に、優先度逆転が発生している2つの処理間の実行優先度の差と予め設定された規定値と比較し、比較に基づいてWP方式或いはHP方式を選択して適用する。
【0040】
すなわち、優先度算出部が優先度逆転検出部6から渡された高実行優先度の処理Thighと低実行優先度の処理Tlowとの実行優先度の差を算出し、優先度差判定部が算出した実行優先度差と規定値とを比較する。
比較した結果、実行優先度差が規定値未満の場合には、実行制御対応部が処理Tlowに処理Thighと同じ実行優先度を設定し、処理Thighを中断処理保持部5dに渡す。次いで、実行制御対応部が実行処理決定部5bに実行権を与える処理を決定させる指示を出して処理実行部5cに処理Tlowを実行させる。
一方、比較した結果、実行優先度差が規定値以上の場合には、アボート対応部が処理Tlowをアボートして、実行待ち処理保持部5aに渡す。この結果、処理Thighがデータへのロックを確保でき、実行が進行されることとなる。
【0041】
ここで、処理Thighと処理Tlowの実行優先度は処理情報管理テーブル3から参照される。
なお、上記した予め設定する規定値とは、2つの処理に優先度逆転が発生した場合に対応として、低実行優先度の処理をアボートするよりも低実行優先度の処理を先に実行させる方がいいといった臨界点での実行優先度差となっており、ユーザ或いはシステムが決定することもできる。
【0042】
オーバーロード検出部8は、処理情報管理テーブル3から処理実行部5cが実行中の処理に対する期限Dを取り出し、時刻管理部(図示せず)から現時点の時刻tを受け取り、取り出した期限Dと受け取った時刻tとを比較する。その結果、期限Dと時刻tが同じか或いは期限Dより時刻tが遅い場合には、処理実行部5cが実行している処理をアボートしてオーバーロード対応部9へ渡す一方、期限Dの方が時刻tより遅い場合には処理実行部5cによる処理の実行を継続させる。
【0043】
オーバーロード対応部9は、オーバーロード検出部8から処理を受け取った場合には、当該処理の実行を中止し、終了処理部10に当該処理の実行が中止となったことを通知する。
【0044】
終了処理部10は、OS5から処理の正常終了の通知若しくはオーバーロード対応部9から処理の実行を中止する通知を受け取った場合には、受け取った通知をアプリケーション又はユーザに連絡する。
【0045】
次に、本発明の第1実施例に係る処理管理システムの動作を説明する。
或る処理を実行させる要求が発せられると、処理要求受け付け部1が当該処理を受け取って格納し、順次格納している処理を優先度決定部2に渡す。
そして、優先度決定部2は処理要求受け付け部1から渡された処理の実行優先度を決定し、当該処理とともに決定した実行優先度を処理情報管理部4へ渡す。
【0046】
処理情報管理部4は受け取った処理に関するテーブルを処理情報管理テーブル3に追加し、当該処理を実行待ち処理保持部5aに渡す。実行待ち処理保持部5aは受け取った処理を実行処理決定部5bによって実行権が与えられるまで格納する。
【0047】
前記実行権は実行処理決定部5bが図3及び図4に示す動作を行うことによって与えられる。
まず、実行処理決定部5bは処理実行部5cに実行中の処理があるか否かを検出する(ステップS1)。
【0048】
処理実行部5cに実行中の処理がない場合には、実行待ち処理保持部5aに処理があるか否か(ステップS2)、更に、中断処理保持部5dに処理があるか否かを検出する(ステップS3、S4)。
実行待ち処理保持部5a、中断処理保持部5dの両方に処理が格納されていると検出した場合には、実行待ち処理保持部5aに格納されている中で最も実行優先度の高い処理twaitと、中断処理保持部5dに格納されている中で最も実行優先度の高い処理tintとの優先度を比較し(ステップS5)、実行優先度の高い方の処理に実行権を与える(ステップS6、S7)。
【0049】
一方、実行待ち処理保持部5a、中断処理保持部5dのいずれか一方に処理が格納されていると検出した場合には、実行待ち処理保持部5a或いは中断処理保持部5dに格納されている処理の中で最も実行優先度の高い処理に実行権を与える(ステップS6、S7)。なお、実行待ち処理保持部5a、中断処理保持部5dの両方に処理が格納されていないと検出した場合には、実行する処理が存在しないので実行権を与えない。
【0050】
一方、処理実行部5cに実行中の処理がある場合には、実行待ち処理保持部5aに処理が格納されているか否かを検出する(ステップS8)。
実行待ち処理保持部5aに処理が格納されていると検出した場合には、実行中の処理trunの実行優先度と、実行待ち処理保持部5aに格納された処理の中で最も実行優先度の高い処理twaitの実行優先度とを比較し(ステップS9)、実行待ち処理保持部5aに格納された処理twaitの実行優先度が実行中の処理trunの実行優先度より高いときには、実行中の処理trunを中断処理保持部5dに格納し(ステップS10)、実行待ち処理保持部5aに格納された処理twaitに実行権を与える(ステップS11)。
一方、実行待ち処理保持部5aに処理が格納されていないと検出した場合或いは、処理が格納されていると検出して、実行待ち処理保持部5aに格納された処理twaitより実行中の処理trunの実行優先度が高いと検出した場合には、実行中の処理trunに実行権を継続して与える(ステップS12)。
【0051】
処理に対して実行権が与えられると、処理実行部5cによって前記処理が実行される。なお、処理が正常に終了した場合には終了処理部10に処理が正常終了したことを通知する。
【0052】
上記した処理実行部5cによって処理が実行されている際には、オーバーロード検出部8はオーバーロード状態が発生していることを検出し、優先度逆転検出部6は実行途中の処理に優先度逆転が発生していることを検出する。
すなわち、オーバーロード検出部8は、時刻管理部から現時点の時刻を受け取るとともに、処理管理テーブル3に管理されている実行中の処理に関する期限を受け取って、現時点の時刻が期限を超えてオーバーロード状態となっている場合には、実行中の処理をオーバーロード対応部9に渡す。
【0053】
一方、優先度逆転検出部6は、処理実行部5cが実行している処理が中断処理保持部5dに保持されている処理によってデータへのロック確保をブロックされているか否かを検出して優先度逆転の発生を検出する。そして、優先度逆転が発生したことを検出した場合には、優先度逆転が発生している2つの処理を優先度逆転対応部7に渡す。
【0054】
上記した実行処理部5cによる処理の実行中にオーバーロード検出部8によって処理がオーバーロード状態にあると検出され、当該処理をオーバーロード対応部7が受け取ると、オーバーロード対応部9は当該処理をアボートし、当該処理を実行しないことを終了処理部10へ通知する。
【0055】
一方、上記した実行処理部5cによる処理の実行中に優先度逆転検出部6によって優先度逆転が発生したことを検出され、優先度逆転が発生している2つの処理を優先度逆転対応部7が受け取ると、優先度逆転対応部7は以下に示す優先度逆転対応処理を行う。
まず、優先度逆転対応部7は受け取った2つの処理の実行優先度を処理情報管理テーブル3から読み込み(ステップS13)、比較的高い実行優先度が指定された処理Thighと比較的低い実行優先度が指定された処理Tlowとの実行優先度の差dを算出する(ステップS14)。
【0056】
次いで、算出した実行優先度差dと予め設定された規定値とを比較し(ステップS15)、実行優先度差dが規定値未満である場合には、処理Thighと処理Tlowとの実行順序に対する制約が弱く、処理Tlowをアボートするよりも実行順序を換えて処理Tlowを先に実行させる方が良いことを表しているので、処理Tlowに処理Thighの実行優先度と同じ実行優先度を設定し、処理Thighを中断処理保持部5dに渡し、実行処理決定部5bに実行権を与える処理を決定させる指示を行う(ステップS16)。この結果、実行処理決定部5bによって実行権が処理Tlowに与えられ、処理Tlowが処理実行部5cによって実行されることとなり、その後、引き続いて処理Thighが実行されることとなる。
【0057】
一方、実行優先度差dが規定値より大きい場合には、処理Thighと処理Tlowとの実行順序に対する制約が強く、処理Thighを先に実行させることが必要であるので、処理Tlowをアボートして、実行待ち処理保持部5aに渡す(ステップS17)。この結果、処理Thighがデータに対してロックを確保することができ、実行が進行する。なお、アボートされた処理Tlowは後に改めて最初から実行されることとなる。
【0058】
処理実行部5cから処理を正常に終了したとの通知を受け取った場合或いは、オーバーロード対応部9から処理の実行をしないとの通知を受け取った場合には、終了処理部10は、ユーザ或いはアプリケーションへ受け取った通知に基づく情報を知らせる。
【0059】
上記のように、優先度逆転が発生した場合に、実行時間が分からない処理に対しても優先度逆転が発生した処理間の実行優先度差によって、実行優先度に従った実行順序に対する制約が強い場合には実行優先度に従った実行順序で処理の実行を行い、実行優先度に従った実行順序に対する制約が弱い場合には実行順序を守ることよりも計算機資源の無駄を防ぐ、といった適切な対応を選択できる。
【0060】
なお、上記実施例では処理実行部5cが従優先度占有方式に従って処理を実行していたが、これに限らず、処理実行部5cがラウンドロビン方式等といった非占有方式において実行優先度に従って処理を実行するようにしてもよく、また、上記した従優先度占有方式と非占有方式とを処理によって切換えて実行するようにしてもよく、要は実行優先度に従って処理を実行する方式であればよい。
【0061】
なお、非占有方式に従って処理を実行する場合においては、優先度逆転検出部6を、例えば、或る一定単位量のデータ毎に当該データに対してロックを確保している処理を把握するようにしておき、或る処理がデータを使用するときに当該データに対して他の処理がロックを確保しているかを否か検出し、ロックが確保されている場合に、ロックを確保した他処理との実行優先度を比較させるように構成しておくことで優先度逆転の発生を検出でき、本発明の効果を得ることができる。
【0062】
本発明の第2実施例に係る処理管理システムを図6を参照して説明する。なお、図1で示した第1実施例に係る処理管理システムと同一部分には同一符号を付して重複する説明を省略する。
この処理管理システムは、第1実施例で示した処理管理システムにおいて、優先度逆転が発生している2つの処理の処理方式に応じて優先度逆転への対応をするようにしたものであり、優先度逆転が発生している処理の処理方式を判定して対応する優先度逆転判断部11、を新たに備えたものである。
【0063】
なお、OS5は処理実行部5cを占有して実行される占有処理及び処理実行部5cを占有せずに実行される非占有処理の実行を管理しており、占有処理が存在しない場合にのみ非占有処理を実行し、非占有処理を実行している際に新たな占有処理の要求があった場合には、非占有処理を直ちに中断して新たな占有処理を実行する。
【0064】
優先度逆転判断部11は、優先度逆転が発生している処理の処理方式を判定する優先度逆転判定部と、優先度逆転が占有処理と非占有処理との間に発生している場合に対応を行う第2アボート対応部とを有し、占有処理に指定する高実行優先度の範囲と、非占有処理に指定する低実行優先度の範囲とを把握しており、優先度逆転検出部6から渡された2つの処理のそれぞれが前記範囲のいずれに属するかを判定し、判定した結果に応じて図7に示す対応を行う。
【0065】
すなわち、優先度逆転検出部6から受け取った高実行優先度の処理Thighと低実行優先度の処理Tlowとが上記した範囲のいずれに属するかを優先度逆転判定部が判定する。
この結果、処理Thighが占有処理に指定する高実行優先度範囲に属し、処理Tlowが非占有処理に指定する低実行優先度範囲に属すると判定された場合には、第2アボート部が非占有処理である処理Tlowが占有処理である処理Thighをブロックしていることとなるので、非占有処理である処理Tlowをアボートする。
一方、処理Thigh及び処理Tlowがともに非占有処理に指定する低実行優先度範囲に属すると判定された場合には、2つの処理は非占有処理であるので何も行なわず、処理Thigh及び処理Tlowがともに占有処理に指定する高実行優先度範囲に属すると判定された場合には、2つの処理を優先度逆転対応部7へ渡す。
【0066】
次に、この処理管理システムの動作を説明する。なお、第1実施例と同様な動作の説明を省略する。
OS5が処理を実行している際に、優先度逆転検出部6が優先度逆転の発生を検出すると、優先度逆転の発生している2つの処理を優先度逆転判断部11へ渡し、2つの処理を受け取ると優先度逆転判断部11は、図8に示す優先度逆転への対応処理を行う。
まず、優先度逆転判断部11は、受け取った処理の中で比較的高い実行優先度の処理Thighが占有処理であるか否かを検出し(ステップS18)、さらに受け取った処理の中で比較的低い実行優先度の処理Tlowが占有処理であるか否かを検出する(ステップS19,S20)。
【0067】
処理Thigh及び処理Tlowがともに占有処理である場合には、2つの処理を優先度逆転対応部7へ渡す(ステップS21)。
一方、処理Thighが占有処理であり、処理Tlowが非占有処理である場合には、処理Tlowをアボートして占有処理である処理Thighを実行可能にする(ステップS22)。
なお、処理Thigh及び処理Tlowがともに非占有処理である場合には、何も行わない。また、処理Thighが非占有処理であり、処理Tlowが占有処理である場合には、起こりえない場合であるのでエラー処理を行う。
【0068】
次に、第2実施例に係る処理管理システムにおいて、OS5として市販のOSであるSolaris 2.5(Solarisは登録商標)を使用した例を第1実施例に係る処理管理システムと比較して説明する。なお、Solaris 2.5は実行優先度として0〜159を有し、0〜59は非占有処理のための実行優先度、60〜99は処理に対して指定することができないシステムのための実行優先度、100〜159は占有処理のための実行優先度となっている。
【0069】
ここで、実行優先度”59”が指定された非占有処理と、実行優先度”100”が指定された占有処理との間に優先度逆転が生じた場合を例に取って説明する。
この場合、第1実施例に係る処理管理システムにおいては、例えば、規定値の取り方によって非占有処理が占有処理より先に実行される可能性が生じてくる。すなわち、規定値を”50”と設定していると、優先度逆転が生じている上記2つの処理間の実行優先度の差が規定値”50”未満なので、非占有処理が占有処理と同じ実行優先度に引き上げられ、非占有処理が占有処理より先に実行される。
このことは、終了期限等が与えられていたり、早期実行が望まれている占有処理に取っては問題である。
これに対して、第2実施例の処理管理システムにおいては、上記した優先度逆転が発生した場合には、必ず非占有処理をアボートするので、占有処理を直ちに実行することができる。
【0070】
上記のように、優先度逆転が発生した場合に、占有処理を非占有処理に妨害されることなく実行することができる。さらに、優先度逆転が発生した2つの占有処理に対して実行優先度差に基づいて、実行優先度に従った実行順序に対する制約が強い場合には実行優先度に従った実行順序で処理の実行を行い、実行優先度に従った実行順序に対する制約が弱い場合には実行順序を守ることよりも計算機資源の無駄を防ぐ、といった適切な対応を選択できる。
【0071】
なお、上記第2実施例において優先度逆転対応部7を備えずとも、優先度逆転が発生した場合に常に占有処理を非占有処理に妨害されることなく実行することができる。
なお、上記した第1実施例及び第2実施例のOS5は、Solaris 2.5、Windows NT 3.5(Windowsは登録商標)等といったOSを使用してもよい。
【0072】
また、優先度逆転対応部7は、優先度逆転の対応として、低実行優先度の処理を高実行優先度の処理と同じ実行優先度に引き上げて設定していたが、高実行優先度の処理の実行優先度より高く設定するようにしてもよい。
また、オーバーロード対応部9は、受け取った処理の再実行を中止させる制御を行っていたが、例えば、受け取った処理の優先度を下げて再実行させる等といった他処理から計算機資源を無意味に奪ってしまうことのない制御を行ってもよい。
また、オーバーロード検出部8及びオーバーロード対応部9は備えずともよいが、備えることによって終了期限を超えて価値が著しく低下した処理が計算機資源を使用するといった他の処理の実行を妨げる状況を防ぐことができる。
【0073】
なお、上記した各機能部1〜11は、CPUがプログラムに従って動作することにより構成されるが、これら機能部を独立したハードウエア回路として構成してもよい。
なお、上記した第1実施例及び第2実施例では処理実行部5cが一つであるシングルプロセッサについて説明したが、処理実行部5cを複数備えたマルチプロセッサに対しても本発明を適用できる。
【0074】
【発明の効果】
以上説明したように本発明では、優先度逆転が発生した場合に、優先度逆転が生じている2つの処理間の実行優先度の差と予め設定した規定値との比較をして、HP方式或いはWP方式を選択するようにしたために、実行優先度に忠実に処理を実行できるとともに、計算機資源の無駄を省くことができ、効率よく処理を実行ができる。
また、本発明では、優先度逆転が発生した2つの処理の種類を検出し、2つの処理が占有処理、非占有処理の場合に非占有処理をアボートするようにしたために、占有処理を常に非占有処理より先に実行することができ、占有処理に適した実行ができる。
【図面の簡単な説明】
【図1】 第1実施例に係る処理管理システムの構成図である。
【図2】 第1実施例に係る処理情報管理テーブルを説明する図である。
【図3】 第1実施例に係る実行処理決定部が行う動作を説明する第1フローチャートである。
【図4】 第1実施例に係る実行処理決定部が行う動作を説明する第2フローチャートである。
【図5】 第1実施例に係る優先度逆転への対応動作を説明するフローチャートである。
【図6】 第2実施例に係る処理管理システムの構成図である。
【図7】 第2実施例に係る優先度逆転への対応動作を説明する図である。
【図8】 第2実施例に係る優先度逆転への対応動作を説明するフローチャートである。
【符号の説明】
5・・・OS、 5c・・処理実行部、
6・・優先度逆転検出部、 7・・優先度逆転対応部、
11・・優先度逆転判断部、[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a processing management system that executes processing by managing computer resources and the like given to a plurality of processes based on execution priority, and in particular, cancels priority inversion that occurs between processes.Processing management system and methodAbout.
[0002]
[Prior art]
The processing management system manages the allocation of computer resources such as a CPU and enables a plurality of processes to be executed. For example, a round in which a process for allocating computer resources at a predetermined time is switched to execute a plurality of processes. There is a robin method and the like, and there is also a method for deciding the processing for allocating the computer resources according to the execution priority in the round robin method.
[0003]
In addition to the round robin method described above, for example, a method suitable for real-time processing such as playback of continuous media data such as video and audio, search to a database subject to time constraints from the user, etc. There is a method for executing processing by occupying computer resources according to execution priority (hereinafter referred to as a subordinate priority occupation method).
[0004]
This secondary priority occupancy method occupies computer resources according to the execution priority when executing a process, so when executing a process with a high execution priority specified, another low execution priority is specified. It is possible to prevent deprivation of computer resources due to the processing, and to give a large amount of computer resources to the processing designated with high execution priority.
[0005]
Therefore, it is possible to shorten the response time from the start to the end of the process for which the high execution priority is designated, and the value of the process is invalid or deteriorated unless it is completed within the designated end time limit or early. Therefore, execution suitable for real-time processing having such a property is possible.
[0006]
In the processing management system described above, it is desirable to execute more processing by effectively using computer resources. Further, in the processing management system using the execution priority, the order according to the execution priority. It is desirable to execute the process.
This is strongly desired in a process management system that executes processing by the subordinate occupation method as compared with a process management system that executes processes by another method.
[0007]
In such a process management system, when executing the round robin method, not only when executing the subordinate priority occupation method, etc., when executing the process according to the execution priority, the high execution priority Processing ThighProcess T with low execution priority for the data for which the lock is requestedlowProcess T with high execution priority becausehighPriority reversal occurs, such as blocking the lock, and processing T with high execution priorityhighThere has been a problem that the response time becomes longer.
[0008]
The above problems are particularly fatal in the subordinate priority occupation method.
For example, when one CPU is provided (in the case of a so-called single processor), the number of processes that can be occupied is only one, and the process T with a high execution priority is performed.highProcesses other than are not executed and process T with high execution priorityhighIs a low-priority processing TlowSince the data locked to the password cannot be used, the execution cannot proceed and the response time is extended as much as possible.
Further, when a plurality of CPUs are provided (so-called multiprocessor), the above-described high execution priority processing ThighAlthough it is possible to avoid a situation in which the response time of the system is prolonged, the high execution priority ThighThe response time is long.
[0009]
That is, in the case of a multiprocessor, the number of processes that can be performed exclusively can be made plural, and a process with higher execution priority (process ThighLow execution priority T after execution oflowIs executed, the low execution priority process TlowProcess T with high execution priority afterhighExecution can proceed. However, high execution priority processing ThighThe execution of the process proceeds with a process with a higher execution priority than a process with a lower execution priority (process ThighAfter the execution of (Excluding) is completed, processing T with a lower execution prioritylowAfter a long time, such as after
[0010]
R. Abbott and H. Garcia-Molina, Scheduling Real-Time Transactions: A Performance Evaluation, ACM Transactions on Database Systems, Vol. 17, No. 3, 1992. (Hereinafter referred to as Document 1) includes a process T with a low execution priority.lowIs aborted (invalidated) and processing T with high execution priorityhighAn HP (High Priority) method has been proposed in which the lock can be secured to the data by the process and the process proceeds.
[0011]
This HP method is an excellent method in terms of executing a process with a high execution priority with the highest priority, but cannot be said to be excellent in terms of executing a plurality of processes as efficiently as possible. . That is, in order to abort the low-priority processing, the computer resources given to the low-priority processing were wasted, and the execution efficiency for the processing was reduced when multiple processing was executed. .
[0012]
As a method for improving the execution efficiency for a plurality of processes with respect to the above-described HP method,
This WP method is a method for reducing the waste of computer resources, and processing T with high execution priority.highAnd low execution priority processing TlowWhen priority inversion occurs betweenlowProcess execution priority of ThighBy raising the execution priority to the same as process Tlow, And then process ThighIs executed. Therefore, process TlowIt is possible to reduce the waste of computer resources such as aborting.
[0013]
Furthermore, the low execution priority process TlowProcess T with high execution priorityhighIn order to raise the execution priority tolowImmediately after execution is finished, process ThighFor example, the processing T occurring in the multiprocessor described above is performed.highProcessing with lower execution priority (Process TlowProcess T if not waiting for other)highProcess T can be prevented, process ThighThe response time can be shortened.
[0014]
Further,
This CR method is a process T with high execution priority.highAnd low execution priority processing TlowEven if the WP method is applied when priority inversion occurs betweenhighIs determined to end within the deadline, the WP method is applied when it can be completed within the expiration date, and the HP method is applied when it cannot be completed.
[0015]
[Problems to be solved by the invention]
As described above, there are an HP method, a WP method, a CR method, and the like as countermeasures when priority inversion occurs.
However, each method described above is not suitable for executing a plurality of processes in the process management system.
For example, although the HP method is an excellent method in that processing is executed in the order of execution priority, computer resources such as aborting the processing are wasted, and the processing cannot be executed efficiently.
In addition, the WP method is an excellent method in terms of reducing the waste of computer resources such as aborting the process and executing the process efficiently, but the process could not be executed according to the order of execution priority. .
[0016]
In addition, the CR method is an excellent method in that the processing is completed within the time limit by selectively using the HP method and the WP method and having the advantages of both, but in order to use this CR method It is necessary to know in advance the execution time required for the process, for example, for a process in which the execution time cannot be grasped before executing the process, such as a search for a database in which the processing amount cannot be determined. Was not applicable and could not achieve any effect.
[0017]
Therefore, the present invention has been made in view of the above-described conventional circumstances, and even when the execution time required for processing is not known, the WP method and the HP method can be selected and applied as a response to the priority inversion. Executes processing as faithfully as possible with execution priority, and can efficiently execute processing without wasting computer resourcesProcessing management system and methodThe purpose is to provide.
[0018]
[Means for Solving the Problems]
In order to achieve the above object, according to the present invention, when the difference in execution priority between two processes is relatively small, the restriction on the order of executing the processes is weak, and the execution priority between the two processes is also low. When the difference in degrees is relatively large, it was made by paying attention to the fact that there is a strong restriction on the order in which the executions are executed. When priority inversion occurs, two priority inversions occur. Based on the execution priority difference between processes, a method for dealing with priority inversion is selected and applied.
In other words, when the execution order restriction for processing such as a relatively small execution priority difference is weak, the WP method that prevents the waste of computer resources is applied, and when the execution priority restriction is strong such that the execution priority difference is relatively large. The HP method is applied.
[0019]
Furthermore, the present invention provides an occupancy process that is executed while occupying a computer resource for which a relatively high execution priority is specified, and a non-execution process that is executed without occupying a computer resource for which a relatively low execution priority is specified. It was made with a focus on the fact that there is a strong restriction on the order in which processes are executed between exclusive processes. When priority inversion occurs between exclusive processes and non-exclusive processes, the non-exclusive processes are aborted. And execute the occupancy process.
[0020]
Therefore, the process management system according to
Based on the detection of priority inversion by the priority inversion detection unit,High of the two processesA first process with an execution priority specified;LowA priority difference calculating unit that calculates a difference in execution priority with the second process for which the execution priority is specified, and a priority difference determining unit that compares the calculated execution priority difference with a preset specified value. And the priority difference determining unit determines that the execution priority difference is less than the specified value, and sets the execution priority of the second process to be equal to or higher than the execution priority of the first process. And an abort control unit that aborts the second process based on the fact that the priority difference determination unit determines that the execution priority difference is equal to or greater than a specified value. To do.
[0021]
In the process management system according to
[0022]
The process management system according to
[0023]
In the process management system according to
[0024]
The process management system according to
[0025]
In the process management system according to
A process management method according to
[0026]
DETAILED DESCRIPTION OF THE INVENTION
A processing management system according to a first embodiment of the present invention will be described with reference to FIG.
The processing management system includes a processing
[0027]
The process
[0028]
The
The execution priority includes the instruction from the user, the length of time required to execute the process, the priority given to the user who requested the process, the priority given to the terminal that requested the process, and the process. It is specified based on any one or a plurality of criteria such as a given time limit.
[0029]
The processing information management table 3 holds information relating to processing, and the information to be held is specified for the processing identification number (processing ID), processing end time limit, processing, for example, as shown in FIG. Execution priority, etc.
[0030]
The process
That is, when a process is received from the
Next, the processing
[0031]
The
[0032]
The execution waiting
[0033]
The execution
[0034]
For example, when the execution right is given to the process stored in the waiting
When the execution right is given to the process stored in the interrupt
When there are a plurality of processes to which the same execution priority is given, the execution right is given in order from the process that has been requested to be executed first.
[0035]
The
[0036]
The interrupt
The interrupted state represents, for example, a state in which the lock is secured when the process secures the lock on the data.
[0037]
The priority
[0038]
Note that the occurrence of priority inversion occurs when, for example, a process that secures a lock for each data of a certain unit amount is grasped, and a certain process uses the data. It is possible to detect whether another process has secured the lock on the data. That is, in this embodiment, there is one
[0039]
The priority
[0040]
That is, the high-priority priority processing T passed from the priority
As a result of the comparison, if the execution priority difference is less than the specified value, the execution control corresponding unit performs the process TlowProcessing ThighSet the same execution priority as process ThighIs transferred to the interruption
On the other hand, if the execution priority difference is equal to or greater than the specified value as a result of the comparison, the abort handling unit performs processing T.lowIs aborted and transferred to the execution waiting
[0041]
Here, processing ThighAnd processing TlowIs referred to from the processing information management table 3.
In addition, the above-mentioned specified value to be set in advance is a method for executing a process with a low execution priority first rather than aborting a process with a low execution priority in response to a priority inversion occurring between two processes. This is a difference in execution priority at a critical point such as “good” and can be determined by the user or the system.
[0042]
The
[0043]
When receiving the process from the
[0044]
When the
[0045]
Next, the operation of the process management system according to the first embodiment of the present invention will be described.
When a request for executing a certain process is issued, the process
Then, the
[0046]
The processing
[0047]
The execution right is given by the execution
First, the execution
[0048]
If there is no process being executed in the
If it is detected that the process is stored in both the waiting
[0049]
On the other hand, if it is detected that the process is stored in either the execution waiting
[0050]
On the other hand, if there is a process being executed in the
If it is detected that the process is stored in the waiting
On the other hand, when it is detected that no process is stored in the waiting
[0051]
When the execution right is given to the process, the process is executed by the
[0052]
When the process is executed by the
That is, the
[0053]
On the other hand, the priority
[0054]
When the
[0055]
On the other hand, when the priority
First, the priority
[0056]
Next, the calculated execution priority difference d is compared with a preset specified value (step S15). If the execution priority difference d is less than the specified value, the process ThighAnd processing TlowThe restriction on the execution order is weak and processing TlowProcess T rather than abortinglowRepresents that it is better to execute the process first.lowProcessing ThighSet the same execution priority as the execution priority ofhighIs sent to the interruption
[0057]
On the other hand, when the execution priority difference d is larger than the specified value, the process ThighAnd processing TlowThere are strong restrictions on the execution order, and process ThighMust be executed first, so process TlowIs passed to the execution waiting
[0058]
When the notification that the processing has been normally completed is received from the
[0059]
As described above, when priority inversion occurs, even for a process whose execution time is unknown, there is a restriction on the execution order according to the execution priority due to the execution priority difference between the processes in which the priority inversion has occurred. Appropriate execution of processing in the execution order according to the execution priority when it is strong, and preventing waste of computer resources rather than keeping the execution order when restrictions on the execution order according to the execution priority are weak You can select the appropriate response.
[0060]
In the above embodiment, the
[0061]
In the case where the process is executed according to the non-occupancy method, the priority
[0062]
A processing management system according to the second embodiment of the present invention will be described with reference to FIG. In addition, the same code | symbol is attached | subjected to the same part as the process management system based on 1st Example shown in FIG. 1, and the overlapping description is abbreviate | omitted.
This processing management system corresponds to the priority inversion according to the processing method of the two processes in which the priority inversion occurs in the processing management system shown in the first embodiment. A priority
[0063]
The
[0064]
The priority
[0065]
That is, the high execution priority processing T received from the priority
As a result, processing ThighBelongs to the high execution priority range specified for exclusive processing, and processing TlowIs determined to belong to the low execution priority range designated as the non-occupied process, the process T in which the second abort part is the non-occupied processlowIs the exclusive process ThighProcess T is a non-occupied process.lowAbort.
On the other hand, processing ThighAnd processing TlowAre determined to belong to the low execution priority range designated as the non-occupied process, the two processes are the non-occupied processes, so nothing is performed, and the process ThighAnd processing TlowAre determined to belong to the high execution priority range designated for the occupancy process, the two processes are passed to the priority
[0066]
Next, the operation of this processing management system will be described. The description of the same operation as in the first embodiment is omitted.
When the priority
First, the priority
[0067]
Processing ThighAnd processing TlowAre both occupied processes, the two processes are transferred to the priority inversion handling unit 7 (step S21).
On the other hand, processing ThighIs the occupancy process and process TlowIs a non-occupied process, the process TlowProcess T, which is an exclusive processhighCan be executed (step S22).
Processing ThighAnd processing TlowIf both are unoccupied processes, nothing is done. Processing ThighIs unoccupied processing, and processing TlowIs an exclusive process, an error process is performed since it cannot occur.
[0068]
Next, in the processing management system according to the second embodiment, an example in which a commercially available OS, Solaris 2.5 (Solaris is a registered trademark), is used as the
[0069]
Here, a case where priority inversion occurs between an unoccupied process in which the execution priority “59” is designated and an occupied process in which the execution priority “100” is designated will be described as an example.
In this case, in the process management system according to the first embodiment, for example, there is a possibility that the non-occupying process is executed before the occupying process depending on how to obtain the specified value. That is, if the specified value is set to “50”, the difference in execution priority between the two processes in which priority inversion has occurred is less than the specified value “50”, so the unoccupied process is the same as the occupied process. The priority is raised to the execution priority, and the unoccupied process is executed before the occupied process.
This is a problem for exclusive processing where an end deadline or the like is given or early execution is desired.
On the other hand, in the processing management system of the second embodiment, when the above-described priority inversion occurs, the unoccupied process is always aborted, so that the occupied process can be executed immediately.
[0070]
As described above, when priority inversion occurs, the occupation process can be executed without being obstructed by the non-occupancy process. Furthermore, if there are strong restrictions on the execution order according to the execution priority based on the difference in execution priority for the two exclusive processes where priority inversion has occurred, the processes are executed in the execution order according to the execution priority. When the restriction on the execution order according to the execution priority is weak, it is possible to select an appropriate response such as preventing waste of computer resources rather than keeping the execution order.
[0071]
Even if the priority
The
[0072]
The priority
In addition, the
In addition, the
[0073]
In addition, although each above-mentioned function part 1-11 is comprised when CPU operate | moves according to a program, you may comprise these function parts as an independent hardware circuit.
In the first and second embodiments described above, the single processor having one
[0074]
【The invention's effect】
As explained aboveIn the present inventionWhen priority inversion occurs, the HP method or WP method is selected by comparing the difference in execution priority between the two processes in which priority inversion occurs and the preset specified value. As a result, processing can be executed faithfully to the execution priority, computer resources can be saved, and processing can be executed efficiently.
Also,In the present inventionSince the two types of processing in which priority inversion occurred are detected and the two processings are exclusive processing and non-exclusive processing, the non-exclusive processing is aborted. Can be executed, and can be executed suitable for the occupation process.
[Brief description of the drawings]
FIG. 1 is a configuration diagram of a processing management system according to a first embodiment.
FIG. 2 is a diagram illustrating a processing information management table according to the first embodiment.
FIG. 3 is a first flowchart illustrating an operation performed by an execution process determination unit according to the first embodiment.
FIG. 4 is a second flowchart illustrating an operation performed by an execution process determination unit according to the first embodiment.
FIG. 5 is a flowchart illustrating an operation corresponding to priority inversion according to the first embodiment;
FIG. 6 is a configuration diagram of a processing management system according to a second embodiment.
FIG. 7 is a diagram for explaining an operation corresponding to priority inversion according to the second embodiment;
FIG. 8 is a flowchart illustrating an operation corresponding to priority inversion according to the second embodiment.
[Explanation of symbols]
5 ... OS, 5c ... Process execution unit,
6 .... Priority inversion detection section, 7 .... Priority inversion support section,
11. Priority inversion judgment section,
Claims (5)
実行途中の2つの処理についての実行状態を管理することにより当該2つの処理間で優先度逆転が発生していることを検出する優先度逆転検出部と、
優先度逆転検出部が優先度逆転を検出したことに基づいて、前記2つの処理のうちで高い実行優先度が指定された第1処理と低い実行優先度が指定された第2処理との実行優先度の差を算出する優先度差算出部と、
算出された実行優先度差と予め設定された規定値とを比較する優先度差判定部と、
優先度差判定部により実行優先度差が規定値未満と判定されたことに基づいて、第2処理の実行優先度を第1処理の実行優先度以上にして処理実行部に第2処理を実行させる実行制御対応部と、
優先度差判定部により実行優先度差が規定値以上と判定されたことに基づいて、第2処理をアボートするアボート対応部と、を備えたことを特徴とする処理管理システム。In a process management system that includes a process execution unit that executes a process, and the process execution unit executes a process according to a specified execution priority,
A priority inversion detection unit that detects that a priority inversion has occurred between the two processes by managing execution states of the two processes in the middle of execution;
Execution of the first process in which the high execution priority is designated and the second process in which the low execution priority is designated among the two processes based on the priority inversion detection unit detecting the priority inversion. A priority difference calculation unit for calculating a difference in priority;
A priority difference determination unit that compares the calculated execution priority difference with a preset specified value;
Based on the fact that the execution priority difference is determined to be less than the specified value by the priority difference determination unit, the execution priority of the second process is set to be equal to or higher than the execution priority of the first process, and the second process is executed by the process execution unit. An execution control support unit
A processing management system, comprising: an abort handling unit that aborts the second process based on a determination that the execution priority difference is greater than or equal to a predetermined value by the priority difference determination unit.
前記実行優先度として指定可能な範囲は、処理実行部を占有して実行される処理に指定する高実行優先度の範囲と、処理実行部を占有せずに実行される処理に指定する低実行優先度の範囲とを有し、
実行途中の2つの処理についての実行状態を管理することにより当該2つの処理間で優先度逆転が発生していることを検出する優先度逆転検出部と、
優先度逆転検出部が優先度逆転を検出したことに基づいて、前記2つの処理のうちで高い実行優先度が指定された第1処理と低い実行優先度が指定された第2処理との実行優先度がそれぞれ上記したいずれの範囲に属するかを判定する優先度逆転判定部と、
優先度逆転判定部により第1処理が高実行優先度の範囲に属するとともに、第2処理が低実行優先度の範囲に属すると判定されたことに基づいて第2処理をアボートする第2アボート対応部と、を備えたことを特徴とする処理管理システム。In a process management system that includes a process execution unit that executes a process, and the process execution unit executes a process according to a specified execution priority,
The range that can be specified as the execution priority is a range of high execution priority that is specified for a process that occupies a process execution unit and a low execution that is specified for a process that is executed without occupying the process execution unit A range of priorities,
A priority inversion detection unit that detects that a priority inversion has occurred between the two processes by managing execution states of the two processes in the middle of execution;
Execution of the first process in which the high execution priority is designated and the second process in which the low execution priority is designated among the two processes based on the priority inversion detection unit detecting the priority inversion. A priority inversion determination unit for determining which range each of the priorities belongs to;
Corresponding to the second abort in which the first process is determined to belong to the high execution priority range and the second process belongs to the low execution priority range by the priority inversion determination unit. And a processing management system characterized by comprising:
前記優先度逆転判定部により第1処理及び第2処理が共に高実行優先度の集合に属すると判定されたことに基づいて、第1処理と第2処理との実行優先度の差を算出する優先度差算出部と、
算出された実行優先度差と予め設定された規定値とを比較する優先度差判定部と、
優先度差判定部により実行優先度差が規定値未満と判定されたことに基づいて、第2処理の実行優先度を第1処理の実行優先度以上にして処理実行部に第2処理を実行させる実行制御対応部と、
優先度差判定部により実行優先度差が規定値以上と判定されたことに基づいて、第2処理をアボートするアボート対応部と、を備えたことを特徴とする処理管理システム。In the processing management system according to claim 2,
A difference in execution priority between the first process and the second process is calculated based on the determination that both the first process and the second process belong to the set of high execution priorities by the priority inversion determination unit. A priority difference calculator,
A priority difference determination unit that compares the calculated execution priority difference with a preset specified value;
Based on the fact that the execution priority difference is determined to be less than the specified value by the priority difference determination unit, the execution priority of the second process is set to be equal to or higher than the execution priority of the first process, and the second process is executed by the process execution unit. An execution control support unit
A processing management system, comprising: an abort handling unit that aborts the second process based on a determination that the execution priority difference is greater than or equal to a predetermined value by the priority difference determination unit.
実行途中の2つの処理間で優先度逆転が発生していることが検出されたことに基づいて、 Based on detecting that a priority inversion has occurred between two processes in the middle of execution,
高い実行優先度が指定された第1処理と低い実行優先度が指定された第2処理との実行優先度の差が算出され、 A difference in execution priority between the first process in which a high execution priority is specified and the second process in which a low execution priority is specified is calculated,
算出された実行優先度差と予め設定された規定値とが比較され、実行優先度差が規定値未満の場合には、第2処理の実行優先度が第1処理の実行優先度以上に設定されて第2処理が実行され、実行優先度差が規定値以上の場合には、第2処理がアボートされることを特徴とするコンピュータ処理管理システムにおける処理管理方法。 The calculated execution priority difference is compared with a preset specified value. If the execution priority difference is less than the specified value, the execution priority of the second process is set to be equal to or higher than the execution priority of the first process. When the second process is executed and the difference in execution priority is equal to or greater than a specified value, the second process is aborted.
処理実行部を占有して実行される処理に指定される高実行優先度の範囲と、処理実行部 The range of high execution priority specified for processing executed exclusively by the processing execution unit, and the processing execution unit を占有せずに実行される処理に指定される低実行優先度の範囲とが予め設定され、And a low execution priority range designated for processing executed without occupying
実行途中の2つの処理間で優先度逆転が発生していることが検出されたことに基づいて、高い実行優先度が指定された第1処理と低い実行優先度が指定された第2処理との実行優先度がそれぞれ上記いずれの範囲に属するかが判定され、 A first process in which a high execution priority is designated and a second process in which a low execution priority is designated on the basis of detection of a priority inversion occurring between two processes in the middle of execution; It is determined which of the above ranges each execution priority belongs to,
第1処理が高実行優先度の範囲に属するとともに第2処理が低実行優先度の範囲に属する場合には、第2処理がアボートされることを特徴とするコンピュータ処理管理システムにおける処理管理方法。 A process management method in a computer process management system, wherein a second process is aborted when the first process belongs to a range of high execution priority and the second process belongs to a range of low execution priority.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP19548696A JP3711642B2 (en) | 1996-07-05 | 1996-07-05 | Processing management system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP19548696A JP3711642B2 (en) | 1996-07-05 | 1996-07-05 | Processing management system |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH1021092A JPH1021092A (en) | 1998-01-23 |
| JP3711642B2 true JP3711642B2 (en) | 2005-11-02 |
Family
ID=16341896
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP19548696A Expired - Fee Related JP3711642B2 (en) | 1996-07-05 | 1996-07-05 | Processing management system |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3711642B2 (en) |
-
1996
- 1996-07-05 JP JP19548696A patent/JP3711642B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JPH1021092A (en) | 1998-01-23 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US5377352A (en) | Method of scheduling tasks with priority to interrupted task locking shared resource | |
| US6694390B1 (en) | Managing bus transaction dependencies | |
| US20080072228A1 (en) | System and method for delayed priority boost | |
| US6473819B1 (en) | Scalable interruptible queue locks for shared-memory multiprocessor | |
| JPH10283243A (en) | Data base management system | |
| JP2009294712A (en) | Priority controller and priority control method | |
| WO2010067492A1 (en) | Multiprocessor system and multiprocessor exclusive control adjustment method | |
| US8413163B2 (en) | Program control device including per-timeslot switching of thread execution | |
| JPH1153202A (en) | Parallel transaction processing system | |
| JP3711642B2 (en) | Processing management system | |
| JPH0877025A (en) | Task priority control method and task priority control device | |
| CN103995743B (en) | Two-stage mixed task scheduling method based on resource reservation | |
| JP2684993B2 (en) | Processor system and control method thereof | |
| US7689992B2 (en) | Sharing lock mechanism between protocol layers | |
| JPH1049388A (en) | Input and output controller | |
| JPH05250188A (en) | Process priority control method | |
| JPH07319716A (en) | Exclusive control method of computer system resources | |
| US20070143738A1 (en) | Method for efficient utilization of processors in a virtual shared environment | |
| JPH10177489A (en) | How to schedule a task | |
| CN118897741B (en) | Read-write lock realization method and device, electronic equipment and storage medium | |
| JPH1139178A (en) | Computer system and checkpoint thread method in computer system | |
| JPH10247161A (en) | Memory management system | |
| JPH01258135A (en) | Transaction execution control system | |
| JPH06214811A (en) | Scheduling system | |
| JPH11327921A (en) | Thread priority control device and thread priority control method in computer system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20050420 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20050509 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20050705 |
|
| TRDD | Decision of grant or rejection written | ||
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20050726 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20050808 |
|
| R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090826 Year of fee payment: 4 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100826 Year of fee payment: 5 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110826 Year of fee payment: 6 |
|
| LAPS | Cancellation because of no payment of annual fees |