by titzer · 9y ago · 0 comments
And of course reference counting pauses. Killing one object (its count dropping to zero) may cause a chain reaction of objects whose reference counts to drop to zero and need to be cleaned up. The difference is that you now suffer work proportional to the _dead_ data of the program. In comparison, a tracing GC does work proportional to the _live_ objects.
Is this not just a matter of using an atomic reference count?
> maddeningly and frightenly hard to do efficiently.
It definitely doesn't seem maddening or frightening. I'm not saying a GC isn't stricly better (because I'm unsure either way) but arc doesn't seem like some awful thing.
That chain is trivial to interrupt and resume later. Compare that to interrupting any mark based GC.