home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / std / cplus / 1887 < prev    next >
Encoding:
Internet Message Format  |  1992-12-22  |  3.2 KB

  1. Path: sparky!uunet!enterpoop.mit.edu!eru.mt.luth.se!hagbard!loglule!jbn
  2. From: jbn@lulea.trab.se (Johan Bengtsson)
  3. Newsgroups: comp.std.c++
  4. Subject: Re: Zero-length structures and pointer comparisons
  5. Message-ID: <5458@holden.lulea.trab.se>
  6. Date: 21 Dec 92 19:30:51 GMT
  7. References: <9235622.25587@mulga.cs.mu.OZ.AU>
  8. Organization: Telia Research AB, Aurorum 6, 951 75 Lulea, Sweden
  9. Lines: 56
  10. Cc: jbn
  11. X-Newsreader: TIN [version 1.1 + PL8]
  12.  
  13. Fergus James HENDERSON (fjh@munta.cs.mu.OZ.AU) wrote:
  14. : jbn@lulea.trab.se (Johan Bengtsson) writes:
  15.  
  16. : >Markku Sakkinen (sakkinen@jyu.fi) wrote:
  17. : >: BTW, actually total order is
  18. : >: a simple thing within an OODB _because_ the identity of each object
  19. : >: is assured not to change.
  20. : >
  21. : >It would impose severe restrictions on how the virtual address space
  22. : >could be used though.  The OODBMS may end up in a situation where
  23. : >it can't get a persistent object into memory, not because it has used up
  24. : >all virtual memory addresses, but because all unused virtual memory
  25. : >adresses would violate the total ordering property.
  26.  
  27. : I thought that the idea was that for OODBMSs, you DON'T compare virtual
  28. : addresses for pointers to persistent objects, instead you compare the object
  29. : ids. Maybe someone could explain the problems in a little more detail?
  30.  
  31. As Stuart MacMartin said, if the OODBMs uses objects of class Handle
  32. (never mind the name) to represent references to persistent objects
  33. you will need to have
  34.  
  35. ptrcmp(Handle,Handle), if you want templates to compare Handles the
  36. same way they compare pointers.  The OODBMs should provide that.
  37. Also it should provide ptrcmp(Handle,void*) and ptrcmp(void*,Handle).
  38.  
  39. _Some_ OODBMs use void* as their Handles (they play tricks by
  40. using virtual memory mapping to persistent storage), so they must
  41. provide a ptrcmp(void*,void*) that can tell the difference between
  42. pointers to persistent objects and normal memory pointers.  For persistent
  43. objects, it then finds the object ids and makes the comparison.
  44.  
  45. My point is that this may be difficult, or slow (although I don't
  46. really have any data on that).  The alternative is to simply compare
  47. the void pointers, even for pointers to persistent objects, however
  48. that imposes the unacceptable restrictions I described in my previous
  49. posting.
  50.  
  51. A more difficult issue is what do you do if there is more than one
  52. OODBMs in use, or more realistically, one OODBM, and one distributed
  53. object manager (that similarly uses Handles to distributable objects).
  54. Who is responsible for providing the needed ptrcmp(OODB_Handle,Distr_Handle)
  55. and ptrcmp(Distr_Handle,OODB_Handle) functions?  This may become
  56. totally unmanageable if handle-based schemes become common.
  57.  
  58. Hope this is a little bit clearer.
  59.  
  60. --------------------------------------------------------------------------
  61. | Johan Bengtsson, Telia Research AB, Aurorum 6, S-951 75 Lulea, Sweden  |
  62. | Johan.Bengtsson@lulea.trab.se; Voice:(+46)92075471; Fax:(+46)92075490  |
  63. --------------------------------------------------------------------------
  64. -- 
  65. --------------------------------------------------------------------------
  66. | Johan Bengtsson, Telia Research AB, Aurorum 6, S-951 75 Lulea, Sweden  |
  67. | Johan.Bengtsson@lulea.trab.se; Voice:(+46)92075471; Fax:(+46)92075490  |
  68. --------------------------------------------------------------------------
  69.