JP3644078B2 - Program sharing device and method - Google Patents

Program sharing device and method Download PDF

Info

Publication number
JP3644078B2
JP3644078B2 JP18421295A JP18421295A JP3644078B2 JP 3644078 B2 JP3644078 B2 JP 3644078B2 JP 18421295 A JP18421295 A JP 18421295A JP 18421295 A JP18421295 A JP 18421295A JP 3644078 B2 JP3644078 B2 JP 3644078B2
Authority
JP
Japan
Prior art keywords
program
data
entity management
entity
execution
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
JP18421295A
Other languages
Japanese (ja)
Other versions
JPH0934790A (en
Inventor
聰彦 矢口
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP18421295A priority Critical patent/JP3644078B2/en
Publication of JPH0934790A publication Critical patent/JPH0934790A/en
Application granted granted Critical
Publication of JP3644078B2 publication Critical patent/JP3644078B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)

Description

【0001】
【発明の属する技術分野】
本発明はアドレス変換機構によって主記憶と仮想記憶の対応付けを行う仮想記憶方式のコンピュータにおける同一仮想空間内のプログラムの共用方式に関する。
【0002】
【従来の技術】
最初に、仮想記憶システムにおけるプログラムの実行環境についてどのようになっていたかについて説明しながら、本発明の説明に使用する用語についても紹介していくことにする。
〔プログラムの実行(実行体の生成とプログラムの配置)〕
端末からコマンドを入力するなど、オペレーティングシステムが処理を依頼されて、新たな実行可能な形式のプログラム(オブジェクトプログラム、以下単にプログラムと呼ぶ)を実行する場合、オペレーティングシステムは、仮想空間および、この仮想空間内でプログラムを動作させるための環境(タスク、スレッドなどと呼ばれるもので、以下、これを実行体と呼ぶ)を作成し、この実行体内で走行させるプログラムを上記仮想空間内に配置(プログラムを配置するとは、二次記憶上のプログラムライブラリに存在するプログラムを仮想空間内の仮想アドレスでアクセスできる様な状態にすることである)し、配置したプログラム内に存在する入口点(そのプログラムを呼び出すときに制御が渡る命令の位置)に制御を渡すことによりプログラムを動作させる。
〔仮想空間へのプログラムの配置〕
ある実行体で、あるプログラムから別のプログラムを呼び出して処理を行う場合、これらのプログラムの配置方法には、大きくわけて二通りの方法がある。ひとつは、仮想空間を作成し、プログラムの入口点に制御を渡す前に、必要なプログラムをすべて配置してしまう方法である。もうひとつは、仮想空間を作成するときには、オペレーティングシステムが制御を渡す入口点を持つプログラムのみを配置し、そのプログラムの走行中に他のプログラムの呼び出しが発生した時点で、呼び出されるプログラムを配置する方法である。
〔ダイナミックリンカ〕
上記ふたつの方法とも、あるプログラムから別のプログラムへの呼び出しを行う場合、どのプログラムへ制御を渡すかを検索する機能(動的にプログラムを配置するもので、配置されていないプログラムをアクセスしたときに、これを検出して、オペレーティングシステムがプログラムライブラリを検索する。通常、この機能をダイナミックリンカと呼ぶ)が必要である。
【0003】
上記前者の配置方法の場合、プログラムはすべて配置されているので、この機能は仮想空間内に配置済のプログラムの中から必要な入口点を検索し、制御を渡す。
【0004】
上記の後者の配置方法の場合、すでに仮想空間内に配置されているプログラムから必要な入口点を検索し、入口点が存在する場合は制御を渡すが、必要な入口点が存在しない場合、二次記憶上のライブラリに存在するプログラムから必要な入口点が存在するプログラムを検索し、見つかったプログラムを仮想空間内に配置し、入口点に制御を渡す。
〔マルチタスク(マルチスレッド)環境でのプログラムの配置〕
ひとつの仮想空間内に複数の実行体が走行する環境(いわゆる、マルチタスク環境や、マルチスレッド環境のこと)では、上記仮想空間内にプログラムを配置する場合、以下の二通りの方法がある。
【0005】
ひとつは、あるプログラムが同一仮想空間内に存在する複数の実行体で走行する場合、上記プログラムをその実行体の数だけ仮想空間内に配置する方法である。もうひとつはあるプログラムが同一仮想空間内に存在する複数の実行体で走行する場合でも、上記プログラムは上記仮想空間内にひとつだけ配置し、これを共用する方法である。
【0006】
通常、プログラム内に情報を保持する変数(外部変数など)を更新するようなプログラムの場合、前者の方法を採用する。なぜなら、後者を採用した場合、そのプログラム内で行うデータの値を実行体どうしで破壊しあい、データの値を実行体毎に保証することができないからである。
【0007】
【発明が解決しようとする課題】
プログラムは、命令コードなどが格納されている部分(以下、これをテキスト部と呼ぶ)と変数などのデータが格納されている部分(以下、これをデータ部と呼ぶ)とに大別できる。
【0008】
UNIXなどで採用されているELF形式のように、一般的には、プログラムの入口点がテキスト部の中に存在する。このような形式のプログラムは、オペレーティングシステムからテキスト部の中に存在する入口点に制御を渡され、テキスト部の中に存在する命令コードを実行する。このとき、動作している命令コードでは、データ部の中に存在する変数などを参照したり更新したりする。
【0009】
このため、上記のように入口点がテキスト部に存在する形式のプログラムの場合、命令コードの位置と、変数が格納されている位置との相対的な位置関係(オフセットという)が、プログラムを実行可能な形式にするとき(すなわち、リンクするとき)に決まっていなければならない。リンク後、すなわち、実行体の生成時、プログラムの配置時、プログラムに制御を渡す時などを契機に、動的に変更することは現実的にできない(つまり、上記場面を契機に毎回プログラム内に存在するすべての位置関係の情報を変更しなければならないということになるからである)。
【0010】
ひとつの仮想空間内に複数の実行体が走行する環境(いわゆる、マルチタスク環境やマルチスレッド環境のこと)で、上記のような形式のプログラムを走行させるためには、必要なプログラムを実行体単位に上記仮想空間内に配置する必要がある。言い換えれば、あるプログラムが同一仮想空間内に存在する複数の実行体で走行する場合、上記プログラムをその実行体の数だけ仮想空間内に配置しなければならない。
【0011】
なぜなら、仮に、仮想空間内に上記プログラムをひとつだけ配置し、複数の実行体でこのプログラムを走行させた場合、このプログラム内で参照、更新を行うデータの値を実行体どうしで破壊しあい、データの値を実行体毎に保証することができないからである。
【0012】
このため、複数の実行体が走行する環境で、上記の形式のプログラムを走行させる場合、仮想空間内に複数の実行体毎に複数の同一プログラムを配置するために利用可能な仮想空間の領域を圧迫することになる。
【0013】
これによって、ハード性能が向上したことの恩恵を受けるために、走行させるプログラムの多重度(すなわち実行体の数)を増やして処理を並列に行い性能の向上を考えた場合にも、上記の仮想空間内の領域の圧迫が原因で実現できない場合があるという問題があった。
【0014】
本発明はこのような点にかんがみて、入口点がテキストの中に存在するプログラムを、同一仮想空間内に同一のプログラムをただ一つだけ配置し、上記仮想空間内の複数の実行体で共用することで、仮想空間内の仮想領域の圧迫を防止する手段を提供することを目的とする。
【0015】
【課題を解決するための手段】
上記の課題は下記の如くに構成されたプログラムの共用装置によって解決される。
【0016】
図1は、本発明の原理説明図である。
共用プログラムのテキスト部2sと、上記テキスト部2sと静的にリンクされた上記共用プログラムのデータ部3とを仮想空間4内に配置し、
上記仮想空間4内で上記共用プログラムを実行する環境すなわち実行体1sを1a、1b、1c・・・のように1以上有するプログラムの共用装置であって、2aは上記実行体1a、1b、1cに共用に唯一配置された共用プログラムテキスト部2sの実体であり、DRA9a、DRB9b、DRC9cは上記共用プログラムのデータ部3に対応する上記実行体1a、1b、1c毎の一次記憶上の実体を表すものであり、DFA8a、DFB8b、DFC8cは上記共用プログラムのデータ部3に対応する上記実行体1a、1b、1c毎の二次記憶上の実体を表すものである。
【0017】
PTA7a、PTB7b、PTC7cは上記実行体1a、1b、1c毎に上記共用プログラムのデータ部3の実体が一次記憶上あるいは二次記憶上のいずれにあるかなど実体の所在を保持するテーブルであり、不図示の上記したデータ部実体管理テーブルにより関連付けられている。
【0018】
実行体切替手段5は上記共用プログラムが動作する実行体1a、1b、1cを切り替えるものであり、データ部実体切替手段6は上記実行体切替手段5に同期して上記データ部3の実体の所在を保持するテーブルPTA7a、PTB7b、PTC7cを切り替えるものである。
【0019】
共用プログラムのテキスト部2sと、上記テキスト部2sと静的にリンクされた上記共用プログラムのデータ部3とが仮想空間4に配置されて実行するとき、共用プログラムのテキスト部2sは実行環境である実行体1a、1b、1cに共用のテキスト部の実体2aとして唯一存在する。
【0020】
テキスト部2sが参照、更新するべく仮想領域のデータ部3をアクセスするとき、データ部3の実体として一次記憶上の内容9a、9b、9cあるいは二次記憶上の内容8a、8b、8cを参照、更新するようにするために仮想領域と実体の所在を管理するテーブル7a、7b、7cによりアドレス変換が行われる。
【0021】
このとき、データ部3の実体は実行体1a、1b、1cに対応したものを対象とするように、実行体切替手段5による実行体の切り替えに同期してデータ部実体切替手段6を動作させるようになっている。
【0022】
このようにして、共用プログラムのテキスト部2sは唯一の実体2aを使用し、データ部3は実行体1a、1b、1c毎に備えられた実体9a、9b、9cあるいは8a、8b、8cを使用して実行体毎の独立した処理を行うプログラムの共用が実現できることになる。
【0023】
【発明の実施の形態】
図2に本発明の実施の形態の構成図を示す。
仮想記憶装置を備えるコンピュータシステムにおいて、複数の実行体(マルチタスクあるいはマルチスレッド)が存在するようにし、共用するプログラムの命令部であるテキスト部は仮想空間内に各実行体に共通なものとして唯一つのみが実体として存在するようにし、上記テキスト部が実行に際して参照するデータ部も見かけ上は仮想空間に一つのみが配置してある。
【0024】
テキスト部の命令が実行されるとき、データ部の操作はどの実行体が動作中であっても、仮想空間上では静的にリンクされているデータ部の仮想アドレスは変わらない。
【0025】
しかし、複数の実行体が行う処理内容は当然別のデータを用いて、別の環境において行うものとなるので、プログラムの命令部であるテキスト部は唯一つの実体を用いても、データ部については各実行体毎に異なるデータの実体を扱い、異なる入力に対して異なる出力を得るようにしなければならない。
【0026】
このために通常のプログラムの管理に加えて共用プログラムの管理を行うために図2の点線250で囲んだような幾つかの手段を追加して備えるようにしている。
【0027】
まず全体の構成について説明する。
210はプログラム管理部であり、プログラムライブラリから仮想空間への配置、回収に関する管理を行うものである。プログラム管理テーブル211はプログラムの配置、回収に関する情報を保持する。プログラム配置手段212はプログラムライブラリから仮想空間上で仮想アドレスでアクセスできるような状態にする。すなわち、仮想空間へのローディングを行うものである。前記したように、プログラムのローディングはプログラムが呼び出される度に行われたり、まとめて必要なプログラムを一括して配置したりするが、いずれにしてもこのプログラム配置手段212によって行われる。
【0028】
プログラム回収手段213は配置したプログラムが仮想空間に存在する必要が無くなったときに呼び出されて指定されたプログラムを仮想空間から回収するものである。
【0029】
上記のプログラムの配置や回収について、本発明の実施の形態におけるプログラムの共用を実現するために追加された手段を説明する前に実行体管理部220、実行体制御部230および仮想記憶装置に必須なページング制御部240について説明する。
【0030】
実行体は上述したように、プログラムが動作する環境であり、通常複数の環境で複数のプログラムが同時並行的に進行するように複数の実行体が同時に設定される。
【0031】
実行体生成手段221と実行体回収手段222は実行体を新たに作り出し、また、不要になった実行体を回収するものである。すなわち、新たな情報処理を行うときにはプログラムを動作させる環境を整える必要があり、実行体の生成が行われ、その上でプログラムの配置を行う。その逆が回収である。
【0032】
複数の実行体は処理装置の数により同時に実行できる数が決まるが、どの実行体を動作させるか、その切り替えを行うものが実行体切替手段231である。実行体の切り替えのきっかけにはいくつかあるが、例えば、割当時間経過、入出力完了待ち、排他制御待ちなどがある。
【0033】
ページング制御部240は仮想記憶の実体が一次記憶装置あるいは二次記憶に存在し、一次記憶装置を必要に応じてページ単位で交代で使用する仮想記憶装置の仕組みであり、ページイン要求処理手段241はページインが要求されたとき一次記憶装置のページ枠単位に空きページを探し、無いときは利用されていないページをページアウトしてからページインするなどの処理を行うものである。ページイン完了処理手段243はページインに伴う入出力の完了を確認するものである。同様に、ページアウト要求処理手段242、ページアウト完了処理手段244もページアウトの要求を処理するものである。
【0034】
次に、プログラム共用のための追加手段250について説明する。
テキスト部実体管理テーブル253はテキスト部の実体に関連する情報を保持するものであり、プログラム識別情報、プログラムを配置した仮想空間識別情報すなわち多重仮想記憶装置の仮想空間の識別に用いるもの、プログラムを配置した仮想空間内のテキスト部の仮想アドレスと大きさ、さらに共用している実行体の実行体識別情報が含まれる。
【0035】
テキスト部実体管理情報構築手段251は上記プログラム配置手段212により起動されるもので、新たに配置されるプログラムのテキスト部について上記テキスト部実体管理テーブル253に情報を設定し構築するものである。
【0036】
テキスト部実体管理情報回収手段252は上記プログラム回収手段213により起動され、指定のプログラムのテキスト部の実体管理情報を回収するものである。
【0037】
データ部実体管理テーブル256はデータ部の仮想領域とデータ部に対応する実行体ごとに設定する実体管理用仮想領域(後述)のアドレス、プログラムの識別情報、大きさおよび対応する実行体識別情報をプログラムと実行体の全ての組み合わせについて情報を保持するものである。
【0038】
データ部実体管理情報構築手段254、データ部実体管理情報回収手段255によってデータ部実体管理テーブル256の情報の登録削除を行う。
データ部実体切替手段257は上記実行体切替手段231に同期して起動され、テキスト部がアクセスするデータ部の実体を切り替えるものである。
【0039】
ページングインターフェース手段258は前述のページイン、ページアウト処理が発生したときに、ページテーブルにある状態表示で内容が共用するプログラムのデータ部の実体であることがわかるとページング制御部240から制御が渡されるもので、非同期に発生する実行体の切り替えに関わらずページングのI/O動作が正常に完了するように、対象の仮想アドレスの調整を行うものである。
【0040】
次に、各テーブルの構成についてそれぞれの図および全体の構成を示す図2によって説明する。
図3はプログラム管理テーブルの説明図である。
【0041】
プログラム管理テーブル211は図3に示すように、プログラムID(識別番号)31、配置された仮想空間ID32、配置された仮想領域のアドレス(S−P−Dの形式でセグメント番号、ページ番号、ページ内変位を表す。以下同様)33、領域の大きさ34、プログラムの構成36を含む。
【0042】
図3には2つのプログラムPG1、PG2が配置されている状態を示している。仮想領域アドレスはそれぞれ11−0−0、13−0−0となっておりセグメント番号11と13の先頭を示している。領域の大きさは8KB、7KBを表している。
【0043】
図4はテキスト部実体管理テーブルの説明図である。
上記と同様の形式であり、PG1とPG2のテキスト部について記されている。テキスト部は実行体すべてに共通として使用するので実行体IDの情報はないが、共用している実行体IDのリストは後述の図6実行体管理テーブルに保持する。
【0044】
図5はデータ部実体管理テーブルの説明図である。
上記に加えて対応する実行体ID56と実体管理用仮想領域アドレス57が項目として設定されている。複数の行が記入してあるが、これは、まず、実行体としてT01、T02、T03が設定されていたときにプログラムPG1がプログラム配置手段212により配置されて最初の3行の情報が設定されている。すなわち、PG1に対して実行体T01、T02、T03が対応し、プログラムのデータ部仮想領域アドレス53は4−0−0で同一の仮想領域アドレスを示している。
【0045】
実体管理用仮想領域アドレス57は各プログラムのデータ部の領域と同じ大きさの仮想領域をそれぞれ別セグメントにとっている。上記の例ではセグメント1、3、14である。この実体管理用仮想領域はデータ部の実体を実行体毎に用意して各実行体が動作するときにデータ部の仮想領域アドレス53が示す領域にプログラムのテキスト部の命令がアクセスすると実際はこの実体管理用仮想領域アドレス57の示す領域に対応する実体にアクセスすることになるようにしている。
【0046】
2番目に配置されたプログラムPG2についても次の3行に同様に実行体T01、T02、T03に対応して情報が記録されている。この様な状態のときに、新規に実行体T04が生成されて最後の2行の情報が作られた。すなわち、存在していたプログラムPG1、PG2について実行体T04用に実体管理用仮想領域が確保されセグメント8、9として記録されている。
【0047】
以上のようにプログラムPG1、PG2と実行体T01、T02、T03、T04の組み合わせ全てについて情報が発生したことになる。
図6は実行体管理テーブルの説明図である。
【0048】
仮想空間ID61毎に1つのテーブルを設定し、現在設定されている実行体の個数62と実行体IDのリスト63の情報を保持する。これは、例えば新規にプログラムを配置するとき存在する実行体の全てについてデータ部実体管理テーブル256に情報を構築する必要があるときに必要となるものである。
【0049】
図7はセグメントテーブルとページテーブルの構成の説明図である。
(a)に示すセグメントテーブルは前段のテーブル71から起点アドレスを示される。セグメント番号72に対応して(c)、(d)に示すページテーブルのアドレス73が示される。図5のデータ部実体管理テーブル256に示したプログラムID51がPG1の実行体T01とT02についてセグメントテーブルとページテーブルの関係を矢印79a、79bで示している。
【0050】
PG1のデータ部仮想領域アドレス53は4−0−0となっており領域のセグメント番号は4である。また、実体管理用仮想領域アドレス57はプログラムIDがPG1、実行体IDがT01に対して1−0−0でありセグメント番号は1である。さらに、T02に対応した実体管理用仮想領域アドレス57は3−0−0でセグメント番号は3である。
【0051】
図7(a)のセグメントテーブルのセグメント番号4に示されているページテーブルアドレス73zは本来79zによりページテーブル74が指し示されるものであるが、プログラムを共用するために本来のページテーブル74は作られず、実行体切替手段231と同期してデータ部実体切替手段257が働き、73zにはセグメント番号1に対応して図7(c)またはセグメント番号3に対応して図7(d)に示す実体管理用仮想領域ページテーブルを指し示すアドレスが書き込まれる。このように73zからのポインタは78aまたは78bのようになる。
【0052】
上記のようにセグメントテーブルのデータ部のセグメント番号に対応するページテーブルのポインタを書き換えることによりデータ部の実体を示すページテーブルを切り替えるようにしている。
【0053】
図8はページテーブルエントリの説明図である。
(a)、(b)によりセグメントテーブルとページテーブルの関係を示している。ページは2つのエントリからなり、固定の間隔、ここでは16進で100番地の距離だけ離れて配置してある。エントリ1はハード関連情報、エントリ2にはソフト関連情報が格納してある。実体の存在場所に関する情報はエントリ1、エントリ2の双方の情報で判断する。
【0054】
具体的にはエントリ1は図(c)に示すように、仮想ページに対応する一次記憶上の実ページが存在するか否かの情報86aと存在する場合には実ページのページアドレス87aとその他の情報として属性H88aにアクセス権、参照、更新の状況を保持する。
【0055】
(d)のエントリ2には実体が二次記憶上に存在するか否かの情報86bと存在する場合には媒体上のブロックアドレス87b、その他属性H88bとしてページイン中、ページアウト中の状態表示や共用プログラムのデータ領域であることの表示などを保持する。
【0056】
以上のようなテーブルを使用して如何に動作するかをフローチャートを用いて説明する。
図9はテキスト部実体管理情報の構築フローチャートである。
【0057】
テキスト部実体管理情報構築手段251は上記したようにプログラム配置手段212から起動され、テキスト部実体管理テーブル253にテキスト部の実体に関する情報を記録するものであり、その動作を説明する。
【0058】
ステップS91では情報を記入する空行を探す。ステップS92では、上記空行に与えられた情報として配置するプログラムのテキスト部の実体管理情報を図4のように設定する。
【0059】
ステップS93では図4の44に記入したテキスト部の仮想領域の大きさに対応したページテーブルの領域を獲得してページテーブルを構築する。ページテーブルには実体情報を設定する。プログラムのテキスト部が配置されたときは最初は二次記憶上に存在するのでエントリ1には実ページが存在しないとしてブランクとし、エントリ2にはプログラム配置手段212から受け取ったテキスト部の格納ブロックアドレスを記録する。
【0060】
ステップS95においてはセグメントテーブルに、構築したページテーブルのアドレスを設定する。
図10にはテキスト部実体管理情報の回収フローチャートを示す。
【0061】
ステップS1ではテキスト部実体管理テーブル253をプログラムIDで検索して対応の記入行をさがす。
ステップS2で図4の仮想領域アドレス43のセグメント番号からセグメントテーブルにあるページテーブルアドレスを得て、ステップS3でセグメントテーブルの標識を無効としてページテーブルが無いことを示し、ステップS4ではページテーブルの領域を返却する。ステップS5でテキスト部実体管理テーブル253の1行を空きに戻す。
【0062】
図11にはデータ部実体管理情報の構築フローチャート(その1)を示す。
データ部実体管理情報構築手段254がプログラム配置手段212から起動された場合の動作を示す。
【0063】
ステップS101で図6の実行体管理テーブルのポインタを先頭に設定する。ステップS102で図5のデータ部実体管理テーブル256のポインタを空行の先頭に設定する。
【0064】
ステップS103でデータ部実体管理テーブル256にプログラムID、仮想空間IDなどの情報を設定する。ステップS104ではポインタで示される実行体管理テーブルの実行体ID用の実体管理用仮想領域をデータ部仮想領域の大きさ54と同じ仮想領域を獲得し、ステップS105で実体管理用仮想領域アドレス57に設定する。
【0065】
ステップS106でデータ部の領域の大きさ54に対応したページテーブルの領域を獲得し、ステップS107でエントリを初期値として二次記憶上に実体があるように設定する。
【0066】
ステップS108では実体管理用仮想領域のセグメント番号に対応してセグメントテーブルにページテーブルアドレスを設定する。
ステップS109で、図6の実行体管理テーブルのポインタが示す実行体IDをデータ部実体管理テーブルの56に設定する。
【0067】
ステップS110で全ての実行体について処理終了したかを確認する。まだ終了していないときはステップS111で実行体管理テーブルのポインタを進め、データ部実体管理テーブルのポインタを次の空行に進めてステップS103からくり返す。
【0068】
図12には実行体生成手段221から起動されたときのデータ部実体管理情報構築手段の動作のフローチャートを示してある。
ステップS201において図3のプログラム管理テーブル211についてポインタを先頭に設定し、データ部実体管理テーブル256のポインタを空行の先頭に設定する。
【0069】
ステップS202では図3のプログラム管理テーブル211のポインタが示すプログラムについてプログラム管理テーブル211の情報をデータ部実体管理テーブル256に仮想空間ID、仮想領域アドレス、仮想領域の大きさをコピーする。
【0070】
ステップS203は実行体生成手段221から受けた生成する実行体IDを実行体ID56に設定する。
ステップS204では上記実行体IDに対応して実体管理用仮想領域を確保し、ステップS205で実体管理用仮想アドレス57に設定する。
【0071】
ステップS206ではデータ部の領域の大きさに対応したページテーブルを構築して、ステップS207でエントリの初期値を記入する。実体の初期値は二次記憶にあると設定する。
【0072】
ステップS208においてセグメントテーブルに上記確保した実体管理用仮想領域のセグメント番号に対応して構築したページテーブルのアドレスを設定する。
【0073】
ステップS209ではプログラム管理テーブルに存在するすべてのプログラムについて処理が終了したかを確認する。終了ではないときはポインタを進めステップS202から次のプログラムについて情報を構築する。
【0074】
図13はデータ部実体管理情報の回収フローチャート(その1)である。データ部実体管理情報回収手段255はプログラム回収手段213および実行体回収手段222から起動されるが、(その1)ではプログラム回収手段213から起動される場合の動作を説明する。
【0075】
ステップS31では呼出元から回収すべきプログラムのIDを得る。ステップS32でデータ実体管理テーブル256の先頭にポインタを設定する。
ステップS33で図5のデータ部実体管理テーブル256におけるポインタの示す行のプログラムID51が上記プログラムIDと同じかを調べる。回収すべきプログラムIDであればステップS34で図5における57が示す実体管理用仮想領域アドレスのセグメント番号の指し示すページテーブルの領域を返却し、ステップS35で上記実体管理用仮想領域を返却する。
【0076】
ステップS36とステップS37ですべての行についてデータ部実体管理テーブルのプログラムIDを調べるようにしている。
図14のデータ部実体管理情報の回収フローチャート(その2)ではデータ部実体管理情報回収手段255が実行体回収手段222から起動されたときの動作を示している。
【0077】
ステップS41で呼出元から指定された回収する実行体のIDを得る。ステップS42でデータ部実体管理テーブル256の先頭にポインタを設定する。
ステップS43でポインタの示す実行体IDが上記IDと一致するかを調べ、回収するものであるときはステップS44で実体管理用仮想領域を返却、ステップS45でページテーブルの領域を返却している。ステップS46とステップS47でデータ部実体管理テーブルの全行についての処理を行うように繰り返しを指定している。
【0078】
図15はデータ部実体切替手段のフローチャートを示している。
データ部実体切替手段257は実行体切替手段231が実行体を切り替えるときに同期して起動される。呼び出し元からの情報としてステップS51で新たに切り替える実行体のIDを得る。ステップS52でポインタをデータ部実体管理テーブル256の先頭に位置づける。
【0079】
ステップS53でポインタの示す行の実行体ID56が新たに切り替わるIDと一致するものかを調べる。実行体IDが一致したときにはステップS54で、その行にある実体管理用仮想領域アドレス57で示される領域はプログラムID51で示されるプログラムが新たな実行体で使用するデータ部の実体に対応するものであるのでこれをプログラムがアクセスするようにするために、実体管理用仮想領域アドレス57が示すアドレスのセグメント番号からセグメントテーブルにあるページテーブルのアドレスを得て、データ部の仮想領域アドレス53の示すセグメント番号に対応するページテーブルアドレスを書き替える。
【0080】
ステップS55、ステップS56で以上の処理をデータ部実体管理テーブル256に存在する全行について実行するようにしている。
図16にはページングインタフェース手段のフローチャートを示す。
【0081】
ページングインタフェース手段258は共用するプログラムのデータ部の実体に対してページングが発生することを検出したページ制御部240が起動するものである。
【0082】
ステップS61でインタフェース条件としてデータ部仮想領域アドレスと実行体IDを得る。ステップS62でポインタをデータ部実体管理テーブル256の先頭行に設定する。
【0083】
ステップS63とステップS64で上記インタフェース条件が合うものかどうかを調べる。すなわち、データ部仮想領域アドレス53と実行体ID56について両方が一致する場合ポインタが示す実体管理用仮想領域アドレス57をページング対象アドレスとして呼出元のページング制御部240に返す。
【0084】
【発明の効果】
以上の説明から明らかなように本発明によれば、仮想記憶を使用したコンピュータにおいて並行して実行される共通の処理内容の情報処理を、仮想空間に配置した共通のプログラムを共用することが実現でき、特に大規模な処理を多数同時に実行させるようなオンライン処理、通信処理などに関して、より大量に処理することができるようになり、経済性の向上、処理能力の向上、という著しい工業的効果がある。
【図面の簡単な説明】
【図1】 本発明の原理説明図
【図2】 本発明の実施の形態の構成図
【図3】 プログラム管理テーブルの説明図
【図4】 テキスト部実体管理テーブルの説明図
【図5】 データ部実体管理テーブルの説明図
【図6】 実行体管理テーブルの説明図
【図7】 セグメントテーブルとページテーブルの構成の説明図
【図8】 ページテーブルエントリの説明図
【図9】 テキスト部実体管理情報の構築フローチャート
【図10】 テキスト部実体管理情報の回収フローチャート
【図11】 データ部実体管理情報の構築フローチャート(その1)
【図12】 データ部実体管理情報の構築フローチャート(その2)
【図13】 データ部実体管理情報の回収フローチャート(その1)
【図14】 データ部実体管理情報の回収フローチャート(その2)
【図15】 データ部実体切替手段のフローチャート
【図16】 ページングインタフェース手段のフローチャート
【符号の説明】
1s、1a、1b、1c 実行体
2s、2a 共用プログラムテキスト部
3 共用プログラムデータ部
4 仮想空間
5 実行体切替手段
6 データ部実体切替手段
7a、7b、7c 実体の所在を保持するテーブル
8a、8b、8c 二次記憶上のデータ部の実体
9a、9b、9c 一次記憶上のデータ部の実体
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a program sharing system in the same virtual space in a virtual storage system computer that associates a main memory and a virtual memory by an address translation mechanism.
[0002]
[Prior art]
First, the terminology used in the description of the present invention will be introduced while explaining the program execution environment in the virtual storage system.
[Program execution (execution body generation and program allocation)]
When the operating system is requested to execute a process such as inputting a command from a terminal and executes a new executable program (an object program, hereinafter simply referred to as a program), the operating system includes the virtual space and the virtual space. An environment for operating a program in a space (called a task, a thread, etc., hereinafter referred to as an execution body) is created, and a program to be run in the execution body is placed in the virtual space (the program is Placement means that a program existing in the program library on the secondary storage is made accessible by a virtual address in the virtual space), and an entry point existing in the arranged program (calling the program) When the control is passed to the command position) Operating a gram.
[Placement of program in virtual space]
When executing a process by calling another program from a certain program in a certain execution body, there are roughly two methods for arranging these programs. One is to create a virtual space and place all necessary programs before passing control to the entry point of the program. The other is that when creating a virtual space, only the program with the entry point to which the operating system passes control is placed, and the program to be called is placed when another program is called while the program is running. Is the method.
[Dynamic linker]
In both of the above methods, when calling from one program to another program, a function to search to which program control is transferred (when a program that is not allocated is accessed, which dynamically allocates the program) This is detected and the operating system searches the program library (this function is usually called a dynamic linker).
[0003]
In the case of the former arrangement method, since all the programs are arranged, this function searches for a necessary entry point from among the programs already arranged in the virtual space, and passes control.
[0004]
In the case of the latter arrangement method described above, a necessary entry point is searched from a program already arranged in the virtual space, and control is passed if the entry point exists. A program having a necessary entry point is searched from programs existing in a library on the next storage, the found program is arranged in the virtual space, and control is passed to the entry point.
[Program placement in a multitasking (multithreaded) environment]
In an environment in which a plurality of execution bodies run in one virtual space (so-called multitask environment or multithread environment), there are the following two methods for arranging a program in the virtual space.
[0005]
One is a method in which when a certain program runs on a plurality of execution bodies existing in the same virtual space, the program is arranged in the virtual space by the number of the execution bodies. The other is a method in which only one program is arranged in the virtual space and shared even when a certain program runs on a plurality of execution bodies existing in the same virtual space.
[0006]
Usually, the former method is adopted in the case of a program that updates variables (external variables, etc.) that retain information in the program. This is because when the latter is adopted, the data values performed in the program are destroyed between the execution bodies, and the data values cannot be guaranteed for each execution body.
[0007]
[Problems to be solved by the invention]
A program can be broadly divided into a part in which an instruction code or the like is stored (hereinafter referred to as a text part) and a part in which data such as a variable is stored (hereinafter referred to as a data part).
[0008]
In general, the entry point of a program exists in a text part as in the ELF format adopted in UNIX or the like. In this type of program, control is transferred from the operating system to an entry point existing in the text portion, and an instruction code existing in the text portion is executed. At this time, in the operating instruction code, a variable or the like existing in the data part is referred to or updated.
[0009]
For this reason, in the case of a program in which the entry point exists in the text part as described above, the relative positional relationship (called offset) between the position of the instruction code and the position where the variable is stored executes the program. It must be determined when it is possible (ie when linking). After linking, that is, when an executable is created, when a program is placed, when control is passed to a program, etc., it cannot be changed dynamically (that is, in the program every time triggered by the above scene) (This means that all existing positional information must be changed).
[0010]
To run a program of the above type in an environment where multiple execution bodies run in a single virtual space (so-called multitasking environment or multithreading environment), the necessary programs must be executed It is necessary to arrange in the virtual space. In other words, when a certain program runs on a plurality of execution bodies existing in the same virtual space, the program must be arranged in the virtual space by the number of execution bodies.
[0011]
This is because if only one program is placed in the virtual space and this program is run by multiple execution bodies, the values of data to be referenced and updated in this program are destroyed between the execution bodies, and the data This is because the value of cannot be guaranteed for each execution body.
[0012]
For this reason, when a program of the above format is run in an environment where a plurality of execution bodies run, a virtual space area that can be used for arranging a plurality of the same programs for each of the plurality of execution bodies in the virtual space. You will be pressured.
[0013]
In this way, in order to benefit from the improvement in hardware performance, the above-mentioned virtuality can be improved even when the multiplicity of programs to be run (that is, the number of execution bodies) is increased and processing is performed in parallel. There was a problem that it could not be realized due to compression of the area in the space.
[0014]
In view of these points, the present invention arranges only one program having the entry point in the text in the same virtual space, and is shared by a plurality of execution bodies in the virtual space. Thus, an object of the present invention is to provide means for preventing the virtual area in the virtual space from being compressed.
[0015]
[Means for Solving the Problems]
The above-described problem is solved by a program sharing apparatus configured as follows.
[0016]
FIG. 1 is an explanatory diagram of the principle of the present invention.
A text part 2s of the shared program and a data part 3 of the shared program statically linked to the text part 2s are arranged in the virtual space 4,
An environment for executing the shared program in the virtual space 4, that is, a shared apparatus for programs having one or more execution bodies 1s such as 1a, 1b, 1c... 2a is the execution bodies 1a, 1b, 1c. The DRA 9a, DRB 9b, and DRC 9c represent entities on the primary storage for the execution bodies 1a, 1b, and 1c corresponding to the data part 3 of the shared program. DFA 8a, DFB 8b, and DFC 8c represent secondary storage entities for the execution bodies 1a, 1b, and 1c corresponding to the data portion 3 of the shared program.
[0017]
The PTA 7a, PTB 7b, and PTC 7c are tables that hold the location of the entity such as whether the entity of the data portion 3 of the shared program is in primary storage or secondary storage for each of the execution bodies 1a, 1b, and 1c. The data unit entity management table is associated with each other (not shown).
[0018]
The execution body switching means 5 switches the execution bodies 1a, 1b, and 1c on which the shared program operates. The data part entity switching means 6 synchronizes with the execution body switching means 5 to locate the entity of the data part 3 The tables PTA7a, PTB7b, and PTC7c that hold the data are switched.
[0019]
When the text part 2s of the shared program and the data part 3 of the shared program statically linked to the text part 2s are arranged and executed in the virtual space 4, the text part 2s of the shared program is an execution environment. The execution bodies 1a, 1b, and 1c exist only as a common text part entity 2a.
[0020]
When the text part 2s accesses the data part 3 of the virtual area to refer to or update, the contents 9a, 9b, 9c on the primary storage or the contents 8a, 8b, 8c on the secondary storage are referred to as the substance of the data part 3 In order to update, address conversion is performed by tables 7a, 7b, and 7c that manage the locations of virtual areas and entities.
[0021]
At this time, the data unit entity switching unit 6 is operated in synchronization with the execution unit switching by the execution unit switching unit 5 so that the entity of the data unit 3 corresponds to the execution units 1a, 1b, and 1c. It is like that.
[0022]
In this way, the text part 2s of the shared program uses the only entity 2a, and the data part 3 uses the entities 9a, 9b, 9c or 8a, 8b, 8c provided for the execution bodies 1a, 1b, 1c. Thus, sharing of programs for performing independent processing for each execution body can be realized.
[0023]
DETAILED DESCRIPTION OF THE INVENTION
FIG. 2 shows a configuration diagram of the embodiment of the present invention.
In a computer system having a virtual storage device, a plurality of execution bodies (multitasking or multithreading) are present, and a text part which is an instruction part of a shared program is the only one common to each execution body in the virtual space. Only one data portion that is referred to when the text portion is executed is apparently arranged in the virtual space.
[0024]
When an instruction in the text part is executed, the virtual address of the data part that is statically linked in the virtual space does not change regardless of which execution object is operating in the data part.
[0025]
However, since the processing contents performed by multiple execution bodies are naturally performed in different environments using different data, the text part that is the command part of the program uses only one entity, but the data part Each execution entity must handle different data entities to obtain different outputs for different inputs.
[0026]
For this purpose, in order to manage the shared program in addition to the normal program management, some means as indicated by a dotted line 250 in FIG. 2 are additionally provided.
[0027]
First, the overall configuration will be described.
Reference numeral 210 denotes a program management unit that manages the arrangement and collection from the program library to the virtual space. The program management table 211 holds information related to program arrangement and collection. The program placement unit 212 makes the program library accessible in a virtual address with a virtual address. That is, loading into the virtual space is performed. As described above, loading of a program is performed every time the program is called, or necessary programs are collectively arranged at once.
[0028]
The program collection means 213 is called when the arranged program does not need to exist in the virtual space, and collects the designated program from the virtual space.
[0029]
Regarding the arrangement and collection of the programs described above, it is essential for the execution body management unit 220, the execution body control unit 230, and the virtual storage device before describing means added to realize sharing of the programs in the embodiment of the present invention. The paging control unit 240 will be described.
[0030]
As described above, the execution body is an environment in which a program operates. Usually, a plurality of execution bodies are set at the same time so that a plurality of programs proceed in parallel in a plurality of environments.
[0031]
The execution body generation means 221 and the execution body collection means 222 create a new execution body and collect the execution body that is no longer needed. That is, when new information processing is performed, it is necessary to prepare an environment for operating the program, and an execution body is generated, and then the program is arranged. The reverse is recovery.
[0032]
The number of execution bodies that can be executed simultaneously is determined by the number of processing devices. The execution body switching means 231 switches which execution body is operated. There are several triggers for switching the execution body. For example, there are an elapsed allocation time, waiting for input / output completion, waiting for exclusive control, and the like.
[0033]
The paging control unit 240 is a mechanism of a virtual storage device in which the entity of virtual storage exists in the primary storage device or the secondary storage, and the primary storage device is used alternately in units of pages as necessary. Page-in request processing means 241 When page-in is requested, a search is made for a free page in page frame units of the primary storage device, and when there is no page-in, a page that is not used is paged out and then page-in is performed. The page-in completion processing unit 243 confirms completion of input / output accompanying page-in. Similarly, the page-out request processing means 242 and the page-out completion processing means 244 also process page-out requests.
[0034]
Next, the adding means 250 for sharing programs will be described.
The text part entity management table 253 holds information related to the entity of the text part. Program identification information, virtual space identification information in which a program is arranged, that is, information used to identify a virtual space of a multiple virtual storage device, a program The virtual address and size of the text part in the arranged virtual space, and the execution object identification information of the execution object that is shared are included.
[0035]
The text part entity management information construction unit 251 is activated by the program placement unit 212, and sets and constructs information in the text part entity management table 253 for the text part of the newly placed program.
[0036]
The text part entity management information collection unit 252 is activated by the program collection unit 213 and collects entity management information of the text part of the designated program.
[0037]
The data part entity management table 256 includes the virtual area of the data part and the address of the entity management virtual area (described later) set for each execution object corresponding to the data part, program identification information, size, and corresponding execution object identification information. It holds information about all combinations of programs and executables.
[0038]
The data unit entity management information construction unit 254 and the data unit entity management information collection unit 255 register and delete information in the data unit entity management table 256.
The data part entity switching unit 257 is activated in synchronization with the execution body switching unit 231 and switches the entity of the data part accessed by the text part.
[0039]
When the above-described page-in / page-out processing occurs, the paging interface unit 258 receives control from the paging control unit 240 if it is understood that the contents are the substance of the shared program in the status display in the page table. Therefore, the target virtual address is adjusted so that the paging I / O operation is normally completed regardless of the switching of the execution body that occurs asynchronously.
[0040]
Next, the configuration of each table will be described with reference to each drawing and FIG. 2 showing the overall configuration.
FIG. 3 is an explanatory diagram of the program management table.
[0041]
As shown in FIG. 3, the program management table 211 includes a program ID (identification number) 31, an allocated virtual space ID 32, an address of the allocated virtual area (segment number, page number, page in the format of SPD). This represents the internal displacement (the same applies hereinafter) 33, the area size 34, and the program configuration 36.
[0042]
FIG. 3 shows a state in which two programs PG1 and PG2 are arranged. The virtual area addresses are 11-0-0 and 13-0-0, respectively, indicating the heads of segment numbers 11 and 13. The size of the area represents 8 KB or 7 KB.
[0043]
FIG. 4 is an explanatory diagram of the text part entity management table.
The format is the same as above, and the text portions of PG1 and PG2 are described. Since the text part is used in common for all execution bodies, there is no execution body ID information, but a list of shared execution body IDs is held in the execution body management table shown in FIG.
[0044]
FIG. 5 is an explanatory diagram of the data unit entity management table.
In addition to the above, a corresponding execution body ID 56 and entity management virtual area address 57 are set as items. A plurality of lines are entered. First, when T01, T02, and T03 are set as execution bodies, the program PG1 is arranged by the program arrangement unit 212, and the information of the first three lines is set. ing. That is, execution bodies T01, T02, and T03 correspond to PG1, and the data portion virtual area address 53 of the program is 4-0-0, indicating the same virtual area address.
[0045]
The entity management virtual area address 57 uses a virtual area having the same size as the data section area of each program in a separate segment. In the above example, they are segments 1, 3, and 14. This entity management virtual area prepares the entity of the data part for each execution body, and when each execution body operates, when the instruction in the text part of the program accesses the area indicated by the virtual area address 53 of the data section, this entity actually The entity corresponding to the area indicated by the management virtual area address 57 is accessed.
[0046]
For the program PG2 arranged second, information is recorded corresponding to the execution bodies T01, T02, and T03 in the next three lines. In such a state, an execution body T04 is newly generated and information on the last two lines is created. That is, for the existing programs PG 1 and PG 2, an entity management virtual area is secured for the execution body T 04 and recorded as segments 8 and 9.
[0047]
As described above, information is generated for all combinations of the programs PG1 and PG2 and the execution bodies T01, T02, T03, and T04.
FIG. 6 is an explanatory diagram of the execution body management table.
[0048]
One table is set for each virtual space ID 61, and the information of the number 62 of execution bodies currently set and the list 63 of execution body IDs is held. This is necessary, for example, when it is necessary to construct information in the data unit entity management table 256 for all the execution bodies existing when a program is newly arranged.
[0049]
FIG. 7 is an explanatory diagram of the structure of the segment table and the page table.
The segment table shown in (a) shows the starting point address from the preceding table 71. Corresponding to the segment number 72, the address 73 of the page table shown in (c), (d) is shown. The relationship between the segment table and the page table is indicated by arrows 79a and 79b for the execution bodies T01 and T02 whose program ID 51 is PG1 shown in the data unit entity management table 256 of FIG.
[0050]
The data part virtual area address 53 of PG1 is 4-0-0, and the segment number of the area is 4. The entity management virtual area address 57 has a program ID of PG1, an execution body ID of 1-0-0 with respect to T01, and a segment number of 1. Further, the entity management virtual area address 57 corresponding to T02 is 3-0-0 and the segment number is 3.
[0051]
The page table address 73z shown in the segment number 4 of the segment table in FIG. 7A originally points to the page table 74 by 79z, but the original page table 74 is made to share the program. Instead, the data unit entity switching means 257 operates in synchronization with the execution body switching means 231, and 73z corresponds to the segment number 1 as shown in FIG. 7 (c) or corresponds to the segment number 3 as shown in FIG. 7 (d). An address indicating the virtual area page table for entity management is written. Thus, the pointer from 73z becomes 78a or 78b.
[0052]
As described above, the page table indicating the substance of the data part is switched by rewriting the pointer of the page table corresponding to the segment number of the data part of the segment table.
[0053]
FIG. 8 is an explanatory diagram of a page table entry.
(A) and (b) show the relationship between the segment table and the page table. The page consists of two entries and is arranged at a fixed interval, here a distance of 100 addresses in hexadecimal. Entry 1 stores hardware related information, and entry 2 stores software related information. Information on the existence location of the entity is determined based on both entry 1 and entry 2 information.
[0054]
Specifically, as shown in FIG. 4C, entry 1 includes information 86a on whether or not there is a real page on the primary storage corresponding to the virtual page, and if it exists, page address 87a of the real page and others. As the information, the attribute H88a holds the status of access right, reference, and update.
[0055]
In entry 2 of (d), information 86b indicating whether or not the entity exists in the secondary storage and, if present, the block address 87b on the medium and the status display during page-in and page-out as other attribute H88b And an indication that it is a data area of a shared program.
[0056]
How to operate using the above table will be described with reference to a flowchart.
FIG. 9 is a construction flowchart of the text part entity management information.
[0057]
The text part entity management information construction unit 251 is activated from the program placement unit 212 as described above, and records information related to the entity of the text part in the text part entity management table 253. The operation will be described.
[0058]
In step S91, a blank line for entering information is searched. In step S92, the entity management information in the text portion of the program to be arranged as the information given to the blank line is set as shown in FIG.
[0059]
In step S93, a page table area corresponding to the size of the virtual area of the text part entered in 44 of FIG. 4 is acquired to construct the page table. Entity information is set in the page table. When the text part of the program is arranged, it initially exists in the secondary storage, so that entry 1 is blanked because there is no real page, and entry 2 has a storage block address of the text part received from program placement means 212. Record.
[0060]
In step S95, the address of the constructed page table is set in the segment table.
FIG. 10 shows a recovery flowchart of the text part entity management information.
[0061]
In step S1, the text part entity management table 253 is searched for the program ID to find the corresponding entry line.
In step S2, the page table address in the segment table is obtained from the segment number of the virtual area address 43 in FIG. 4, and in step S3, the segment table indicator is invalidated to indicate that there is no page table. To return. In step S5, one line of the text part entity management table 253 is returned to empty.
[0062]
FIG. 11 shows a construction flow chart (No. 1) of data unit entity management information.
The operation when the data unit entity management information construction unit 254 is activated from the program placement unit 212 will be described.
[0063]
In step S101, the pointer of the execution body management table of FIG. 6 is set to the head. In step S102, the pointer of the data unit entity management table 256 of FIG. 5 is set to the head of the blank line.
[0064]
In step S103, information such as a program ID and a virtual space ID is set in the data unit entity management table 256. In step S104, an entity management virtual area for the execution body ID in the execution body management table indicated by the pointer is acquired as a virtual area having the same size as the data part virtual area 54, and in step S105, the entity management virtual area address 57 is set. Set.
[0065]
In step S106, an area of the page table corresponding to the size 54 of the area of the data portion is acquired, and in step S107, an entry is set as an initial value so as to exist in the secondary storage.
[0066]
In step S108, a page table address is set in the segment table corresponding to the segment number of the entity management virtual area.
In step S109, the execution body ID indicated by the pointer of the execution body management table in FIG.
[0067]
In step S110, it is confirmed whether the processing has been completed for all the execution bodies. If not finished yet, the pointer of the execution body management table is advanced in step S111, the pointer of the data unit entity management table is advanced to the next blank line, and the process is repeated from step S103.
[0068]
FIG. 12 shows a flowchart of the operation of the data unit entity management information construction unit when it is activated from the executable object generation unit 221.
In step S201, the pointer is set to the head of the program management table 211 of FIG. 3, and the pointer of the data unit entity management table 256 is set to the head of the blank line.
[0069]
In step S202, the virtual space ID, the virtual area address, and the size of the virtual area are copied to the data entity management table 256 for the program indicated by the pointer in the program management table 211 of FIG.
[0070]
In step S203, the execution object ID generated from the execution object generation means 221 is set to the execution object ID 56.
In step S204, an entity management virtual area is secured corresponding to the execution body ID, and in step S205, the entity management virtual address 57 is set.
[0071]
In step S206, a page table corresponding to the size of the area of the data part is constructed, and in step S207, the initial value of the entry is entered. The initial value of the entity is set to be in secondary storage.
[0072]
In step S208, the address of the page table constructed corresponding to the segment number of the reserved physical management virtual area is set in the segment table.
[0073]
In step S209, it is confirmed whether or not the processing has been completed for all programs existing in the program management table. If not, the pointer is advanced and information about the next program is constructed from step S202.
[0074]
FIG. 13 is a collection flowchart (part 1) of data unit entity management information. The data unit entity management information collection unit 255 is activated from the program collection unit 213 and the execution body collection unit 222. (Part 1) describes the operation when activated from the program collection unit 213.
[0075]
In step S31, the ID of the program to be collected is obtained from the caller. In step S32, a pointer is set at the head of the data entity management table 256.
In step S33, it is checked whether the program ID 51 in the line indicated by the pointer in the data unit entity management table 256 in FIG. 5 is the same as the program ID. If it is the program ID to be collected, the page table area indicated by the segment number of the entity management virtual area address 57 shown in FIG. 5 is returned in step S34, and the entity management virtual area is returned in step S35.
[0076]
In step S36 and step S37, the program ID of the data unit entity management table is checked for all rows.
The data part entity management information collection flowchart (part 2) in FIG. 14 shows the operation when the data part entity management information collection unit 255 is activated by the execution body collection unit 222.
[0077]
In step S41, the ID of the execution object to be collected designated from the caller is obtained. In step S42, a pointer is set at the head of the data entity management table 256.
In step S43, it is checked whether the execution object ID indicated by the pointer matches the ID. If the execution object ID is to be collected, the entity management virtual area is returned in step S44, and the page table area is returned in step S45. In step S46 and step S47, repetition is designated so as to perform processing for all rows in the data unit entity management table.
[0078]
FIG. 15 shows a flowchart of the data part entity switching means.
The data part entity switching unit 257 is activated in synchronization with the execution body switching unit 231 when switching the execution body. In step S51, the ID of the execution body to be newly switched is obtained as information from the caller. In step S52, the pointer is positioned at the head of the data unit entity management table 256.
[0079]
In step S53, it is checked whether or not the execution body ID 56 in the line indicated by the pointer matches the ID to be newly switched. When the execution object IDs match, in step S54, the area indicated by the entity management virtual area address 57 in the row corresponds to the substance of the data part used by the program indicated by the program ID 51 in the new execution object. Therefore, in order to allow the program to access this, the address of the page table in the segment table is obtained from the segment number of the address indicated by the entity management virtual area address 57, and the segment indicated by the virtual area address 53 of the data section is obtained. Rewrite the page table address corresponding to the number.
[0080]
In steps S55 and S56, the above processing is executed for all rows existing in the data unit entity management table 256.
FIG. 16 shows a flowchart of the paging interface means.
[0081]
The paging interface unit 258 is activated by the page control unit 240 that detects the occurrence of paging on the substance of the data portion of the shared program.
[0082]
In step S61, a data part virtual area address and an execution body ID are obtained as interface conditions. In step S62, the pointer is set to the first line of the data unit entity management table 256.
[0083]
In step S63 and step S64, it is checked whether or not the interface condition is met. That is, when both the data part virtual area address 53 and the execution object ID 56 match, the entity management virtual area address 57 indicated by the pointer is returned to the paging control unit 240 of the caller as a paging target address.
[0084]
【The invention's effect】
As is apparent from the above description, according to the present invention, it is possible to share information of common processing contents executed in parallel in a computer using virtual memory with a common program arranged in a virtual space. In particular, online processing, communication processing, etc. that allow a large number of large-scale processing to be executed simultaneously can be processed in a larger amount, and there is a remarkable industrial effect of improving economy and processing capacity. is there.
[Brief description of the drawings]
FIG. 1 illustrates the principle of the present invention
FIG. 2 is a configuration diagram of an embodiment of the present invention.
FIG. 3 is an explanatory diagram of a program management table.
FIG. 4 is an explanatory diagram of a text part entity management table.
FIG. 5 is an explanatory diagram of a data unit entity management table.
FIG. 6 is an explanatory diagram of an execution body management table.
FIG. 7 is an explanatory diagram of the configuration of a segment table and a page table
FIG. 8 is an explanatory diagram of a page table entry.
FIG. 9 is a construction flowchart of text part entity management information.
FIG. 10 is a collection flowchart of text part entity management information.
FIG. 11 is a flowchart of construction of data unit entity management information (part 1).
FIG. 12 is a construction flowchart of data part entity management information (part 2).
FIG. 13 is a flowchart of data part entity management information collection (part 1).
FIG. 14 is a flowchart of data part entity management information collection (part 2).
FIG. 15 is a flowchart of data part entity switching means.
FIG. 16 is a flowchart of paging interface means.
[Explanation of symbols]
1s, 1a, 1b, 1c execution body
2s, 2a Shared program text part
3 Shared program data section
4 Virtual space
5 Executable body switching means
6 Data part entity switching means
7a, 7b, 7c Tables that store the locations of entities
8a, 8b, 8c Data section on secondary storage
9a, 9b, 9c Data section on primary storage

