<?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>Singleflight on 极客老墨</title>
    <link>https://blog.hankmo.com/tags/singleflight/</link>
    <description>Recent content in Singleflight on 极客老墨</description>
    <generator>Hugo -- 0.138.0</generator>
    <language>zh-cn</language>
    <lastBuildDate>Mon, 10 Jun 2024 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://blog.hankmo.com/tags/singleflight/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Golang中singleflight的实现原理</title>
      <link>https://blog.hankmo.com/posts/golang/go-singleflight-impl/</link>
      <pubDate>Mon, 10 Jun 2024 00:00:00 +0000</pubDate>
      <guid>https://blog.hankmo.com/posts/golang/go-singleflight-impl/</guid>
      <description>singleflight 的实现主要依赖 sync.WaitGroup 和 sync.Mutex，利用 WaitGroup 限制并发请求数量，利用 Mutex 加锁保证并发安全性。DoChan 和 Do 方法的区别在于处理结果上，前者多了对于 chan 的管理。</description>
    </item>
    <item>
      <title>Golang中singleflight的用法</title>
      <link>https://blog.hankmo.com/posts/golang/go-singleflight/</link>
      <pubDate>Sat, 18 May 2024 00:00:00 +0000</pubDate>
      <guid>https://blog.hankmo.com/posts/golang/go-singleflight/</guid>
      <description>singleflight 用于抑制同一时间获取相同数据的重复请求。当存在多个重复请求时，singleflight 保证只有一个请求能执行，其他请求阻塞，直到前边的请求返回后直接将其返回值共享(shared)给阻塞的这些请求。</description>
    </item>
  </channel>
</rss>
