<div dir="ltr">Architecture-specific NaCl basically uses whatever the underlying ISA expects (so answers will be "same as the above"), save for any OS interactions which go through NaCl's own syscalls (which then sometimes punt to the host OS). The most interesting here is futex, which is a restricted version of Linux' futex and gets emulated on non-Linux guests.<div><br></div><div>For PNaCl none of the C++ constructs get lowered past their C++ semantics (they look like functions calls). futex is still a syscall for PNaCl. C++ constructs only get lowered once the actual ISA is known (translation time) at which point we're usually generating NaCl code and the same as the above applies.</div><div><br></div><div>The same as PNaCl would apply to JavaScript once it supports SharedArrayBuffer if the current proposal goes forward. One small change would be to rely on synchronic instead of futex.</div><div><br></div><div>I'm not familiar enough with taskwait, omp_set_lock / omp_unset_lock to provide a useful answer. I assume that we can implement them with atomics and futex if QOI isn't an issue?</div><div><br></div><div>On reordering: yes, as much as C++ allows. Good timing for this:</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><a href="https://github.com/jfbastien/papers/blob/master/source/N4455.rst">https://github.com/jfbastien/papers/blob/master/source/N4455.rst</a></div></blockquote></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 10, 2015 at 10:12 AM, Hal Finkel <span dir="ltr"><<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi everyone,<br>
<br>
The OpenMP standards committee has begun work to formalize their memory model, and define its relationship to the C/C++ memory models. A questionnaire has been put together (pasted below), and I'd like everyone's help in composing detailed answers to inform their decision-making process. While our OpenMP support is still in active development, many of these questions apply equally to C/C++ atomics, and a lot of work has certainly been done here on that front.<br>
<br>
* Which processor architectures does your compiler target (e.g. x86, Power, ARM, ARM v8, Xeon Phi, Nvidia GPUs, etc.)?<br>
[I'll just answer "yes" for that one ;)]<br>
* What is a flush lowered to in assembly for each of the supported architectures? For instance, a flush might be implemented as an MFENCE on the x86 architecture in some compilers.<br>
* What are non-seq_cst atomic read, write, update and capture lowered to for each of your targets?<br>
* What are seq_cst atomic read, write, update and capture lowered to for each of your targets?<br>
* What is the taskwait construct lowered to for each of your targets?<br>
* What are omp_set_lock and omp_unset_lock lowered to for each of your targets?<br>
* What is a barrier lowered to for each of your targets?<br>
* Are any optimisations allowed to reorder, change or remove code that uses any of the synchronisation constructs above, or any of the other synchronisation constructs in section 2.12 of the OpenMP 4.0 specification?<br>
<br>
I'll be happy to collate answers to send back to the committee; please provide as much feedback as you can.<br>
<br>
Thanks in advance,<br>
Hal<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Hal Finkel<br>
Assistant Computational Scientist<br>
Leadership Computing Facility<br>
Argonne National Laboratory<br>
</font></span></blockquote></div><br></div>