<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Go | Dezhi Yu</title><link>https://halfrost.me/tags/go/</link><atom:link href="https://halfrost.me/tags/go/index.xml" rel="self" type="application/rss+xml"/><description>Go</description><generator>HugoBlox Kit (https://hugoblox.com)</generator><language>en-us</language><lastBuildDate>Sun, 10 Sep 2017 10:05:36 +0000</lastBuildDate><image><url>https://halfrost.me/media/favicon_hu_4db6119fa52e8e17.png</url><title>Go</title><link>https://halfrost.me/tags/go/</link></image><item><title>How to design and implement a thread-safe Map data structure</title><link>https://halfrost.me/post/how-to-design-and-implement-a-thread-safe-map-data-structure/</link><pubDate>Sun, 10 Sep 2017 10:05:36 +0000</pubDate><guid>https://halfrost.me/post/how-to-design-and-implement-a-thread-safe-map-data-structure/</guid><description>&lt;p&gt;Map 是一种很常见的数据结构，用于存储一些无序的键值对。在主流的编程语言中，默认就自带它的实现。C、C++ 中的 STL 就实现了 Map，JavaScript 中也有 Map，Java 中有 HashMap，Swift 和 Python 中有 Dictionary，Go 中有 Map，Objective-C 中有 NSDictionary、NSMutableDictionary。&lt;/p&gt;
&lt;p&gt;上面这些 Map 都是线程安全的么？答案是否定的，并非全是线程安全的。那如何能实现一个线程安全的 Map 呢？想回答这个问题，需要先从如何实现一个 Map 说起。&lt;/p&gt;
&lt;p&gt;点击
看全文。&lt;/p&gt;</description></item></channel></rss>