After 3 months of coding weekends, my attempt to create a relocating nonblocking garbage collector in C++ has failed. It works in theory, but in practice the read barrier is pervasive and costly, and the threading invariants are incredibly tricky to maintain.
-
-
In this later case (the context of my weekend experiment), the question of “is anybody referencing this data structure” isn’t manageable either locally or globally, so garbage collection is the only possible memory management strategy.
-
I'm not sure i see why vanilla reference counting can't be used, is it the synchronisation cost?
- 5 more replies
New conversation -
-
-
Functional programming is very suitable for memory management based on linearity / uniqueness typing / ownership models, because a) you don't have shared mutability problems (see: Rust) and b) you can freely copy if it suits you without disturbing object identity.
-
That can give you fast in-place updates with functional semantics, without GC/refc overhead. It can even be wonderful for concurrency since whole linear data structures can be passed between threads without copying.
- 1 more reply
New conversation -
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.