home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / cplus / 12411 < prev    next >
Encoding:
Text File  |  1992-08-16  |  2.3 KB  |  51 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: <1992Aug16.081316.27729@mole-end.matawan.nj.us>
  6. Summary: Who is in charge ...
  7. Organization: :
  8. References: <1992Aug14.164719.9719@wuecl.wustl.edu> <BRISTER.92Aug14170213@tirade.decwrl.dec.com>
  9. Date: Sun, 16 Aug 1992 08:13:16 GMT
  10. Lines: 39
  11.  
  12. In article <BRISTER.92Aug14170213@tirade.decwrl.dec.com>, brister@decwrl.dec.com (James Brister) writes:
  13. > On 15 Aug 92 03:22:08 GMT, tmb@arolla.idiap.ch (Thomas M. Breuel) said:
  14. > > In article <BRISTER.92Aug14110706@tirade.decwrl.dec.com> brister@decwrl.dec.com (James Brister) writes:
  15.  
  16. > > Using reference counting to get reference semantics on parameter
  17. > > passing is very confusing indeed (sadly, this bad idea seems to
  18. > > pervade the C++ literature).
  19.  
  20. > Perhaps if it's so pervasive then it's not such a bad idea.
  21.  
  22. > parameter passing was only a simple example, there are lots of cases where
  23. > multiple objects need to keep track of a piece of data, and unless you're
  24. > very sure about who is supposed to delete the data and when (non-trivial
  25. > when the system gets complex), you can get yourself into a lot of trouble.
  26. > Reference counting can save the day.
  27.  
  28. This is really the problem.  There exist many data structures (representation
  29. schemes) which deal with values that have to be stored in objects, but that
  30. don't provide for management of the objects.
  31.  
  32. One possibility, at least of some of them, is to make the management of
  33. the space a function of the `data structure.'  You may have some extra
  34. objects laying around, but they won't get lost, and there is at least an
  35. object (the interface object for the data structure as a whole) whose
  36. lifetime bounds the lifetime of the objects `within.'
  37.  
  38. These value-is-the-only-thing-of-interest data structures (representation
  39. schemes) are precisely those for which GC is needed and for which it is
  40. well-suited.
  41.  
  42. Meta-discussion:  This seems to me so awfully obvious that it hurts to
  43. write it every few months, yet it hasn't been refuted (at least not to
  44. my satisfaction), nor have the conclusions which seem to me obvious been
  45. accepted.  What am I not seeing?
  46. -- 
  47.  (This man's opinions are his own.)
  48.  From mole-end                Mark Terribile
  49.  
  50.  mat@mole-end.matawan.nj.us, Somewhere in Matawan, NJ
  51.