Reading David Bacon's Unified Theory of Garbage Collection
I found him mentioning that modern GCs are an hybrid of tracing and reference counting ones:
Given the similarity in structure that we discovered between tracing
and reference counting, we began to re-examine various collector
architectures to understand the interplay between these styles of
collection. We observed that all realistic garbage collectors are in
fact some form of hybrid of tracing and reference counting. This
explains why an optimized “tracing collector” and an optimized
“reference counting collector” become more and more similar: because
they are in fact taking on characteristics of each other.
We observed that all realistic garbage collectors are in
fact some form of hybrid of tracing and reference counting.
Tracing and reference counting are uniformly viewed as being
fundamentally different approaches to garbage collection that possess
very distinct performance properties. We have implemented
highperformance collectors of both types, and in the process observed
that the more we optimized them, the more similarly they behaved —
that they seem to share some deep structure.
Reference counting is a form of garbage collection whereby each object
has a count of the number of references to it. Garbage is identified
by having a reference count of zero. An object's reference count is
incremented when a reference to it is created, and decremented when a
reference is destroyed. When the count reaches zero, the object's
memory is reclaimed.
How modern C++ (11/14/17) compare to this statements?
There's no comparison. C++ never had, and does not have, any kind of automatic garbage collection of no longer referenced objects.
Is this true about modern C++?
No, it's not true. C++ does not have garbage collection.
Some people could argue that C++ has no GC,
There's no argument there. It's a fact. You will not find any kind of a description of any kind of a garbage collection implementation in the 1400+ pages of techical specifications that define the current C++ standard. It's not there. I looked.
C++ has no tracing GC, but ARC is an approach to GC as it's stated on the paper:
You are certainly free to come up with your own implementation of garbage collection, for your own classes, in C++. But that wouldn't make that a part of the language itself.
std::shared_ptr, et. al., is not garbage collection, even though it's reference counted. Hint: circular references.
what's the advantage of having increment/decrement as atomic operations on C++?
They, much less everything else in C++, has no inherit "advantage" of its own. This is like asking "what is the advance of having a car". For some people, owning a car makes their life easier. For others, it gives no benefit at all.
Similarly, atomic reference counting has advantages in specific use cases. For others it offers no advantages at all.
The correct question here would be "what are the advantages of having atomic increment/decrement versus [some alternative] in [a specific use case]".