JPH10320203A - Shared memory system - Google Patents

Shared memory system

Info

Publication number
JPH10320203A
JPH10320203A JP13152597A JP13152597A JPH10320203A JP H10320203 A JPH10320203 A JP H10320203A JP 13152597 A JP13152597 A JP 13152597A JP 13152597 A JP13152597 A JP 13152597A JP H10320203 A JPH10320203 A JP H10320203A
Authority
JP
Japan
Prior art keywords
virtual function
shared
address
class
pointer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP13152597A
Other languages
Japanese (ja)
Inventor
Takanori Hayashi
孝則 林
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.)
Meidensha Corp
Meidensha Electric Manufacturing Co Ltd
Original Assignee
Meidensha Corp
Meidensha Electric Manufacturing Co 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 Meidensha Corp, Meidensha Electric Manufacturing Co Ltd filed Critical Meidensha Corp
Priority to JP13152597A priority Critical patent/JPH10320203A/en
Publication of JPH10320203A publication Critical patent/JPH10320203A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To enable the use of virtual function without damaging the shared function of real memory while unnecessitating reference structure and address calculation with a pointer by fixing the address of virtual function table. SOLUTION: In a shared memory system in which plural application processes share the object of class having the virtual function of object oriented system, the addresses of processes 1 and 2 in the virtual function table are made equal in all the programs sharing the object. Therefore, the class for preparing the shared object while having the virtual function is prepared as a shared library fixing its load address. Thus, it is not necessary to use any special data structure for preparing a reference relation, and pointer calculation for access is unnecessitated. Further, a page on the real memory can be shared between processes and efficiency in the utilization of real memory is improved.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、オブジェクト指向
システムのオブジェクトのような複雑な参照関係を持つ
データを共有するための共有メモリシステムに係り、特
に仮想関数を持つクラスのオブジェクトを共有するため
の共有メモリシステムに関する。
[0001] 1. Field of the Invention [0002] The present invention relates to a shared memory system for sharing data having a complicated reference relationship such as an object of an object-oriented system, and more particularly to a shared memory system for sharing an object of a class having a virtual function. Related to a shared memory system.

【0002】[0002]

【従来の技術】オブジェクト指向システムでは、複雑な
参照関係をもつオブジェクト構造を協調して働く複数の
プロセスから同時に参照・更新できることが求められ
る。
2. Description of the Related Art In an object-oriented system, it is required that an object structure having a complicated reference relationship can be simultaneously referenced and updated by a plurality of processes working in cooperation.

【0003】現在、このような共有オブジェクトは市販
のオブジェクト指向データベース管理システム(0bj
ect 0riented Data Base Ma
nagement System,OODBMS)を使
って実現されている。
[0003] Currently, such a shared object is a commercially available object-oriented database management system (0bj).
ect Oriented Data Base Ma
This is realized by using N.Nagement System (OODBMS).

【0004】オブジェクトの参照関係は、単純にはC+
+言語のポインタを用いて実現できる。しかし、市販の
OODBMSでは、図4に示すように、特別な参照構造
(レファレンス)を作って参照関係をアプリケーション
プロセスのアドレス空間から独立させている。
[0004] Object reference relation is simply C +
+ It can be realized by using a language pointer. However, in a commercially available OODBMS, as shown in FIG. 4, a special reference structure (reference) is created to make the reference relationship independent of the address space of the application process.

【0005】この方法ではCPUのアドレス空間を超え
る大きなオブジェクト構造を作れるなどのメリットもあ
るが、内部的には参照をたどるたびにポインタを計算す
るような形になるのでオーバーヘッドが大きい。また、
使い慣れたポインタの代わりにOODBM特有のレファ
レンスを使用するのでコードが書きにくい問題もある。
Although this method has the advantage that a large object structure exceeding the address space of the CPU can be created, the overhead is large since a pointer is internally calculated every time a reference is followed. Also,
Since OODBM-specific references are used instead of familiar pointers, there is also a problem that code is difficult to write.

【0006】上記の欠点を補うため、参照構造を言語機
能に隠してポインタ同様に扱えるようにし、さらにOS
の仮想記憶機構を利用してポインタ計算をぺ一ジ(仮想
記憶の入れ替え単位)ごとに一括して行うようにしてい
るものもある(例:0bjectStore(T
M))。
In order to compensate for the above drawbacks, the reference structure is hidden in a language function so that it can be handled like a pointer.
In some cases, the pointer calculation is performed collectively for each page (virtual storage replacement unit) using the virtual storage mechanism (for example, 0objectStore (T
M)).

