Re: Lock-free reference counting



On Fri, 28 Nov 2008 20:52:25 +0000, Jon Harrop <jon@xxxxxxxxxxxxxxxxx>
wrote:

Stephen Howe <sjhoweATdialDOTpipexDOTcom> wrote:
On Tue, 25 Nov 2008 01:02:41 +0000, Jon Harrop <jon@xxxxxxxxxxxxxxxxx>
wrote:
Juha Nieminen wrote:
Jon Harrop wrote:
Yes, of course. The cost is in repeatedly incrementing and decrementing
counts during the lifetime of the reference-counted value. Nothing to
do with initializing it.

Oh, so now it does *not* have anything to do with touching random
locations in memory, unlike you claimed earlier. Now it's only related
to the increments and decrements of the counter.

Which are scattered across memory.

That depends on whether the counters are intrusive or extrusive.

If they are instrusive, then that is not so.

If you're saying that the counter is alongside the value itself then that is
incorrect because reference counts get bumped even when the value itself is
not touched.

You said, "Which are scattered across memory."
I am pointing out that the counters are _NOT_ scattered in memory if
the reference counters are instrusive, the reference counters are
adjacent in memory to the object they count.
Your statemet is likely to be true for extrusive counters.

As to your last statement, that is only true if the object is passed
by value, it is not true if passed by reference or as a pointer, the
reference counts are _NEVER_ bumped.

You seem to remarkably cavaliar with your statements, they are not
qualified.

Stephen Howe
.



Relevant Pages

  • Re: Lock-free reference counting
    ... adjacent in memory to the object they count. ... thoughout memory, but in every case, their counters are adjacent. ... Even swapping a pair of reference counted smart pointers in an array over ...
    (comp.programming)
  • Re: Problem with enumitem and hyperref
    ... it sets my counters to 0. ... LaTeX Warning: Reference `ans:0.0' on page 0 undefined on input line ... reference is taken to a question by referencing a label ... do not create hyperlinks. ...
    (comp.text.tex)
  • Re: Lock-free reference counting
    ... the counters are _NOT_ scattered in memory... ... adjacent in memory to the object they count. ... reference counts are _NEVER_ bumped. ... "Reference counting is frequently chosen as an automatic memory management ...
    (comp.programming)
  • Re: Should weak counted reference be able to be strengthened?
    ... deallocating the object when the strong reference counter reaches ... and freeing the counters when the total counter reaches zero -- as ... if each weak reference was a strong reference to the counters. ...
    (comp.lang.ada)
  • Re: Lock-free reference counting
    ... the counters are _NOT_ scattered in memory... ... adjacent in memory to the object they count. ... reference counts are _NEVER_ bumped. ... explicitly mutate counters is right before I hand a pointer to an object ...
    (comp.programming)