4 ms·
Do I have it right that a Hare compiler is supposed to emit barriers around every single memory access? Because it’s not just the compiler that can reorder wri
by pwdisswordfish9 4y ago
Do I have it right that a Hare compiler is supposed to emit barriers around every single memory access? Because it’s not just the compiler that can reorder writes, but the underlying CPU as well, which means the compiler has to be aware of concurrency during code generation if concurrency is to behave with any predictability. Which is the point of the article: concurrency cannot be provided as a pure library facility without any participation from the compiler. The language has to define which concurrent memory accesses are valid and how they interact. Otherwise you’re at the mercy of however the platform decides to flush caches that day.
I mean, of course you can just mandate sequential consistency everywhere and bloat your codegen in the process, but if you care so little about performance, why even bother with Hare? If I wanted a poorly specified, badly performing language with no concurrency support and a superficial appeal for simplicity, Python will suffice in the role.
- ddevault 4y agoNo, Hare does not emit barriers around every memory access, but the programmer can add them where they want -- and there are no tricky compiler optimizations which will bite them in the ass when they do like this paper describes. > I mean, of course you can just mandate sequential consistency everywhere and bloat your codegen in the process, but if you care so little about performance, why even bother with Hare? If I wanted a poorly specified, badly performing language with no concurrency support and a superficial appeal for simplicity, Python will suffice in the role. This was not nice.