CPython without a global interpreter lock
CPython without a global interpreter lock
Posted Aug 11, 2023 15:30 UTC (Fri) by Karellen (subscriber, #67644)In reply to: CPython without a global interpreter lock by alkbyby
Parent article: CPython without a global interpreter lock
Posted Aug 11, 2023 16:10 UTC (Fri)
by alkbyby (subscriber, #61687)
[Link]
So, IMHO refcounting was and is wrong choice (for python-like use cases; e.g. kernel-space is a different matter).
(Not so) fun fact: gcc's libstdc++ still has this horrible "optimization" where shared_ptr bits detect at runtime if multi-threading is active inlined at ~every place share_ptr is copied. And compiler adds this run-time check and both single-threaded and multi-thread "atomic-ful" refcounting codes everywhere! Quick godbolt proof: https://godbolt.org/z/o9b9hxfMP
Of course this is me cherry-picking one annoying arguably performance bug in gcc. But imho it adds nicely to the topic of: "no, refcounting is not anywhere as straightforward as people tend to think".
CPython without a global interpreter lock