【0007】この場合は、図5に示すように、べ一ジの
ロード(実メモリへの読み込み)時にだけポインタ計算
が行われるのでアクセスごとに計算するよりは効率がよ
い。
In this case, as shown in FIG. 5, since the pointer calculation is performed only at the time of loading the page (reading into the real memory), the efficiency is higher than the calculation for each access.

【0008】現状のシステムでは、参照へのアクセスご
と、あるいはべ一ジのロードごとにポインタ計算が必要
で参照関係を利用するためのオーバーへッドが大きい。
頻繁に参無関係を追うシステムや性能を要求されるリア
ルタイムシステムではこのオーバーヘッドは無視できな
い。
In the current system, pointer calculation is required for each access to a reference or each time a page is loaded, and the overhead for utilizing a reference relationship is large.
This overhead cannot be neglected in systems that frequently follow unrelated or real-time systems that require performance.

【0009】また、ページごとにポインタ計算をする方
法では、実メモリ上に存在するページの内容はプロセス
ごとにポインタ値が異なるものになるため、実メモリ上
のページ実体をプロセス間で共有するこどができず、実
メモリの利用効率が悪い。
In the method of calculating the pointer for each page, the contents of the page existing in the real memory have different pointer values for each process. Therefore, the page entity in the real memory is shared between the processes. And the efficiency of using real memory is poor.

【0010】これらの事情から、複数のアプリケーショ
ンプロセスから共有メモリのデータを参照するにおい
て、共有メモリをマッピングするアドレスを固定とし、
各アプリケーションプロセスによるデータの参照をポイ
ンタ値で行う共有オブジェクトシステムがある。
[0010] From these circumstances, when referring to data in the shared memory from a plurality of application processes, the address to which the shared memory is mapped is fixed.
There is a shared object system in which each application process refers to data using a pointer value.

【0011】このシステムでは、図6に示すように、プ
ロセス1及びプロセス2がディスクで示す共有メモリ3
のオブジェクトデータを共有するのに、固定アドレスで
参照できる。こうすることで、オブジェクトはすべての
プロセスから同じアドレスに見え、参照関係を単なるポ
インタで構築することができる。これにより、 (1)参照関係を作るのに特別なデータ構造(レファレ
ンス)を使う必要がなくなる。
In this system, as shown in FIG. 6, a process 1 and a process 2 are executed by a shared memory 3 indicated by a disk.
Can be referenced by a fixed address to share object data. In this way, the object appears to all processes to the same address, and the reference relationship can be constructed with a simple pointer. As a result, (1) there is no need to use a special data structure (reference) to create a reference relationship.

【0012】(2)アクセスのためにポインタ計算をす
る必要がなくなる。
(2) It is not necessary to perform pointer calculation for access.

【0013】(3)実メモリ上のべ一ジをプロセス間で
共有でき、実メモリの利用効率が良くなる。
(3) The page on the real memory can be shared between processes, and the utilization efficiency of the real memory is improved.

【0014】[0014]

【発明が解決しようとする課題】従来の固定アドレスに
よる参照を行う共有メモリシステムでは、下記の事情に
より、仮想関数を持つクラスのオブジェクトを共有する
場合に不都合がある。
In the conventional shared memory system for performing a reference using a fixed address, there is an inconvenience when sharing an object of a class having a virtual function due to the following circumstances.

【0015】C++の仮想関数は、基底クラスのメソッ
ド(仮想関数)を導出クラスで再定義(オーバライド)
している場合に、導出クラスのオブジェクトを参照する
基底クラスのポインタからメソッドを呼出したとき、導
出クラスで再定義した関数が呼出されるようにする機能
である。
The virtual function of C ++ redefines (overrides) a method (virtual function) of the base class with a derived class.
In this case, when a method is called from a pointer of a base class that refers to an object of a derived class, a function redefined in the derived class is called.

