<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: DevSw</title>
    <description>The latest articles on Forem by DevSw (@stormweaver16).</description>
    <link>https://forem.com/stormweaver16</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3890103%2Fe1bf1031-10d1-4d6d-b512-b42487e1c143.jpeg</url>
      <title>Forem: DevSw</title>
      <link>https://forem.com/stormweaver16</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/stormweaver16"/>
    <language>en</language>
    <item>
      <title>The Art Of Atomics: From TSO to Store Buffers</title>
      <dc:creator>DevSw</dc:creator>
      <pubDate>Tue, 21 Apr 2026 05:16:48 +0000</pubDate>
      <link>https://forem.com/stormweaver16/the-art-of-atomics-from-tso-to-store-buffers-7on</link>
      <guid>https://forem.com/stormweaver16/the-art-of-atomics-from-tso-to-store-buffers-7on</guid>
      <description>&lt;p&gt;Most atomics explanations either skip the hardware or skip the why. I wanted neither.&lt;/p&gt;

&lt;p&gt;So I wrote the post I wished existed. CPU up. No skipped steps.&lt;/p&gt;

&lt;p&gt;Here's what it covers:&lt;/p&gt;

&lt;p&gt;→ CPUs and threads — what they actually share and why that's already a problem&lt;br&gt;
→ The race — two threads, one variable, both locally correct, globally wrong&lt;br&gt;
→ Three attempts to fix it without atomics — all three fail, for different reasons&lt;br&gt;
→ TSO — the x86 memory model, its one weird exception, and what it actually guarantees&lt;br&gt;
→ The store buffer — why writes hide and what a stale read really means&lt;br&gt;
→ Out-of-order execution — the CPU running your program in secret&lt;br&gt;
→ LOCK — the instruction that makes it stop hiding&lt;br&gt;
→ Real assembly — what your compiler actually emits and why&lt;br&gt;
→ Hardware vs compiler fences — two layers, both necessary&lt;br&gt;
→ Memory orders — relaxed, acquire, release, seq_cst, and what the hardware pays for each&lt;br&gt;
→ Interlocked* and _&lt;em&gt;atomic&lt;/em&gt;* — same silicon, different spellings&lt;br&gt;
→ Three patterns in C++ and ASM — spinlock, refcount, once flag, Clang vs GCC&lt;br&gt;
→ False sharing — why correct, carefully ordered code can still silently destroy performance&lt;/p&gt;

&lt;p&gt;This is the prequel to a planned series — The Art of High Performance Compute. Atomics are where the machine stops lying to you. Everything else builds on that.&lt;/p&gt;

&lt;p&gt;If you're a senior engineer or someone who lives in this space — I'd genuinely appreciate a read. If something's wrong, imprecise, or could be explained better, I want to know. The goal is for this series to be worth reading, not just published.&lt;/p&gt;

&lt;p&gt;The Art of Atomics — on the StormWeaver Studios blog.&lt;br&gt;
&lt;a href="https://stormweaver-studios.vercel.app/blog/the-art-of-atomics" rel="noopener noreferrer"&gt;Blog Page&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa9atfm0m91aff2tbfosg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa9atfm0m91aff2tbfosg.png" alt="Site" width="800" height="388"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cpp</category>
      <category>opensource</category>
      <category>discuss</category>
      <category>learning</category>
    </item>
  </channel>
</rss>
