<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>bsdhouse</author_name>
  <author_url>https://blog.hatena.ne.jp/bsdhouse/</author_url>
  <blog_title>yamasaのネタ帳</blog_title>
  <blog_url>https://yamasa.hatenablog.jp/</blog_url>
  <categories>
    <anon>programming</anon>
    <anon>multithreading</anon>
  </categories>
  <description>もはや誰得レベルになりつつありますが、今回もメモリバリアについての話です。以前の話の続きになるので、まだの方は初回と前回のエントリを先にどうぞ。 さて、まず最初に、C++0xのatomicクラスを使った「正しく同期化されているコード」の例を挙げてみます。 struct Hoge { int foo; }; // 初期値 std::atomic p(nullptr); // Thread 1 Hoge* r1 = new Hoge(); r1-&gt;foo = 42; p.store(r1, std::memory_order_release); // Thread 2 Hoge* r2; do {…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fyamasa.hatenablog.jp%2Fentry%2F20090929%2F1254237835&quot; title=&quot;C++0xのメモリバリアをより深く解説してみる - yamasaのネタ帳&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2009-09-29 00:23:55</published>
  <title>C++0xのメモリバリアをより深く解説してみる</title>
  <type>rich</type>
  <url>https://yamasa.hatenablog.jp/entry/20090929/1254237835</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