【0016】これを実現するために、コンパイラは仮想
関数を持つクラスのオブジェクトに(プログラマから)
隠れた変数を用意し、オブジェクトの所属クラスを識別
する情報を保持する。この情報は、通常、クラスの仮想
関数テーブル(仮想関数エントリを記述した配列)への
ポインタであり、クラスのコンストラクタ(構築子)の
中で正しく初期化される。そして、仮想関数呼出しは、
図7に示すように、aの参照→ポインタ*aの参照→隠
れた変数による仮想関数テーブルの参照→仮想関数のイ
ンデックス参照により、その仮想関数エントリへのジャ
ンプと、仮想関数実体へのジャンプになる二重ジャンプ
として実装される。
To achieve this, the compiler converts (from a programmer) an object of a class with virtual functions.
Prepare hidden variables and hold information that identifies the class to which the object belongs. This information is usually a pointer to the class's virtual function table (an array describing the virtual function entries), and is correctly initialized in the class's constructor. And the virtual function call is
As shown in FIG. 7, reference to a → reference of pointer * a → reference of virtual function table by hidden variable → reference of virtual function index, jump to the virtual function entry and jump to the virtual function entity Implemented as a double jump.

【0017】問題は、仮想関数テーブルのアドレスが各
プログラムによって異なるという点にある。この関係
は、図8に示し、あるプログラムで生成されたオブジェ
クトのクラス情報は、他のプログラムから見ると実際の
仮想関数テーブルとは全く無関係のところを指すポイン
タに見える可能性がある。その結果は、システムダウン
から一見正常に見える動作まで何が起きてもおかしくな
い。したがって、共有オブジェクトに対して仮想関数は
全く使えないことになる。
The problem is that the address of the virtual function table is different for each program. This relationship is shown in FIG. 8, where the class information of an object generated by a certain program may look like a pointer pointing to a place completely unrelated to the actual virtual function table when viewed from another program. The result is that whatever happens, from system down to seemingly normal operation. Therefore, virtual functions cannot be used for shared objects at all.

【0018】本発明の目的は、仮想関数を持った共有オ
ブジェクトを保存すること及び共有オブジェクトからの
仮想関数の呼出しも可能にした共有メモリシステムを提
供することにある。
An object of the present invention is to provide a shared memory system in which a shared object having a virtual function is stored and a virtual function can be called from the shared object.

【0019】[0019]

【課題を解決するための手段】本発明は、仮想関数テー
ブルのアドレスを固定することで共有オブジェクトの仮
想関数を使用可能にするもので、以下の構成を特徴とす
る。
According to the present invention, a virtual function of a shared object can be used by fixing an address of a virtual function table, and has the following features.

【0020】オブジェクト指向システムの仮想関数を持
つクラスのオブジェクトを複数のアプリケーションプロ
セスが共有する共有メモリシステムにおいて、前記仮想
関数を持つクラスのオブジェクトを参照するための前記
各アプリケーションプロセスの仮想関数テーブルのアド
レス空間を同じにしたことを特徴とする。
In a shared memory system in which a plurality of application processes share an object of a class having a virtual function of an object-oriented system, an address of a virtual function table of each application process for referring to an object of a class having the virtual function It is characterized by having the same space.

【0021】また、前記共有オブジェクトのクラスを固
定アドレスの共有ライブラリで作成することにより各プ
ロセスのアドレス空間を同じにすることを特徴とする。
Further, the class of the shared object is created by a shared library having a fixed address so that the address space of each process is the same.

【0022】[0022]

【発明の実施の形態】本発明の実施形態では、図1に示
すように、プロセス1及び2の仮想関数テーブルのアド
レスをオブジェクトを共有するすべてのプログラムで同
じにする。
DESCRIPTION OF THE PREFERRED EMBODIMENTS In the embodiment of the present invention, as shown in FIG. 1, the addresses of the virtual function tables of processes 1 and 2 are the same for all programs sharing an object.

【0023】このためには、図2に示すように、共有オ
ブジェクトを作るクラスで仮想関数を持つものをロード
アドレスを固定にした共有ライブラリとして作成するこ
とで実現される。
As shown in FIG. 2, this is realized by creating a shared object class having a virtual function as a shared library having a fixed load address.

【0024】例えば、WindowsNTのMS−Vi
sual C++環境では、仮想関数を持つクラスをロ
ードアドレスを固定したDLL(DynamicLin
kLibrary)に記述すればよい。DLLは、プロ
ジェクトの設定で、リンク指定に/base:xxxx
xx(xxxxxxは具体的なアドレス)でベースアド
レスを指定し、/fixedでリロケーション(アドレ
ス再配置)を禁止する。
For example, MS-Vi of Windows NT
In the C ++ environment, a class having a virtual function is loaded into a DLL (Dynamic Lin) with a fixed load address.
kLibrary). DLL is specified in the project by specifying the link as / base: xxxx
The base address is specified by xx (xxxxxx is a specific address), and relocation (address relocation) is prohibited by / fixed.

