Here’s a great article on Read-Copy-Update that goes into the magic of Linux sys_membarrier and Windows FlushProcessWriteBuffers for not only lock-free but even atomic-free “highly asymmetric synchronization” as is needed for garbage collectors.
-
Show this thread
-
2 replies 1 retweet 38 likesShow this thread
-
Replying to @TimSweeneyEpic
I didn't know you read LWN. One of my favorites sites, the technical articles there are very high quality. AFAIU this is needed for memory reclamation. I wonder if discoverability of pointers (without which you cannot move objects) isn't a bigger performance problem for C++ GC.
1 reply 0 retweets 0 likes -
Replying to @RCL
On Skylake the smart pointer copy constructor and assignment operator for my lock-free nonblocking garbage collector cost 3.5 cycles, vs 0.25 for naked pointers, and 20 for atomic reference-counted std::shared_ptr.
1 reply 0 retweets 0 likes -
Replying to @TimSweeneyEpic @RCL
On Intel, the mutator doesn’t even need to use atomics. The question I haven’t answered yet is whether performance goes to hell on ARM or if those super expensive fences can be avoided.
1 reply 0 retweets 0 likes -
Replying to @TimSweeneyEpic
So let me understand better: under your scheme, is it possible to move objects in memory (eg to compact all older generation objects together) by mutating the pointer? As for ARM, if you want to bruteforce-test an assumption, there's an ARM Linux machine at my desk you can use.
1 reply 0 retweets 0 likes
Immutable objects can be relocated. Relocating mutables would require one of several forms of extreme overhead. This is an okay tradeoff in my design because most short-lived objects are collections, which use shallow-copyable immutable data structures.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.