<?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/%E5%BA%95%E5%B1%82%E5%8E%9F%E7%90%86/</link><description>Recent content in 底层原理 on LeafCxy's Blog</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Wed, 23 Sep 2026 09:18:00 +0800</lastBuildDate><atom:link href="https://leafcxy.github.io/tags/%E5%BA%95%E5%B1%82%E5%8E%9F%E7%90%86/index.xml" rel="self" type="application/rss+xml"/><item><title>编译原理入门：词法分析器与 Flex/Bison 黄金搭档实战</title><link>https://leafcxy.github.io/posts/2026/09/compiler-lexical-analysis-flex-bison-tutorial/</link><pubDate>Wed, 23 Sep 2026 09:18:00 +0800</pubDate><guid>https://leafcxy.github.io/posts/2026/09/compiler-lexical-analysis-flex-bison-tutorial/</guid><description>&lt;p&gt;在每一个程序员的学习生涯中，“编译器究竟是如何把一堆英文字符代码变成可执行程序的”往往是最令人着迷的谜题之一。&lt;/p&gt;
&lt;p&gt;当你键入如下命令准备折腾编译器前端时：&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo apt-get install flex
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sudo apt-get install bison
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;你实际上已经推开了计算机科学中最经典、最精巧的技术大门：&lt;strong&gt;词法分析器（Lexer）&lt;/strong&gt; 与 &lt;strong&gt;语法分析器（Parser）&lt;/strong&gt;。&lt;/p&gt;</description></item><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>