<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Absl::Mutex on Cheat Sheet</title><link>/tags/abslmutex/</link><description>Recent content in Absl::Mutex on Cheat Sheet</description><generator>Hugo</generator><language>en</language><atom:link href="/tags/abslmutex/index.xml" rel="self" type="application/rss+xml"/><item><title>Concurrency &amp; Threading</title><link>/programming/cpp/advanced/concurrency/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/programming/cpp/advanced/concurrency/</guid><description>&lt;h1 id="c-concurrency-stdthread-vs-lightweight-fibers-channel--abseil-mutex"&gt;C++ Concurrency: &lt;code&gt;std::thread&lt;/code&gt; vs. Lightweight Fibers, &lt;code&gt;Channel&lt;/code&gt;, &amp;amp; Abseil &lt;code&gt;Mutex&lt;/code&gt;&lt;a class="anchor" href="#c-concurrency-stdthread-vs-lightweight-fibers-channel--abseil-mutex"&gt;#&lt;/a&gt;&lt;/h1&gt;

&lt;p&gt;This guide covers the architectural differences and usage patterns between &lt;strong&gt;OS kernel threads (&lt;code&gt;std::thread&lt;/code&gt; / &lt;code&gt;std::jthread&lt;/code&gt;)&lt;/strong&gt; and &lt;strong&gt;user-space lightweight threads (&lt;code&gt;thread::Fiber&lt;/code&gt;)&lt;/strong&gt;, &lt;strong&gt;CSP message passing (&lt;code&gt;thread::Channel&amp;lt;T&amp;gt;&lt;/code&gt; &amp;amp; &lt;code&gt;thread::Select&lt;/code&gt;) and how it directly inspired the Go programming language&lt;/strong&gt;, and synchronization with compile-time thread safety verification using open-source &lt;strong&gt;Abseil (&lt;code&gt;abseil-cpp&lt;/code&gt;)&lt;/strong&gt; primitives (&lt;code&gt;absl::Mutex&lt;/code&gt; and &lt;code&gt;ABSL_GUARDED_BY&lt;/code&gt;).&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="1-os-kernel-threads-stdthread-vs-user-space-lightweight-threads-fibers"&gt;1. OS Kernel Threads (&lt;code&gt;std::thread&lt;/code&gt;) vs. User-Space Lightweight Threads (Fibers)&lt;a class="anchor" href="#1-os-kernel-threads-stdthread-vs-user-space-lightweight-threads-fibers"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In modern high-performance servers, concurrency models generally fall into two categories: &lt;strong&gt;1:1 OS kernel threads&lt;/strong&gt; and &lt;strong&gt;M:N user-space lightweight threads (Fibers)&lt;/strong&gt;.&lt;/p&gt;</description></item></channel></rss>