【0025】画面設定での設定方法は、図3に示すよう
にベースアドレスを設定し、リロケーション禁止(/f
ixed)は、画面の設定項目にないため、Commo
nオプションに直接に書込んで設定する。なお、設定対
象になるDebug及びReleaseの両方を選択し
たままでは書込めないため、個別に書込んで設定する。
As a setting method in the screen setting, a base address is set as shown in FIG. 3 and relocation is prohibited (/ f
fixed) is not included in the setting items on the screen.
Write and set directly to the n option. Note that since writing cannot be performed while both the debug target and release to be set are selected, they are individually written and set.

【0026】[0026]

【発明の効果】以上のとおり、本発明によれば、仮想関
数テーブルのアドレスを固定することとしたため、共有
オブジェクトシステムにおけるポインタによる参照構
造、アドレス計算不要、実メモリの共有機能を損なうこ
となく、仮想関数を持った共有オブジェクトを保存する
こと及び共有オブジェクトからの仮想関数の呼出しも可
能になる。
As described above, according to the present invention, since the address of the virtual function table is fixed, the reference structure by the pointer in the shared object system, address calculation is unnecessary, and the function of sharing the real memory is not impaired. It becomes possible to save a shared object having a virtual function and to call a virtual function from the shared object.

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

【図1】本発明の実施形態を示すアドレス一定の仮想関
数テーブル構造。
FIG. 1 is a table showing a virtual function table having a fixed address according to an embodiment of the present invention;

【図2】実施形態における共有ライブラリによるテーブ
ル作成。
FIG. 2 is a table creation by a shared library in the embodiment.

【図3】実施形態におけるDLL設定画面。FIG. 3 is a DLL setting screen according to the embodiment.

【図4】従来のレファレンスによる共有オブジェクトの
参照。
FIG. 4 refers to a shared object by a conventional reference.

【図5】従来のロード時にポインタ計算をする方法。FIG. 5 shows a conventional method of calculating a pointer at the time of loading.

【図6】従来の固定アドレス構造。FIG. 6 shows a conventional fixed address structure.

【図7】仮想関数の呼出しと仮想関数テーブルの説明
図。
FIG. 7 is an explanatory diagram of a virtual function call and a virtual function table.

【図8】仮想関数テーブルのアドレス不明の説明図。FIG. 8 is an explanatory diagram of an unknown address of a virtual function table.

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 オブジェクト指向システムの仮想関数を
持つクラスのオブジェクトを複数のアプリケーションプ
ロセスが共有する共有メモリシステムにおいて、 前記仮想関数を持つクラスのオブジェクトを参照するた
めの前記各アプリケーションプロセスの仮想関数テーブ
ルのアドレス空間を同じにしたことを特徴とする共有メ
モリシステム。
1. In a shared memory system in which a plurality of application processes share an object of a class having a virtual function of an object-oriented system, a virtual function table of each application process for referencing an object of a class having the virtual function. A shared memory system characterized by having the same address space.
【請求項2】 前記共有オブジェクトのクラスを固定ア
ドレスの共有ライブラリで作成することにより各プロセ
スのアドレス空間を同じにしたことを特徴とする請求項
1に記載の共有メモリシステム。
2. The shared memory system according to claim 1, wherein the class of the shared object is created by a shared library having a fixed address so that the address spaces of the respective processes are the same.
JP13152597A 1997-05-22 1997-05-22 Shared memory system Pending JPH10320203A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP13152597A JPH10320203A (en) 1997-05-22 1997-05-22 Shared memory system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP13152597A JPH10320203A (en) 1997-05-22 1997-05-22 Shared memory system

Publications (1)

Publication Number Publication Date
JPH10320203A true JPH10320203A (en) 1998-12-04

Family

ID=15060110

Family Applications (1)

Application Number Title Priority Date Filing Date
JP13152597A Pending JPH10320203A (en) 1997-05-22 1997-05-22 Shared memory system

Country Status (1)

