<?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 LeafCxy's Blog</title><link>https://leafcxy.github.io/tags/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/</link><description>Recent content in 操作系统 on LeafCxy's Blog</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Wed, 23 Sep 2026 09:12:00 +0800</lastBuildDate><atom:link href="https://leafcxy.github.io/tags/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/index.xml" rel="self" type="application/rss+xml"/><item><title>深入理解线程安全：底层机理、典型陷阱与实现方案</title><link>https://leafcxy.github.io/posts/2026/09/understanding-thread-safety-principles-and-practices/</link><pubDate>Wed, 23 Sep 2026 09:12:00 +0800</pubDate><guid>https://leafcxy.github.io/posts/2026/09/understanding-thread-safety-principles-and-practices/</guid><description>&lt;p&gt;在多核 CPU 普及与高并发系统盛行的今天，并发编程已成为现代软件工程师不可回避的基石。然而，多线程在极大提升硬件资源利用率与吞吐量的同时，也带来了计算机体系中最复杂的幽灵——&lt;strong&gt;线程安全问题（Thread Safety）&lt;/strong&gt;。&lt;/p&gt;
&lt;p&gt;竞态条件（Race Condition）、脏读脏写、死锁、可见性丢失、指令重排……这些在单线程世界中闻所未闻的现象，往往在生产环境中以偶发、难以复现的诡异 Bug 出现。&lt;/p&gt;</description></item><item><title>深入理解程序内存布局：代码区、全局区、堆区与栈区</title><link>https://leafcxy.github.io/posts/2026/09/memory-layout-code-data-heap-stack/</link><pubDate>Wed, 23 Sep 2026 09:11:00 +0800</pubDate><guid>https://leafcxy.github.io/posts/2026/09/memory-layout-code-data-heap-stack/</guid><description>&lt;p&gt;在编写程序时，无论是使用 C/C++ 这种面向系统底层的语言，还是 Java、Go、Rust、Python 等拥有运行时环境的高级语言，程序最终都需要被加载到操作系统的虚拟内存中执行。&lt;/p&gt;
&lt;p&gt;很多开发者在日常编码中常听到“变量在栈上”、“对象在堆中”、“全局变量存哪里”、“为什么递归太深会导致栈溢出”、“为什么堆内存容易产生碎片”等问题。要彻底理清这些概念，关键在于理解进程的&lt;strong&gt;虚拟内存空间布局（Virtual Memory Layout）&lt;/strong&gt;。&lt;/p&gt;</description></item></channel></rss>