Claims (3)

共用プログラムのテキスト部と、上記テキスト部と静的にリンクされた上記共用プログラムのデータ部とを仮想記憶空間内に配置し、上記仮想記憶空間内で上記共用プログラムを実行する環境である実行体を1以上有するプログラムの共用装置であって、
上記共用プログラムのデータ部に対応する上記実行体毎の一次記憶上あるいは二次記憶上の仮想記憶の内容である実体に関する情報を保持するデータ部実体管理テーブルと、
上記仮想記憶空間内に新たな共用プログラムを配置するとき、上記データ部実体管理テーブルに上記仮想記憶空間内に存在する実行体毎にデータ部実体管理情報を構築し、また、上記仮想記憶空間内に新たに実行体を生成するとき、上記仮想記憶空間に配置されている共用プログラムのデータ部に対応する上記実行体のデータ部実体管理情報を構築するデータ部実体管理情報構築手段と、
上記共用プログラムが動作する実行体切り替えに同期して上記データ部実体管理テーブルの示す上記実行体のデータ部実体管理情報に基づいて実体を切り替えるデータ部実体切替手段と、
を備えることを特徴とするプログラムの共用装置。
And text portion of the shared program, and a data portion of the text portion and statically linked the shared program placed in a virtual memory space, running body is an environment for executing the shared program by the virtual memory space A shared apparatus for programs having one or more of the following:
A data part entity management table that holds information about entities that are the contents of virtual storage on primary storage or secondary storage for each execution body corresponding to the data part of the shared program;
When a new shared program is arranged in the virtual storage space, data unit entity management information is constructed for each execution body existing in the virtual storage space in the data unit entity management table, and in the virtual storage space A data part entity management information constructing means for constructing the data part entity management information of the execution object corresponding to the data part of the shared program arranged in the virtual storage space,
A data unit entities switching means for switching entity based on the data portion entity management information of the executable units indicated by the data portion entity management table in synchronism with the switch between the different executing entity which the shared program operates,
An apparatus for sharing a program, comprising:
ページングを制御するページング制御部が、共用プログラムのデータ部の実体に対するページイン要求あるいはページアウト要求を検出したとき、When the paging control unit that controls paging detects a page-in request or a page-out request for the entity of the data part of the shared program,
上記共用プログラムのデータ部のデータ部実体管理情報をページング制御部に通知するページングインターフェース手段を備えることを特徴とする請求項1記載のプログラムの共用装置。  2. The program sharing apparatus according to claim 1, further comprising paging interface means for notifying the paging control unit of data part entity management information of the data part of the shared program.
共用プログラムのテキスト部と、上記テキスト部と静的にリンクされた上記共用プログラムのデータ部とを仮想記憶空間内に配置し、上記仮想記憶空間内で上記共用プログラムを実行する環境である実行体を1以上有する計算機システムにおけるプログラムの共用方法であって、
上記共用プログラムのデータ部に対応する上記実行体毎の一次記憶上あるいは二次記憶上の仮想記憶の内容である実体に関する情報を保持するデータ部実体管理テーブルを設け、
上記仮想記憶空間内に新たな共用プログラムを配置するとき、上記データ部実体管理テーブルに上記仮想記憶空間内に存在する実行体毎にデータ部実体管理情報を構築するステップと、
上記仮想空間内に新たに実行体を生成するとき、上記仮想記憶空間に配置されている共用プログラムのデータ部に対応する上記実行体のデータ部実体管理情報を構築するステップと、
上記共用プログラムが動作する実行体の切り替えに同期して上記データ実体管理テーブルの示す上記実行体のデータ部実体管理情報に基づいて実体を切り替えるステップと、
を有するプログラムの共用方法。
An executable that is an environment in which a text part of a shared program and a data part of the shared program statically linked to the text part are arranged in a virtual storage space and the shared program is executed in the virtual storage space A program sharing method in a computer system having one or more of:
A data unit entity management table is provided for holding information on entities that are the contents of virtual storage on primary storage or secondary storage for each execution body corresponding to the data portion of the shared program,
When arranging a new shared program in the virtual storage space, building data unit entity management information for each execution body existing in the virtual storage space in the data unit entity management table;
When creating a new execution body in the virtual space, constructing data portion entity management information of the execution body corresponding to the data portion of the shared program arranged in the virtual storage space;
A step of switching entities based on the data unit entity management information of the execution unit indicated by the data unit entity management table in synchronization with switching of the executing unit on which the shared program operates ;
Method of sharing programs that have a.
JP18421295A 1995-07-20 1995-07-20 Program sharing device and method Expired - Fee Related JP3644078B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP18421295A JP3644078B2 (en) 1995-07-20 1995-07-20 Program sharing device and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP18421295A JP3644078B2 (en) 1995-07-20 1995-07-20 Program sharing device and method

