<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Concurrency on Feng-Chi's Notes</title><link>https://holmeslin.github.io/tags/concurrency/</link><description>Recent content in Concurrency on Feng-Chi's Notes</description><generator>Hugo -- gohugo.io</generator><language>zh-tw</language><lastBuildDate>Wed, 08 Jul 2020 10:36:17 +0800</lastBuildDate><atom:link href="https://holmeslin.github.io/tags/concurrency/index.xml" rel="self" type="application/rss+xml"/><item><title>Goroutine 和 Channel 講解</title><link>https://holmeslin.github.io/posts/go-goroutine-channel/</link><pubDate>Wed, 08 Jul 2020 10:36:17 +0800</pubDate><guid>https://holmeslin.github.io/posts/go-goroutine-channel/</guid><description>&lt;h2 id="前言"&gt;前言&lt;/h2&gt;
&lt;p&gt;Go 語言中並發程序可以用兩種方式來實現。&lt;/p&gt;
&lt;p&gt;一種是 &lt;code&gt;goroutine&lt;/code&gt; 和 &lt;code&gt;channel&lt;/code&gt;，其支持 &amp;ldquo;交談循序程式&amp;rdquo;（communicating sequential processes）或被簡稱為 CSP。&lt;/p&gt;
&lt;p&gt;CSP 是一個現代的並發程式模型，在這種程式模型中值會在不同的運行實例(goroutine)中傳遞，儘管大多數情況下被限制在單一實例中。&lt;/p&gt;
&lt;p&gt;另一種是傳統的並發模型，多線程共享內存(基於共享變量的並發) ， 會在後續單獨闡述。&lt;/p&gt;</description></item><item><title>Go 語言 sync 包的應用詳解</title><link>https://holmeslin.github.io/posts/go-sync/</link><pubDate>Tue, 07 Jul 2020 15:07:16 +0800</pubDate><guid>https://holmeslin.github.io/posts/go-sync/</guid><description>&lt;p&gt;並發程式中的同步也就是我們通常說的鎖的主要作用是保證多個線程或者 &lt;code&gt;goroutine&lt;/code&gt; 在訪問同一片內存時不會出現混亂的問題。&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Go&lt;/code&gt; 語言的 &lt;code&gt;sync&lt;/code&gt; 包提供了常見的並發程式同步 。 今天的文章裡讓我們回到應用層 ， 聚焦 &lt;code&gt;sync&lt;/code&gt; 包裡這些同步的應用場景 ， 同時也會介紹 &lt;code&gt;sync&lt;/code&gt; 包中的 &lt;code&gt;Pool&lt;/code&gt; 和 &lt;code&gt;Map&lt;/code&gt; 的應用場景和使用方法。&lt;/p&gt;</description></item></channel></rss>