4 ms·
Reference counting can also lead to big cascades of objects being freed, which can make it impractical in realtime context as well. This makes RC useless for sy
by BlackFingolfin 9y ago
Reference counting can also lead to big cascades of objects being freed, which can make it impractical in realtime context as well. This makes RC useless for systems which have hard constraints here (e.g. automotive).
And of course, once you are multi-threaded, you can more or less forget about "predictable and deterministic" with RC, too.
In contrast, there are real time capable garbage collectors.
- SolarNet 9y agoEhhh, except that rust's borrowing system is a really great aid to prevent those sorts of things. And, one can easily make a thread responsible for deallocating the cascading objects. The point being that reference counting allows one more control over how deallocation is done. Besides, the real time capable garbage collectors are basically just backed in implementations of exactly that. With reference counting, it can be written in the language itself, rather than as a tunable external part of the implementation, which is useful.