3 ms·
Great paper! Especially useful when talking to C++ fanatics who are proud of their language's de-facto reference counting via 'smart pointers'.
by eru 9y ago
Great paper! Especially useful when talking to C++ fanatics who are proud of their language's de-facto reference counting via 'smart pointers'.
- todd8 9y agoPython uses reference counting with a backup garbage collector just to pick up unreachable sets of object having circular references.
- __s 9y agoPython is slow & CPython is ever slower because reference counting is part of what makes removing the GIL such a challenge
- dfox 9y agoThe hard part of removing GIL are the language semantics themselves. Replacing CPython's reference counting with some kind of tracing GC will still leave you with problem of coming up with low-overhead thread-safe dictionary implementation.
- hyperpape 9y agoI agree with the first sentence. For the second part, what are you thinking of? For reads, there's very low overhead for using an implementation like Java's ConcurrentHashMap. The overhead for insertions is more significant, but not enormous.
- johncolanduoni 9y ago> reference counting is part of what makes removing the GIL such a challenge Interesting, I would have expected that switching reference counting to atomic operations would be pretty trivial. What about CPython's design complicates this?
- gpderetta 9y agoPretty trivial. Also pretty expensive.
- jgh 9y agoOther languages use reference counting too. I don't really see how that applies to a discussion on a paper about GC. Edit: my bad, they literally mention reference counting in the first sentence. Leaving this here because I should read the link before the comments.
- hamstergene 9y agoThis is exactly why I insist on using the wording "automatic memory management" instead of "garbage collection". When you say AMM, it's clear and intuitive: it means an object's lifetime is not really under programmer's control, but is up to some automatically working algorithm/mechanism. But if you say GC to mean not tracing GC, half of audience is doomed to misunderstand you.
- pjmlp 9y agoThat is more common among those that only did C -> C++ transition, without any experience in other languages with automatic memory management, though. If you check Herb Sutter's talk about "deferred pointers", he goes to great lengths to only speak the forbidden word towards the end, to avoid loosing the audience. He also presents a few examples where RC can lead to long pauses or even stack overflow, in the presence of deeply nested data structures.
- Rexxar 9y ago<insert language> fanatics != good coders