<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>X86 on Madhav Khosla</title><link>https://madhavkhoslaa.github.io/tags/x86/</link><description>Recent content in X86 on Madhav Khosla</description><generator>Hugo</generator><language>en</language><copyright>© Madhav Khosla</copyright><lastBuildDate>Sun, 20 Sep 2026 12:00:00 +0530</lastBuildDate><atom:link href="https://madhavkhoslaa.github.io/tags/x86/index.xml" rel="self" type="application/rss+xml"/><item><title>Writing a Mutex in C: Atomics and x86</title><link>https://madhavkhoslaa.github.io/posts/mutex-atomic/</link><pubDate>Sun, 20 Sep 2026 12:00:00 +0530</pubDate><guid>https://madhavkhoslaa.github.io/posts/mutex-atomic/</guid><description>&lt;h2 id="mutex-what-is-it"&gt;Mutex, What is it?&lt;/h2&gt;&#10;&lt;h3 id="example-1"&gt;Example 1&lt;/h3&gt;&#10;&lt;p&gt;Imagine two people updating the same number on a whiteboard. The number is 0&#10;and both have to increment it by 1.&lt;/p&gt;&#10;&lt;p&gt;The answer should be 2. But what if both read 0 before either writes anything?&#10;Both calculate 1. Both write 1.&lt;/p&gt;&#10;&lt;p&gt;So the important thing is not just how we increment the number. It is &lt;strong&gt;who&#10;gets to update it right now&lt;/strong&gt;.&lt;/p&gt;</description></item></channel></rss>