<?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>共享内存 on Tony Bai</title><link>https://tonybai.com/tags/%E5%85%B1%E4%BA%AB%E5%86%85%E5%AD%98/</link><description>Recent content in 共享内存 on Tony Bai</description><generator>Hugo</generator><language>zh-cn</language><copyright>2004-2026 Tony Bai. 版权所有.</copyright><lastBuildDate>Wed, 11 Mar 2026 00:00:00 +0800</lastBuildDate><atom:link href="https://tonybai.com/tags/%E5%85%B1%E4%BA%AB%E5%86%85%E5%AD%98/index.xml" rel="self" type="application/rss+xml"/><item><title>你每天敲下的 go func()，藏着这位 92 岁老人的毕生心血</title><link>https://tonybai.com/2026/03/11/in-memory-of-tony-hoare/</link><pubDate>Wed, 11 Mar 2026 00:00:00 +0800</pubDate><guid>https://tonybai.com/2026/03/11/in-memory-of-tony-hoare/</guid><description>本文永久链接 – https://tonybai.com/2026/03/11/in-memory-of-tony-hoare 大家好，我是Tony Bai。 在这个由代码构建的现代世界里，有些名字如同星辰般指引着航向。但遗憾的是，2026 年 3 月 5 日，其中一颗最明亮的星辰熄灭了。 图灵奖得主、快速排序（Quicksort）发明者、CSP（通信顺序进程）理论之父 Tony Hoare（托尼...</description></item><item><title>TypeScript 编译器 Go 重写版提速 10 倍：微软团队深度揭秘幕后工程细节</title><link>https://tonybai.com/2026/01/27/typescript-compiler-go-rewrite-10x-speed-microsoft-details/</link><pubDate>Tue, 27 Jan 2026 00:00:00 +0800</pubDate><guid>https://tonybai.com/2026/01/27/typescript-compiler-go-rewrite-10x-speed-microsoft-details/</guid><description>本文永久链接 – https://tonybai.com/2026/01/27/typescript-compiler-go-rewrite-10x-speed-microsoft-details 大家好，我是Tony Bai。 “JavaScript 是一门很棒的语言，但它并不是为了编写编译器而设计的。” 备受瞩目的 TypeScript 编译器 Go 重写版（代号 TypeScript 7.0...</description></item><item><title>当 Go 遇上 GPU：用 CUDA 释放千倍算力的实战指南</title><link>https://tonybai.com/2026/01/21/integrating-cuda-in-go/</link><pubDate>Wed, 21 Jan 2026 00:00:00 +0800</pubDate><guid>https://tonybai.com/2026/01/21/integrating-cuda-in-go/</guid><description>本文永久链接 – https://tonybai.com/2026/01/21/integrating-cuda-in-go 大家好，我是Tony Bai。 长期以来，高性能计算（HPC）和 GPU 编程似乎是 C++ 开发者的专属领地。Go 语言虽然在并发和服务端开发上表现卓越，但在触及 GPU 算力时，往往显得力不从心。 然而，在最近的 GopherCon 2025 上，软件架构师 Sam B...</description></item><item><title>坚守内核，拥抱变量：我的 2025 年终复盘与 2026 展望</title><link>https://tonybai.com/2026/01/04/stick-to-the-core-embrace-variables-2025-review-2026-outlook/</link><pubDate>Sun, 04 Jan 2026 00:00:00 +0800</pubDate><guid>https://tonybai.com/2026/01/04/stick-to-the-core-embrace-variables-2025-review-2026-outlook/</guid><description>本文永久链接 – https://tonybai.com/2026/01/04/stick-to-the-core-embrace-variables-2025-review-2026-outlook 大家好，我是Tony Bai。 当时钟拨向 2026 年，我不禁回望刚刚过去的 2025。 在技术史上，这注定会被定义为**“分水岭”**的一年。如果说之前我们还在观望 AI 能画出什么样的图，生成...</description></item><item><title>像 Go 创始人一样思考：用五大思维原理重学 Go 语言</title><link>https://tonybai.com/2025/12/26/think-like-go-founders-relearn-go-five-principles/</link><pubDate>Fri, 26 Dec 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/12/26/think-like-go-founders-relearn-go-five-principles/</guid><description>本文永久链接 – https://tonybai.com/2025/12/26/think-like-go-founders-relearn-go-five-principles 大家好，我是Tony Bai。 学习一门新的编程语言时，我们常常陷入“是什么”的迷雾：goroutine 是什么？channel 是什么？interface 是什么？我们记忆语法，模仿示例，却很少追问那个更根本的问题——...</description></item><item><title>成为更完整的 Go 工程师，从补上这堂系统编程课开始</title><link>https://tonybai.com/2025/09/01/system-programming-in-go/</link><pubDate>Mon, 01 Sep 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/09/01/system-programming-in-go/</guid><description>本文永久链接 – https://tonybai.com/2025/09/01/system-programming-in-go 大家好，我是Tony Bai。 作为一名 Go 工程师，我们无疑是幸运的。这门语言为我们提供了简洁的语法、强大的并发模型和一套设计精良的标准库。我们能以极高的效率，构建出高性能的 Web 服务、数据管道和云原生应用。 我们熟练地使用 http.ListenAndServ...</description></item><item><title>从“锁”到“channel”：开启你的Go并发心智模型转变之旅</title><link>https://tonybai.com/2025/08/05/go-concurrency-mental-model/</link><pubDate>Tue, 05 Aug 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/08/05/go-concurrency-mental-model/</guid><description>从“锁”到“channel”：开启你的Go并发心智模型转变之旅 - Tony Bai Tony Bai 一个程序员的心路历程 * Google Go语言编码风格规范 * Google Go语言编码风格规范：指南篇 * Google Go语言编码风格规范：决定篇 * Google Go语言编码风格规范：最佳实践篇 * Go语言第一课FAQ * Go语言进阶课FAQ * 关于我 * 我的技术专栏 * ...</description></item><item><title>一张图读懂Go的生存之道：当“面条代码”来敲门</title><link>https://tonybai.com/2025/07/16/when-spaghetti-code-knocks/</link><pubDate>Wed, 16 Jul 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/07/16/when-spaghetti-code-knocks/</guid><description>本文永久链接 – https://tonybai.com/2025/07/16/when-spaghetti-code-knocks 大家好，我是Tony Bai。 最近，在网上看到一张关于编程语言的 Meme 图，它以一种黑色幽默的方式，精准地描绘了我们软件开发中一个永恒的敌人，以及 Go 语言那与众不同的应对之道。 在这张图中，一个名为“面条代码 (Spaghetti Code)”的恐怖死神，...</description></item><item><title>世界读书日：如何高效阅读“砖头”技术书？我的心法分享（文末赠书）</title><link>https://tonybai.com/2025/04/23/tips-for-reading-technical-books/</link><pubDate>Wed, 23 Apr 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/04/23/tips-for-reading-technical-books/</guid><description>世界读书日：如何高效阅读“砖头”技术书？我的心法分享（文末赠书） - Tony Bai =============== Tony Bai 一个程序员的心路历程 * Google Go语言编码风格规范 * Google Go语言编码风格规范：指南篇 * Google Go语言编码风格规范：决定篇 * Google Go语言编码风格规范：最佳实践篇 * Go语言第一课FAQ * Go语言进阶课FAQ ...</description></item><item><title>Go 1.19中值得关注的几个变化</title><link>https://tonybai.com/2022/08/22/some-changes-in-go-1-19/</link><pubDate>Mon, 22 Aug 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/08/22/some-changes-in-go-1-19/</guid><description>本文永久链接 – https://tonybai.com/2022/08/22/some-changes-in-go-1-19 我们知道Go团队在2015年重新规定了团队发布版本的节奏，将Go大版本的发布频率确定为每年两次，发布窗口定为每年的2月与8月。而实现自举的Go 1.5版本是这一个节奏下发布的第一个版本。一般来说，Go团队都会在这两个窗口的中间位置发布版本，不过这几年也有意外，比如承载着泛...</description></item><item><title>GoCN社区Go读书会第二期：《Go语言精进之路》</title><link>https://tonybai.com/2022/07/07/gocn-community-go-book-club-issue2-go-programming-from-beginner-to-master/</link><pubDate>Thu, 07 Jul 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/07/07/gocn-community-go-book-club-issue2-go-programming-from-beginner-to-master/</guid><description>本文永久链接 – https://tonybai.com/2022/07/07/gocn-community-go-book-club-issue2-go-programming-from-beginner-to-master 本文是2022年6月26日我在**GoCN社区的Go读书会第二期《Go语言精进之路》直播的文字稿**。本文对直播的内容做了重新整理与修订，供喜欢阅读文字的朋友们在收看直播后...</description></item><item><title>探讨Docker容器中修改系统变量的方法</title><link>https://tonybai.com/2014/10/14/discussion-on-the-approach-to-modify-system-variables-in-docker/</link><pubDate>Tue, 14 Oct 2014 00:00:00 +0800</pubDate><guid>https://tonybai.com/2014/10/14/discussion-on-the-approach-to-modify-system-variables-in-docker/</guid><description>探讨完Docker对共享内存状态持久化的支持状况后，我将遗留产品build到一个pre-production image中，测试启动是否OK。很显然，我过于乐观了，Docker之路并不平坦。我收到了shmget报出的EINVAL错误码，提示参数非法。 shmget的manual对EINVAL错误码的说明如下： EINVAL： A  new  segment  was  to  be  create...</description></item><item><title>探讨docker容器对共享内存的支持情况</title><link>https://tonybai.com/2014/10/12/discussion-on-shared-mem-support-in-docker/</link><pubDate>Sun, 12 Oct 2014 00:00:00 +0800</pubDate><guid>https://tonybai.com/2014/10/12/discussion-on-shared-mem-support-in-docker/</guid><description>我们的遗留系统广泛使用了性能最佳的IPC方式 – 共享内存，而且用到了两种共享内存的实现方式：System V共享内存(shmget、shmat、shmdt)以及Mmap映射Regular File。System V共享内存支持一定程度上的内存数据持久化，即当程序创建共享内存对象后，如果不显式删除或物理主机重启，该IPC对象会一直保留，其中的数据也不会丢 失；mmap映射Regular File的...</description></item><item><title>偿还N年前的一笔技术债</title><link>https://tonybai.com/2011/07/21/pay-for-a-tech-debt-of-several-year-ago/</link><pubDate>Thu, 21 Jul 2011 00:00:00 +0800</pubDate><guid>https://tonybai.com/2011/07/21/pay-for-a-tech-debt-of-several-year-ago/</guid><description>记得刚来公司时曾参与过一个项目，项目中用到了部门基础库中的一个B+树接口。不过在程序调试过程中我们发现可执行程序总是dump core（在sparc solaris上），经初步分析，断定问题就出在B+树接口处，但一时又找不到问题原因。还好这个B+树的实现者就坐在我的旁边。他分析后告诉我：这个B+树接口要求用户自定义的索引结构体的size应该为4的整数倍。按照他的说法，我为结构体打了padding，...</description></item><item><title>开始'亡羊补牢'</title><link>https://tonybai.com/2006/04/12/begin-fix-before-lost-too-much/</link><pubDate>Wed, 12 Apr 2006 00:00:00 +0800</pubDate><guid>https://tonybai.com/2006/04/12/begin-fix-before-lost-too-much/</guid><description>就在昨天，就在我们的项目要结项的时候，一个影响力不亚于’广岛原子弹’的bug出炉了，蒙蔽我近一个月的问题终于被澄清了，不过为时已晚，项目即将上线，如果想彻底地解决这个问题，需要对整个系统的实现架构作调整，目前能做的只是’亡羊补牢’了。 这里先简单的说一下问题的原因吧！熟悉Unix编程的人都知道有’共享内存映射’这回事儿，我们的问题恰巧就出在对’共享内存映射’的使用不当上。由于我们使用的底层库采用的...</description></item></channel></rss>