News for hackers. Stuff that matters.
Re:The Garbage Collection Handbook, 2nd Edition by vlovich123 on Sunday April 09, 2023 @01:26PM (#35504685)
Only for atomics. Single-threaded RC counts are fine and WebKit uses hybrid RC where you use an atomic shared ptr to share across threads and then you downgrade it to a non atomic version in-thread (and can hand out another atomic copy at any time).

Atomics are rarely needed as you should really try to avoid sharing ownership across threads and instead change your design to avoid that if you can.

Re:The Garbage Collection Handbook, 2nd Edition by _a_a_a_ on Monday April 10, 2023 @05:36AM (#35510599)
>> If you write to cache, then depending on architecture that change has to be made visible to every other thread as well

> Only for atomics

I don't think cache coherency is aware of threads; they live at a level above it (IANAExpert though)

> where you use an atomic shared ptr to share across threads and then you downgrade it to a non atomic version in-thread (and can hand out another atomic copy at any time).

your idea of GC is very different from others', you are happy to do a ton of manual stuff. GC is generally about not doing a ton of manual stuff.