2 ms·
Yeah, but it's actually deeper than just adding refcounts. The algorithms themselves can change in some cases. The issue is, the hardware can usually only do a
by mike_hearn 4y ago
Yeah, but it's actually deeper than just adding refcounts. The algorithms themselves can change in some cases.
The issue is, the hardware can usually only do atomic/interlocked operations at the word level. If you have a GC then you can atomically update a pointer from one thing to another and not think about the thing that was being pointed to previously: an object becomes unreachable atomically due to the guarantees provided by the GC (either via global pauses or write barriers or both). If you don't have that then you need to both update a pointer and a refcount atomically, which goes beyond what the hardware can easily do without introducing locks, but that in turn creates new problems like needing an ordering.