<?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>Atomic on Tony Bai</title><link>https://tonybai.com/tags/atomic/</link><description>Recent content in Atomic on Tony Bai</description><generator>Hugo</generator><language>zh-cn</language><copyright>2004-2026 Tony Bai. 版权所有.</copyright><lastBuildDate>Tue, 26 Aug 2025 00:00:00 +0800</lastBuildDate><atom:link href="https://tonybai.com/tags/atomic/index.xml" rel="self" type="application/rss+xml"/><item><title>告别性能猜谜：一份Go并发操作的成本层级清单</title><link>https://tonybai.com/2025/08/26/go-concurrency-cost-hierarchy/</link><pubDate>Tue, 26 Aug 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/08/26/go-concurrency-cost-hierarchy/</guid><description>本文永久链接 – https://tonybai.com/2025/08/26/go-concurrency-cost-hierarchy 大家好，我是Tony Bai。 Go语言的并发模型以其简洁直观著称，但这种简单性背后，隐藏着一个跨越五个数量级的巨大性能鸿沟。当你的高并发服务遭遇性能瓶颈时，你是否也曾陷入“性能猜谜”的困境：是sync.Mutex太慢？是atomic操作不够快？还是某个cha...</description></item><item><title>“这代码迟早出事！”——复盘线上问题：六个让你头痛的Go编码坏味道</title><link>https://tonybai.com/2025/05/31/six-smells-in-go/</link><pubDate>Sat, 31 May 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/05/31/six-smells-in-go/</guid><description>本文永久链接 – https://tonybai.com/2025/05/31/six-smells-in-go 大家好，我是Tony Bai。 在日常的代码审查 (Code Review) 和线上问题复盘中，我经常会遇到一些看似不起眼，却可能埋下巨大隐患的 Go 代码问题。这些“编码坏味道”轻则导致逻辑混乱、性能下降，重则引发数据不一致、系统崩溃，甚至让团队成员在深夜被告警声惊醒，苦不堪言。 今...</description></item><item><title>当Gopher拥有了“Go语言女友”：一张图带你读懂Go的那些“可爱”特性</title><link>https://tonybai.com/2025/05/30/gopher-girlfriend/</link><pubDate>Fri, 30 May 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/05/30/gopher-girlfriend/</guid><description>当Gopher拥有了“Go语言女友”：一张图带你读懂Go的那些“可爱”特性 - Tony Bai =============== Tony Bai 一个程序员的心路历程 * Google Go语言编码风格规范 * Google Go语言编码风格规范：指南篇 * Google Go语言编码风格规范：决定篇 * Google Go语言编码风格规范：最佳实践篇 * Go语言第一课FAQ * Go语言进阶...</description></item><item><title>原子操作的瓶颈与Go的多核扩展性之痛：深入剖析sync.ShardedValue及per-CPU提案</title><link>https://tonybai.com/2025/05/19/shardedvalue-per-cpu-proposal/</link><pubDate>Mon, 19 May 2025 00:00:00 +0800</pubDate><guid>https://tonybai.com/2025/05/19/shardedvalue-per-cpu-proposal/</guid><description>原子操作的瓶颈与Go的多核扩展性之痛：深入剖析sync.ShardedValue及per-CPU提案 - Tony Bai =============== Tony Bai 一个程序员的心路历程 * Google Go语言编码风格规范 * Google Go语言编码风格规范：指南篇 * Google Go语言编码风格规范：决定篇 * Google Go语言编码风格规范：最佳实践篇 * Go语言第一...</description></item><item><title>聊聊Prometheus Gauge的增减操作实现</title><link>https://tonybai.com/2023/01/10/how-prometheus-gauge-add-and-sub/</link><pubDate>Tue, 10 Jan 2023 00:00:00 +0800</pubDate><guid>https://tonybai.com/2023/01/10/how-prometheus-gauge-add-and-sub/</guid><description>本文永久链接 – https://tonybai.com/2023/01/10/how-prometheus-gauge-add-and-sub 1\. Gauge是啥？ 熟悉Prometheus的小伙伴们都知道Prometheus提供了四大指标类型： * Counter * Gauge * Histogram * Summary Histogram和Summary是一类，但理解起来稍复杂一些，这...</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>Go 1.19新特性前瞻</title><link>https://tonybai.com/2022/06/12/go-1-19-foresight/</link><pubDate>Sun, 12 Jun 2022 00:00:00 +0800</pubDate><guid>https://tonybai.com/2022/06/12/go-1-19-foresight/</guid><description>本文永久链接 – https://tonybai.com/2022/06/12/go-1-19-foresight 美国时间2022年5月7日，Go 1.19版本开发分支进入新特性冻结(freeze)阶段，即只能修Bug，不能再向Go 1.19版本中增加新特性了。由于上一个版本Go 1.18因引入泛型改动较大，推迟了一个月发布，这直接导致了Go 1.19版本的开发周期被缩短。 虽然开发周期少了近一...</description></item><item><title>基于Redis Cluster的分布式锁实现以互斥方式操作共享资源</title><link>https://tonybai.com/2021/02/13/operate-with-shared-resources-in-a-mutually-exclusive-way-through-distributed-lock-implemented-by-redis-cluster/</link><pubDate>Sat, 13 Feb 2021 00:00:00 +0800</pubDate><guid>https://tonybai.com/2021/02/13/operate-with-shared-resources-in-a-mutually-exclusive-way-through-distributed-lock-implemented-by-redis-cluster/</guid><description>今天要说的技术方案也是有一定项目背景的。在上一个项目中，我们需要对一个redis集群中过期的key进行处理，这是一个分布式 系统，考虑到高可用性，需要具备过期处理功能的服务有多个副本，这样我们就要求在同一时间内仅有一个副本可以对过期的key&amp;gt;进行处理，如果该副本挂掉，系统会在其他副本中再挑选出一个来处理过期的key。 很显然，这里涉及到一个选主(leader election)的过程。每当涉及选主...</description></item><item><title>Uber Go语言编码规范</title><link>https://tonybai.com/2019/10/12/uber-go-style-guide/</link><pubDate>Sat, 12 Oct 2019 00:00:00 +0800</pubDate><guid>https://tonybai.com/2019/10/12/uber-go-style-guide/</guid><description>Uber是世界领先的生活出行服务提供商，也是Go语言的早期adopter，根据Uber工程博客的内容，大致可以判断出Go语言在Uber内部扮演了十分重要的角色。Uber内部的Go语言工程实践也是硕果累累，有大量Go实现的内部工具被Uber开源到github上，诸如被Gopher圈熟知的zap、jaeger等。2018年年末Uber将内部的Go风格规范开源到github，经过一年的积累和更新，该规范...</description></item><item><title>Go程序调试、分析与优化</title><link>https://tonybai.com/2015/08/25/go-debugging-profiling-optimization/</link><pubDate>Tue, 25 Aug 2015 00:00:00 +0800</pubDate><guid>https://tonybai.com/2015/08/25/go-debugging-profiling-optimization/</guid><description>Brad Fitzpatrick在YAPC Asia 2015（Yet Another Perl Conference）上做了一次技术分享，题为：&amp;#34;Go Debugging, Profiling, and Optimization&amp;#34;。个人感觉这篇分享中价值最大的是BradFitz现场演示的一个有关如何对Go程序进行调试、分析和优化的 Demo，Brad将demo上传到了他个人在github.com...</description></item><item><title>使用core-vagrant方式安装CoreOS</title><link>https://tonybai.com/2015/07/20/install-coreos-by-coreos-vagrant/</link><pubDate>Mon, 20 Jul 2015 00:00:00 +0800</pubDate><guid>https://tonybai.com/2015/07/20/install-coreos-by-coreos-vagrant/</guid><description>CoreOS是一种专门为运行类docker容器而生的linux发行版。与其他通用linux发行版（ubuntu、debian、redhat)相 比，它具有体型最小，消耗最小，支持滚动更新等特点。除此之外CoreOS内置的分布式系统服务组件也给开发者和运维者组建分布式集群、部署分布式服务应 用带来了极大便利。 CoreOS与知名容器Docker脚前脚后诞生，到目前为止已经较为成熟，国外主流云平台提供...</description></item></channel></rss>