Replies: 3 comments 7 replies
-
A less extreme alternative of write barriers to all pointers would be write barriers to pointers that cross the TLS boundary. Maybe this is where we can make |
Beta Was this translation helpful? Give feedback.
-
Walter has actually softened his stance: he's open to write barriers now as an experimental switch. But he's not likely to implement it himself any time soon (probably in part because he doesn't know how to do it in a useful way). But yeah, I agree we should look into it. I don't know how to implement it either though. BTW Amaury has been working on a new GC for upstream and I'm very optimistic about it. It keeps the same interface but has several quality of implementation fixes. He's mostly doing it in his sdc compiler but there are concrete plans in the work to upstream it to dmd. |
Beta Was this translation helpful? Give feedback.
-
Either way I'm for anything that releases out of the GC jail. Another possibility I've been thinking about is making classes a GC type that inserts write barriers and all other raw pointers will not insert them. This is however not compatible with old code if you want to test that. Otherwise I think a compiler would be just fine for experimenting. In the long run, if any of this going to viable there must be a separation between raw pointers and managed pointers. I cannot see any other way around this problem. There is no way that the compiler can distinguish them otherwise. Let's say that manual memory is the most unusual type of pointer, then just a RawPtr!Type template could work and the compiler doesn't insert any instrumentation code. The true goal for me would if we could remove raw pointers (like int* p) in safe code all together and only use value and reference types. |
Beta Was this translation helpful? Give feedback.
-
One of the major blockers for a better GC in D is the fact that Walter downright rejects pointer write barriers. This immediately excludes a large percentage of competitive, modern GC algorithms, forcing D to be stuck with a stop-the-world mark-and-sweep GC.
I think it's time to reevaluate this option. Introducing pointer write barriers, maybe initially via an optional compiler switch, would allow us to experiment with more modern GCs like incremental algorithms, that would, at least partially, address the concerns of the GC naysayers. Having a more modern GC algorithm will also make this fork more competitive and be viable in more applications. (And perhaps, hopefully, force the hand of upstream to get past the blockade of no write barriers? One can hope...) D's current GC is actually not bad, but why not make it even better by removing one of the biggest blockades?
Beta Was this translation helpful? Give feedback.
All reactions