home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / cplus / 12614 < prev    next >
Encoding:
Text File  |  1992-08-19  |  3.7 KB  |  88 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!mole-end!mat
  3. From: mat@mole-end.matawan.nj.us
  4. Subject: Re: Reference counting for vectors, (Tony Hansen's book).
  5. Message-ID: <1992Aug19.175300.12772@mole-end.matawan.nj.us>
  6. Summary: Backwards of Backwards, Representation .vs. Representee
  7. Organization: :
  8. References: <1992Aug14.164719.9719@wuecl.wustl.edu> <TMB.92Aug17173218@arolla.idiap.ch>
  9. Date: Wed, 19 Aug 1992 17:53:00 GMT
  10. Lines: 76
  11.  
  12. In article <TMB.92Aug17173218@arolla.idiap.ch>, tmb@arolla.idiap.ch (Thomas M. Breuel) writes:
  13. > mat@mole-end.matawan.nj.us writes:
  14.  
  15. >    These value-is-the-only-thing-of-interest data structures (representation
  16. >    schemes) are precisely those for which GC is needed and for which it is
  17. >    well-suited.
  18.  
  19. > Also, you got it backwards. The need for true GC arises precisely when
  20. > object identies (pointers, addresses, aliasing) matter. If only the
  21. > value of an object matters, you can avoid the need for garbage
  22. > collection trivially via copying or reference counting on assignment
  23. > and initialization (although a real garbage collector is empirically
  24. > still more efficient in most cases).
  25.  
  26. You are confusing representation with the thing represented.  What you
  27. write is true of the objects-in-memory that represent the values.  But
  28. when you look at the values that represent real-world entities, it's
  29. the other way around.
  30.  
  31. GC-demanding algorithms are needed when
  32.  
  33.     1)    your space (or set, or domain) of Values-Representing-The-World
  34.     is large (nearly infinite, or large enough not to be easily
  35.     representable in the space represented by a couple of machine
  36.     words), and
  37.  
  38.     2)    it's impossible to relate the lifetime over which a given
  39.     value is needed to the lifetime of a single object (not Object)
  40.     in the algorithms used, and
  41.  
  42.     3)    one copy of the representation-of-value is indistinguishable
  43.     from another and carries no information about the things to
  44.     which it is related
  45.  
  46. Property (1) means that fixed-length identifiers (integers, strings,
  47. etc.) cannot be used.  (In fact, the value may be represented implicitly
  48. by a composite of the data that it identifies--that is, we don't name
  49. or store the value, but only the things that it maps to.)
  50.  
  51. Property (2) means that the value representation cannot be part of any
  52. of the objects-in-memory that use it, nor part nor managed by of any of
  53. the Objects that use it.
  54.  
  55. Property (3) means that there need be no single identity that represents
  56. the value, but that the value can be represented as often as needed by
  57. an object-in-memory identity, which may be the identity of a data structure
  58. (or `information structure', or `objects-and-relationships') that contains
  59. the information which the value identifies.  A value representation can
  60. be created and destroyed as needed.
  61.  
  62. I'm afraid that the text above is excruciating to paw your way through.
  63. It becomes quite a bit clearer if you draw _and understand_ the `pure'
  64. E-R diagrams for the information in a problem whose algorithms demand GC.
  65. (`Pure' in that there is no distinction between attributes and anything
  66. else; they are all entities, and all the cardinalities are described.)
  67.  
  68. I suggest that any discussion as to the meaning of the above be carried
  69. out on e-mail.  Any refutation, of course, can take place here.  But
  70. please be specific, and be prepared to have your work inspected by
  71. E-R model.
  72.  
  73.         Always start by drawing a free-body diagram.
  74.             --Prof. Milton Stecher (in Physics 101 lecture).
  75.  
  76.         Draw your free-body diagram!
  77.             --Prof. Milton Stecher (in consultation).
  78.  
  79.         You didn't draw your free-body diagram, did you?
  80.             --Prof. Milton Stecher (in Physics 101 recitation).
  81.  
  82. Yes, I think that an E-R understanding can tell us that much!
  83. -- 
  84.  (This man's opinions are his own.)
  85.  From mole-end                Mark Terribile
  86.  
  87.  mat@mole-end.matawan.nj.us, Somewhere in Matawan, NJ
  88.