<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Program on 热爱可抵万难</title><link>https://www.jingmengzhiyue.tech/en/tags/program/</link><description>Recent content from 热爱可抵万难</description><generator>Hugo</generator><language>en</language><copyright>All articles on this blog are licensed under the BY license agreement unless otherwise stated. Please indicate the source when reprinting!</copyright><lastBuildDate>Tue, 13 May 2025 16:00:00 +0800</lastBuildDate><atom:link href="https://www.jingmengzhiyue.tech/en/tags/program/index.xml" rel="self" type="application/rss+xml"/><item><title>C++ Concurrency and Parallel Programming (Part II)</title><link>https://www.jingmengzhiyue.tech/en/cpp-concurrency-parallel-programming-2/</link><pubDate>Tue, 13 May 2025 16:00:00 +0800</pubDate><guid>https://www.jingmengzhiyue.tech/en/cpp-concurrency-parallel-programming-2/</guid><description>
<![CDATA[<h1>C++ Concurrency and Parallel Programming (Part II)</h1><p>Author: Jingmengzhiyue()</p>
        
          <p>This article is Part II of the C++ Concurrency and Parallel Programming series. <a href="/en/cpp-concurrency-parallel-programming-1/">Part I</a> covered the execution model, thread lifecycles, mutexes, condition variables, and futures as a result channel; this installment continues with atomics and memory order, C++20&rsquo;s cancellation and coordination facilities (<code>stop_token</code>, semaphore, latch, barrier), the engineering practices that take code from &ldquo;correct&rdquo; to &ldquo;maintainable and measurable,&rdquo; and finally a shutdown-capable concurrent task processor that computes squares.</p>
<p>To keep cross-references consistent, chapter and example numbering continues from Part I: this installment begins with Chapter 8 and Example 15, and references to Part I material are marked &ldquo;Part I.&rdquo;</p>
        
        <hr><p>Published on 2025-05-13 at <a href='https://www.jingmengzhiyue.tech/'>热爱可抵万难</a>, last modified on 2025-05-13</p>]]></description><category>Programming</category></item><item><title>C++ Concurrency and Parallel Programming (Part I)</title><link>https://www.jingmengzhiyue.tech/en/cpp-concurrency-parallel-programming-1/</link><pubDate>Fri, 27 Sep 2024 16:00:00 +0800</pubDate><guid>https://www.jingmengzhiyue.tech/en/cpp-concurrency-parallel-programming-1/</guid><description>
<![CDATA[<h1>C++ Concurrency and Parallel Programming (Part I)</h1><p>Author: Jingmengzhiyue()</p>
        
          <p>Concurrent programs are hard to write not so much because of the sheer number of APIs, but because you must answer three questions clearly: <strong>Who owns the data, who may modify it, and what mechanism lets another thread use it safely?</strong> This article organizes C++ concurrency and parallel programming around those three questions. The code centers on the C++20 standard library and uses no third-party concurrency library.</p>
<p>This is Part I of the series. It covers, in order, the execution model, the build environment, thread lifecycles and argument passing, shared state and mutexes, multiple locks and deadlock, condition variables, and task result channels such as <code>promise</code>, <code>packaged_task</code>, and <code>async</code>. <a href="/en/cpp-concurrency-parallel-programming-2/">Part II</a> goes on to discuss atomic variables and memory ordering, C++20&rsquo;s cancellation and coordination facilities, engineering practice, and the implementation of a complete task processor.</p>
        
        <hr><p>Published on 2024-09-27 at <a href='https://www.jingmengzhiyue.tech/'>热爱可抵万难</a>, last modified on 2024-09-27</p>]]></description><category>Programming</category></item></channel></rss>