<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Boost on Laputa</title>
    <link>https://chenjianyong.com/zh/tags/boost/</link>
    <description>Recent content in Boost on Laputa</description>
    <generator>Hugo</generator>
    <language>zh-CN</language>
    <lastBuildDate>Sat, 05 Mar 2022 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://chenjianyong.com/zh/tags/boost/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Boost: 侵入式容器</title>
      <link>https://chenjianyong.com/zh/blog/2022/boost-%E4%BE%B5%E5%85%A5%E5%BC%8F%E5%AE%B9%E5%99%A8/</link>
      <pubDate>Sat, 05 Mar 2022 00:00:00 +0000</pubDate>
      <guid>https://chenjianyong.com/zh/blog/2022/boost-%E4%BE%B5%E5%85%A5%E5%BC%8F%E5%AE%B9%E5%99%A8/</guid>
      <description>&lt;h2 id=&#34;preface&#34;&gt;Preface&lt;/h2&gt;&#xA;&lt;p&gt;最近在为 Lua/JS 子请求实现 HTTP 连接池，池子的大小是固定的，但是创建的连接数是由跑在我们 web server 之上的用户代码(Lua/JS)决定的，所以在空间不够时必然需要淘汰旧的连接。很容易想到 LRU 淘汰算法，通常我们使用哈希表+双向链表实现&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;：哈希表用于存储数据，并且支持 $\mathcal{O}(1)$ 查找；而双向链表用于维护元素的访问时序，并且可以$\mathcal{O}(1)$ 删除。&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
