<?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>C on GanniPiece Blog</title>
    <link>https://blog.gannipiece.tw/en/tags/c/</link>
    <description>Recent content in C on GanniPiece Blog</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Mon, 10 Oct 2022 03:00:17 +0000</lastBuildDate>
    <atom:link href="https://blog.gannipiece.tw/en/tags/c/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Why Coroutine? (Part 2) — Implementing a Coroutine in C</title>
      <link>https://blog.gannipiece.tw/en/posts/why-coroutine-part-2-implementing-in-c/</link>
      <pubDate>Mon, 10 Oct 2022 03:00:17 +0000</pubDate>
      <guid>https://blog.gannipiece.tw/en/posts/why-coroutine-part-2-implementing-in-c/</guid>
      <description>&lt;p&gt;&lt;em&gt;(the post is automatically translated by AI)&lt;/em&gt;&lt;/p&gt;
&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In the previous article, &lt;a href=&#34;https://blog.gannipiece.tw/en/posts/why-coroutine-part-1-is-multithreading-bad/&#34;&gt;Why Coroutine? (Part 1) — Is Multithreading Not Enough?&lt;/a&gt;, we covered the underlying principles of Coroutines and listed the interface we need to implement one in C. In this article, we&amp;rsquo;ll walk through the code line by line.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Source code: &lt;a href=&#34;https://github.com/GanniPiece/SimpleCCoroutine&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;GanniPiece/SimpleCCoroutine: A simple coroutine example implemented using C (github.com)&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id=&#34;background-knowledge&#34;&gt;Background Knowledge&lt;/h2&gt;
&lt;p&gt;Before we begin, if you&amp;rsquo;re not familiar with Coroutines, please read the previous article first. In it we mentioned that we can manipulate &lt;code&gt;ucontext_t&lt;/code&gt; [1] using four operations defined in &lt;code&gt;&amp;lt;ucontext.h&amp;gt;&lt;/code&gt;:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
