<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://www.baszerr.eu/lib/exe/css.php?s=feed" type="text/css"?>
<rss version="2.0">
    <channel xmlns:g="http://base.google.com/ns/1.0">
        <title>BaSzErr - blog:2012:05:01</title>
        <description></description>
        <link>https://www.baszerr.eu/</link>
        <lastBuildDate>Wed, 06 May 2026 08:51:06 +0000</lastBuildDate>
        <generator>FeedCreator 1.8</generator>
        <image>
            <url>https://www.baszerr.eu/lib/exe/fetch.php?media=wiki:dokuwiki.svg</url>
            <title>BaSzErr</title>
            <link>https://www.baszerr.eu/</link>
        </image>
        <item>
            <title>1</title>
            <link>https://www.baszerr.eu/doku.php?id=blog:2012:05:01:1</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;ub_in_c_11_threads&quot;&gt;2012.05.01 - UB in C++11 threads&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
recently i&amp;#039;ve wrote &lt;a href=&quot;https://www.baszerr.eu/doku.php?id=blog:2012:04:06:2&quot; class=&quot;wikilink1&quot; title=&quot;blog:2012:04:06:2&quot; data-wiki-id=&quot;blog:2012:04:06:2&quot;&gt;how bad undefined behavior is&lt;/a&gt;. when it is obvious for everyone, it is worth noticing that memory model of &lt;a href=&quot;https://en.wikipedia.org/wiki/C++11&quot; class=&quot;interwiki iw_wp&quot; title=&quot;https://en.wikipedia.org/wiki/C++11&quot;&gt;C++11&lt;/a&gt; ensures sequential consistency for data-race-free programs only! it means that if you read and write from multiple threads, to the same variable, neither protected by mutex, nor being atomic (i.e. &lt;em&gt;std::atomic&amp;lt;T&amp;gt;&lt;/em&gt;), your program uses UB and compiler can do ANYTHING with it. even if compiler won&amp;#039;t accidentally “break” any thing you can still crash on “funny” effects of non-atomic access to some of the variables.
&lt;/p&gt;

&lt;p&gt;
i highly recommend you watching Hans Boehm&amp;#039;s talk on &lt;a href=&quot;http://channel9.msdn.com/Events/GoingNative/GoingNative-2012/Threads-and-Shared-Variables-in-C-11&quot; class=&quot;urlextern&quot; title=&quot;http://channel9.msdn.com/Events/GoingNative/GoingNative-2012/Threads-and-Shared-Variables-in-C-11&quot; rel=&quot;ugc nofollow&quot;&gt;threads and shared variables in C++11&lt;/a&gt;. many tricks and pitfalls are explained. enjoy… :)
&lt;/p&gt;

&lt;/div&gt;
</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Tue, 15 Jun 2021 20:09:15 +0000</pubDate>
        </item>
    </channel>
</rss>
