<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Operating-Systems on CS Theorems</title><link>https://cs.lozic.me/areas/operating-systems/</link><description>Recent content in Operating-Systems on CS Theorems</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Fri, 24 Dec 2027 12:00:00 +0100</lastBuildDate><atom:link href="https://cs.lozic.me/areas/operating-systems/index.xml" rel="self" type="application/rss+xml"/><item><title>Mutual Exclusion Without Hardware Support</title><link>https://cs.lozic.me/posts/t052-mutual-exclusion-without-hardware-support/</link><pubDate>Fri, 24 Dec 2027 12:00:00 +0100</pubDate><guid>https://cs.lozic.me/posts/t052-mutual-exclusion-without-hardware-support/</guid><description>&lt;h2 id="symptom"&gt;Symptom&lt;/h2&gt;
&lt;p&gt;Two threads increment a shared counter a million times each. The final value is
1,374,522.&lt;/p&gt;
&lt;p&gt;You know why: the increment is a read, an add, and a write, and the interleavings
lose updates. The fix is a lock. But a lock is provided by your runtime, which
gets it from the OS, which gets it from a hardware instruction — &lt;code&gt;lock xchg&lt;/code&gt;,
&lt;code&gt;cmpxchg&lt;/code&gt;, &lt;code&gt;ldrex&lt;/code&gt;/&lt;code&gt;strex&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>The Coffman Conditions</title><link>https://cs.lozic.me/posts/t051-the-coffman-conditions/</link><pubDate>Fri, 29 Jan 2027 12:00:00 +0100</pubDate><guid>https://cs.lozic.me/posts/t051-the-coffman-conditions/</guid><description>&lt;h2 id="symptom"&gt;Symptom&lt;/h2&gt;
&lt;p&gt;Production is wedged. Not slow — wedged. CPU is at zero, no errors are being
logged, and two threads are sitting in a lock wait with no timeout. The stack
traces show thread A holding the account lock and waiting for the ledger lock,
thread B holding the ledger lock and waiting for the account lock. Somebody
restarts the service and it goes away.&lt;/p&gt;</description></item></channel></rss>