Publications (2)

Publication Number Publication Date
JPH0934790A JPH0934790A (en) 1997-02-07
JP3644078B2 true JP3644078B2 (en) 2005-04-27

Family

ID=16149334

Family Applications (1)

Application Number Title Priority Date Filing Date
JP18421295A Expired - Fee Related JP3644078B2 (en) 1995-07-20 1995-07-20 Program sharing device and method

Country Status (1)

Country Link
JP (1) JP3644078B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4331325B2 (en) * 1999-06-08 2009-09-16 パナソニック株式会社 Memory management device

Also Published As

Publication number Publication date
JPH0934790A (en) 1997-02-07

Similar Documents

Publication Publication Date Title
JP2856620B2 (en) Memory management method and apparatus in computer system
US5301288A (en) Virtual memory management and allocation arrangement for digital data processing system
US6442568B1 (en) Customer information control system application programming interface with transient data functions, in a loosely coupled data processing environment
US6115738A (en) Input/output device information management method and apparatus for multi-computers
JPH05225065A (en) Logical map of data object using data space
JPH11505653A (en) Operating system for use with protection domains in a single address space
JP2870582B2 (en) Hypermedia document management device
JP3644078B2 (en) Program sharing device and method
JPH07200217A (en) Method and system for display of data as well as execution method of data
JPH04219844A (en) High-speed medium preferential release type exclusive system
JPS5818708B2 (en) Method and apparatus for storing and accessing information in a shared access multi-program data processing system
JPH02212949A (en) Reorganization processing system for data base in on-line operation
JPS6349945A (en) Process roll-in system for data processor
JP3456727B2 (en) Data processing device
JPH0337748A (en) External storage accessing system utilizing main storage
JP3060481B2 (en) Segment roll-in / roll-out method
JPH0253150A (en) Check system for memory allotment value
JP3543330B2 (en) Database system
JPH064273A (en) Data processor
JP3514524B2 (en) Network monitoring equipment
JPH1097562A (en) Design support system
JPS62241047A (en) Shared control method for input/output buffer by data base control system
JPS6246016B2 (en)
JPH02115958A (en) Data transfer control system
JPH0581221A (en) Device for supporting parallel program development

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20040219

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040302

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040423

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: 20050111

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050124

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: 20080210

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20090210

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20090210

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20100210

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20110210

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20110210

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20120210

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees