[concurrency-interest] Programming language-independent memory models
martinrb at google.com
Thu Aug 10 09:29:18 EDT 2017
On Fri, Aug 4, 2017 at 10:18 AM, Andrew Haley <aph at redhat.com> wrote:
> Any language implemented in C++ will
> necessarily implement the C++ memory model, which (perhaps)
> unfortunately implies that if it executes any data races the whole
> program becomes undefined. A programming language interpreter written
> in C++ could get around that by using atomic types for everything, but
> that's rather unpleasant.
I continue to have a mental model where every ordinary java field maps to a
relaxed atomic in C++ (disregarding the weird non-atomicity of long and
double), so a C++ interpreter for Java that used C++ atomics pervasively
seems very natural to me. No C++ undefined behavior! Java race detectors
can still detect concurrent accesses without happens-before, but there is
never a data race in the C++ sense.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Concurrency-interest