<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Cpp on bLueriVer</title><link>https://blueriverlhr.github.io/tags/cpp/</link><description>Recent content in Cpp on bLueriVer</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sun, 17 May 2026 20:54:00 +0800</lastBuildDate><atom:link href="https://blueriverlhr.github.io/tags/cpp/index.xml" rel="self" type="application/rss+xml"/><item><title>C++ coroutine</title><link>https://blueriverlhr.github.io/posts/cpp-coro/</link><pubDate>Sun, 17 May 2026 20:54:00 +0800</pubDate><guid>https://blueriverlhr.github.io/posts/cpp-coro/</guid><description>&lt;h1 id="before-we-start"&gt;Before We Start&lt;/h1&gt;
&lt;p&gt;When you hear &amp;ldquo;asynchronous programming&amp;rdquo;, you might ask: what is it, and why should I care?&lt;/p&gt;
&lt;p&gt;If you ask someone with experience, they&amp;rsquo;ll probably toss around terms like &lt;em&gt;event loop&lt;/em&gt;, &lt;em&gt;asyncio&lt;/em&gt;, or &lt;em&gt;goroutines&lt;/em&gt;.&lt;br&gt;
But in my view, asynchronous programming is just a nice way to organize the tasks you want your computer to do.&lt;/p&gt;
&lt;p&gt;Let’s think back to how we used to program.&lt;br&gt;
First, set a value. Then call some functions or run a loop. Finally, return 0 to the C runtime (or whatever).&lt;br&gt;
It’s all sequential — we expect the code to do exactly what we wrote, top to bottom.&lt;br&gt;
Sometimes we throw in threads for parallelism, but even then, we still expect each thread to run from start to finish, just like we wrote.&lt;/p&gt;</description></item></channel></rss>