3 ms·
You're off in the weeds. A refcount can be incremented/decremented with a simple atomic compare-and-swap, and that's exactly what most refcounting systems do.
by teacup50 13y ago
You're off in the weeds. A refcount can be incremented/decremented with a simple atomic compare-and-swap, and that's exactly what most refcounting systems do.
It's not free, but it's damn close to it.
- herokusaki 13y agoIf that is the case then why doesn't Python do it? I mean this as a real question; I genuinely don't know.
- teacup50 13y agoBecause it was designed and written poorly, and its thread-safety issues extend far beyond refcounting.