home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / cplus / 19886 < prev    next >
Encoding:
Internet Message Format  |  1993-01-25  |  2.0 KB

  1. Path: sparky!uunet!vnet.ibm.com
  2. From: jimi@vnet.ibm.com (Jim Meyers)
  3. Message-ID: <19930125.151753.177@almaden.ibm.com>
  4. Date: Mon, 25 Jan 93 18:15:06 EST
  5. Newsgroups: comp.lang.c++
  6. Subject: Re: Shared Memory Objects
  7. Lines: 36
  8.  
  9. In <1993Jan25.105459.4799@hellgate.utah.edu> clark%asylum.cs.utah.edu@cs.utah.edu (Charles Clark) writes:
  10. >
  11. >Straying from the orignal subject a little, how can the location of the
  12. >shared memory segments be coordinated?  The vtable location is fixed at
  13. >link edit time, thus one would know then whether there is a conflict.
  14. >Since the creation and attachment of the shared memory segment is at run-
  15. >time, how can one ensure that the vm address of each of the cooperating
  16. >processes will be available?
  17. >
  18. >       --Charles
  19.  
  20. This is an implementation-dependent problem. An easy way to do this
  21. (in AIX) is to place all shared objects (and their vtables) in a single shared
  22. library. AIX ensures that all processes accessing the shared library will
  23. load the shared library code at the same virtual address. Thus, the location
  24. of the vtables is consistent. To ensure that the virtual addresses of
  25. shared objects is consistent, the process which instantiates the objects can
  26. send the address to the clients. The clients can control the virtual address
  27. of the shared memory segment via shmat(), and control the virtual address
  28. of their "local" the shared memory objects via the new operator's placement
  29. syntax.
  30.  
  31. Again, this is for AIX. This solution can also be implemented in OS/2 by
  32. placing shared memory code (and vtables) in a DLL. Jordan describes Cfront-
  33. dependent solutions for both SunOS and System V.
  34.  
  35. --Jim
  36.  
  37. -------------------------------------------------------------------------
  38. Jim Meyers                           | Voice:    919-543-5999
  39. IBM Networking Systems               | Fax:      919-543-1286
  40. LAN Systems Workstation Technology   |
  41. Research Triangle Park, NC 27709     | Internet: jimi@vnet.ibm.com
  42. -------------------------------------------------------------------------
  43.  
  44.  
  45.