Country Link
JP (1) JPH10320203A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7246135B2 (en) * 2001-01-08 2007-07-17 Intel Corporation Sharing classes between programs
US8495601B2 (en) 2010-06-09 2013-07-23 Lear Corporation Shared memory architecture
US8539472B2 (en) 2010-06-09 2013-09-17 Lear Corporation Method and system of updating shared memory
JP2013542497A (en) * 2010-09-24 2013-11-21 インテル コーポレイション Sharing virtual functions in virtual memory shared among heterogeneous processors of computing platforms
JP2015038770A (en) * 2014-10-23 2015-02-26 インテル コーポレイション Sharing of virtual function in virtual memory shared between heterogeneous processors of calculation platform
JP2016157445A (en) * 2016-03-10 2016-09-01 インテル コーポレイション Sharing virtual functions in virtual memory shared between heterogeneous processors of computing platform

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7246135B2 (en) * 2001-01-08 2007-07-17 Intel Corporation Sharing classes between programs
US8495601B2 (en) 2010-06-09 2013-07-23 Lear Corporation Shared memory architecture
US8539472B2 (en) 2010-06-09 2013-09-17 Lear Corporation Method and system of updating shared memory
US9195576B2 (en) 2010-06-09 2015-11-24 Lear Corporation Shared memory architecture
DE102011007714B4 (en) * 2010-06-09 2019-02-14 Lear Corp. Method for use with a battery monitoring system, battery monitoring system and method of use
JP2013542497A (en) * 2010-09-24 2013-11-21 インテル コーポレイション Sharing virtual functions in virtual memory shared among heterogeneous processors of computing platforms
KR20150006903A (en) * 2010-09-24 2015-01-19 인텔 코오퍼레이션 Sharing virtual functions in a shared virtual memory between heterogeneous processors of a computing platform
US8997113B2 (en) 2010-09-24 2015-03-31 Intel Corporation Sharing virtual functions in a shared virtual memory between heterogeneous processors of a computing platform
KR101534037B1 (en) * 2010-09-24 2015-07-08 인텔 코포레이션 Sharing virtual functions in a shared virtual memory between heterogeneous processors of a computing platform
JP2015038770A (en) * 2014-10-23 2015-02-26 インテル コーポレイション Sharing of virtual function in virtual memory shared between heterogeneous processors of calculation platform
JP2016157445A (en) * 2016-03-10 2016-09-01 インテル コーポレイション Sharing virtual functions in virtual memory shared between heterogeneous processors of computing platform

Similar Documents

Publication Publication Date Title
US5774722A (en) Method for efficient external reference resolution in dynamically linked shared code libraries in single address space operating systems
JP3314378B2 (en) System and method for managing memory allocation for executable programs
US6876996B2 (en) Method and apparatus for using a shared library mechanism to facilitate sharing of metadata
KR100518584B1 (en) Shared library system and method for constructing the system
US5692183A (en) Methods and apparatus for providing transparent persistence in a distributed object operating environment
JP2986075B2 (en) System for combining a local object address and a global object identifier into a single object pointer
US6052528A (en) Process for managing the multiple inheritance of persistent and shared objects
US6397384B1 (en) Run-time addition of interfaces
US5900000A (en) System, method, and computer program product for providing and incremental retrieval adaptor
US7028293B2 (en) Constant return optimization transforming indirect calls to data fetches
US5901314A (en) Method for reducing the size of computer programs
CN112650539A (en) Dynamic link operation supporting method for heterogeneous many-core processor
US5062039A (en) Sharing of workspaces in interactive processing using workspace name tables for linking of workspaces
US5875487A (en) System and method for providing efficient shared memory in a virtual memory system
CN114756296A (en) Read-write mounting starting method and device, storage medium and electronic equipment
JPH10320203A (en) Shared memory system
US20020066084A1 (en) Coalescing properties, methods and events
JPH08202551A (en) Method and mechanism for access on object involving interface heritage
US7246135B2 (en) Sharing classes between programs
KR101140522B1 (en) System and Method for Managing Object
US5805887A (en) Universal pointer object
US6795968B1 (en) Dynamic object behavior for object-oriented-computing environments
JPH1031604A (en) Shared memory system and database system
CN117056031B (en) Cross-container dynamic library sharing method based on virtual process
US20070055644A1 (en) Global dynamic variable storage for SQL procedures

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Effective date: 20050816

Free format text: JAPANESE INTERMEDIATE CODE: A131

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20051213