<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Is QAtomicInteger guaranteed to work on all desktop platforms ?]]></title><description><![CDATA[<p dir="auto">Documentation is quite confusing.</p>
<p dir="auto">In one place it says "The API provided by QAtomicInteger is guaranteed to work atomically on all processors. However, since not all processors implement support for every operation provided by QAtomicInteger, it is necessary to expose information about the processor."</p>
<p dir="auto">On other place it says "only the 32-bit- and pointer-sized instantiations are guaranteed to work on all platforms. Support for other sizes depends on the compiler and processor architecture the code is being compiled for".</p>
<p dir="auto">And then on other place it says:<br />
"Since many modern architectures allow out-of-order execution and memory ordering, using the correct semantic is necessary to ensure that your application functions properly on all processors."</p>
<p dir="auto">Thanks a lot.<br />
Denis</p>
]]></description><link>https://forum.qt.io/topic/109297/is-qatomicinteger-guaranteed-to-work-on-all-desktop-platforms</link><generator>RSS for Node</generator><lastBuildDate>Tue, 04 Aug 2026 16:52:10 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/109297.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 28 Nov 2019 11:47:45 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Is QAtomicInteger guaranteed to work on all desktop platforms ? on Fri, 29 Nov 2019 04:22:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vronin">@<bdi>VRonin</bdi></a> After looking source code, I found that Qt tried to remove msvc implementation of atomics, but had to revert it back as fallback. I always prefer to use Qt classes, which as you said are wrappers around std::atomic, but msvc/generic fallback implementation makes me think if this is true on my environment. I will double check it. Thanks a lot for your help.</p>
]]></description><link>https://forum.qt.io/post/564842</link><guid isPermaLink="true">https://forum.qt.io/post/564842</guid><dc:creator><![CDATA[comy]]></dc:creator><pubDate>Fri, 29 Nov 2019 04:22:52 GMT</pubDate></item><item><title><![CDATA[Reply to Is QAtomicInteger guaranteed to work on all desktop platforms ? on Thu, 28 Nov 2019 14:01:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/comy">@<bdi>comy</bdi></a> said in <a href="/post/564722">Is QAtomicInteger guaranteed to work on all desktop platforms ?</a>:</p>
<blockquote>
<p dir="auto">read/write into a bool variable</p>
</blockquote>
<p dir="auto">Use <code>std::atomic_bool</code> and forget about the rest</p>
]]></description><link>https://forum.qt.io/post/564760</link><guid isPermaLink="true">https://forum.qt.io/post/564760</guid><dc:creator><![CDATA[VRonin]]></dc:creator><pubDate>Thu, 28 Nov 2019 14:01:42 GMT</pubDate></item><item><title><![CDATA[Reply to Is QAtomicInteger guaranteed to work on all desktop platforms ? on Thu, 28 Nov 2019 12:04:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vronin">@<bdi>VRonin</bdi></a> I want to achieve thread safe read/write into a bool variable without having to use a mutex. Thanks a lot for prompt reply.</p>
]]></description><link>https://forum.qt.io/post/564722</link><guid isPermaLink="true">https://forum.qt.io/post/564722</guid><dc:creator><![CDATA[comy]]></dc:creator><pubDate>Thu, 28 Nov 2019 12:04:09 GMT</pubDate></item><item><title><![CDATA[Reply to Is QAtomicInteger guaranteed to work on all desktop platforms ? on Thu, 28 Nov 2019 12:01:40 GMT]]></title><description><![CDATA[<p dir="auto">Do you need the operation to be actually atomic or you just want thread safety? AFAIK <code>QAtomicInteger</code> is a wrapper of <code>std::atomic</code></p>
]]></description><link>https://forum.qt.io/post/564721</link><guid isPermaLink="true">https://forum.qt.io/post/564721</guid><dc:creator><![CDATA[VRonin]]></dc:creator><pubDate>Thu, 28 Nov 2019 12:01:40 GMT</pubDate></item></channel></rss>