<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Oct 26, 2015 at 2:21 PM, Norbert Thiebaud <span dir="ltr"><<a href="mailto:nthiebaud@gmail.com" target="_blank">nthiebaud@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Mon, Oct 26, 2015 at 1:00 PM, Ashod Nakashian <<a href="mailto:ashnakash@gmail.com">ashnakash@gmail.com</a>> wrote:<br>
> On Mon, Oct 26, 2015 at 1:35 PM, Norbert Thiebaud <<a href="mailto:nthiebaud@gmail.com">nthiebaud@gmail.com</a>><br>
> wrote:<br>
>><br>
>> On Mon, Oct 26, 2015 at 12:14 PM, Ashod Nakashian <<a href="mailto:ashnakash@gmail.com">ashnakash@gmail.com</a>><br>
>> wrote:<br>
>> > OSL provides atomic helpers (osl_atomic_xxx) in the form of a GNU<br>
>> > builtin<br>
>> > (where available) or a platform-specific implementation.<br>
>> ><br>
>> > Any reason for not using modern std::atomic (besides possible lack of<br>
>> > volunteers) ?<br>
>> ><br>
>> ><br>
>> > As a transitional phase, we can maintain the same interface but with<br>
>> > std:atomic as the implementation.<br>
>> ><br>
>> > Thoughts?<br>
>><br>
>> osl atomic are c interface, used in c-source...<br>
>><br>
> Thanks. Is there equivalent used in C++ ? (osl atomics only work for<br>
> sal_Int32 values, which is another potential issue for 64-bit portability.)<br>
<br>
</div></div>the c++ code use these too.<br></blockquote><div><br></div><div>Would there be support for using std::atomic in C++ code?</div><div><br></div><div>There is a case to be made in terms of performance if nothing else (in some scenarios they are hotspots, according to my profiler).</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
relying on atomic on 64 bits is going to be a problem as long as we<br>
support 32 bits OS.<br></blockquote><div><br></div><div>I believe most modern hardware support atomic operations on wide words (i.e. 64-bit even when running in 32-bit mode).</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
and mostly these atomic are used to ref-count... and there is really<br>
no reasonable need to have 64 bits ref-count is there ?<br></blockquote><div><br></div><div>True for ref-counting. Not so for compare-exchange obviously (but I don't know if these are used and how much).<br></div><div><br></div><div>Thanks. </div></div></div></div>