home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / cplus / 15904 < prev    next >
Encoding:
Internet Message Format  |  1992-11-08  |  1.8 KB

  1. Path: sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!spool.mu.edu!agate!netsys!news!lsi!mhost!cl301!ameesh
  2. From: ameesh@lsil.com (Ameesh Desai)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Linked Lists in Shared Memory:
  5. Message-ID: <1992Nov6.185024.14778@lsil.com>
  6. Date: 6 Nov 92 18:50:24 GMT
  7. References: <1992Nov5.090303.17760@ermes.enea.se>
  8. Sender: news@lsil.com (news caster)
  9. Reply-To: ameesh@lsil.com
  10. Organization: LSI Logic Corporation
  11. Lines: 44
  12. Nntp-Posting-Host: cl301
  13.  
  14. In article 17760@ermes.enea.se, eny@ermes.enea.se (Erik Nykvist) writes:
  15.  
  16. [stuff deleted]
  17.  
  18. >
  19. >I have used a technique based on the new-operator with placement-syntax.
  20. >If we have objects that can only be accessed by one process at the time it
  21. >is possible to adjust the this-pointer using this operator.
  22. >
  23. >As long as the constructor used doesn't mutate the data members the affect of
  24. >using this operator is only adjustment of the vtbl-pointer.
  25. >
  26.  
  27. [ stuff deleted ]
  28.  
  29. >// We also use the placement syntax to allocate the shared object.
  30. >=========
  31. >PROCESS 1
  32. >=========
  33. >{
  34. >    Shared* sp = new (shared_mem) Shared;
  35. >    Lock lock(*sp);
  36. >    // Adjust vtbl
  37. >    new (shared_mem) Shared(IN_SHARED_MEMORY);
  38.  
  39.  
  40. I am confused ... do you plan to allow creation of the object in one process and
  41. its access in another. If so I am not sure what effect the above new statement
  42. has - how does it fix the vtbl ? How does it effect the 'this' ptr - which 'this' ?
  43.  
  44. [stuff deleted]
  45. >
  46. >Erik Nyquist, ENEA DATA AB,     erny@enea.se
  47. >                eny@ermes.enea.se
  48.  
  49.  
  50. Ameesh
  51.  
  52. ---
  53. ______________________________     o__            
  54. | _   /|     Ameesh Desai     \    ,>/_                              
  55. | \`O.o'     LSI Logic Corp.   \__(_)`(_)_              email: ameesh@lsil.com
  56. | =(_|_)=    MS E192, 1501 McCarthy Blvd. \             fax  : (408) 433-6802
  57. |____U_______Milpitas, CA 95035____________\____________voice: (408) 433-4097 
  58.