[comp.sys.apollo] Apollo: C++ and Shared Memory

ashley@cheops.eecs.unsw.oz (Ashley M. Aitken) (04/15/89)

G'Day,

In the C++ newsgroup Tom  Mueller brought up the question of  C++
objects  and shared memory. Objects with pointer elements, either
explicitly as data objects or implicitly  as  virtual  funcitons,
will  not  function properly when accessed by different processes
in shared memory because the shared memory will most  likely  not
be attached at the same point in two different processes. Also if
one object in shared memory points to an implementation  function
in  the  address space of one process, then another process which
tries to use that object will not be able to access the implemen-
tation function.

Basically, are C++ and Shared Memory compatible or can they be 
made compatible?

Are there any know ways around these problems?

I thought of using a common installed library (using "inlib")  to
hold  all the common object implementation code. Then the objects
would all point to the common code in the library.  However  this
also  relies  on  the installed library being located at the same
spot in the address space of all  shells  (and  their  processes)
which have that library installed.

How does one use (ie compile with ccxx and load) user installed 
libraries ?

Are  user  installed  libraries  a  work-around  some  of  shared
memories  incompatibilities  with  objects  in C++. Of course in-
stalled libraries can not stop the use of pointers  from  outside
shared  memory directly into shared memory (rather than an offset
from the base of shared memory) but if we could get virtual func-
tions that would be half the battle.

If you have any ideas how to get around these problems (especial-
ly  how  to  use the inlib facility if it will be of some help) I
would be most grateful if you could please e-mail me at  the  ad-
dress  given  below. If there is enough interest I will summarize
to the net.

Thanks in Advance,
Cheers,
Ashley Aitken.

E-MAIL  ashley@cheops.unsw.oz					   ACSnet
	ashley%cheops.unsw.oz@uunet.uu.net			   ARPAnet
	ashley@cheops.unsw.oz.au				   ARPAnet
	{uunet,ukc,ubc-vision,mcvax}!munnari!cheops.unsw.oz!ashley UUCP	
	ashley%cheops.unsw.oz@australia				   CSnet
	ashley%cheops.unsw.oz@uk.ac.ukc				   JAnet

	Computer Science Department, EECS,
	University of New South Wales,