<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Timer on Horeb</title><link>https://horeb.top/tags/timer/</link><description>Recent content in Timer on Horeb</description><generator>Hugo -- gohugo.io</generator><language>zh-cn</language><copyright>© 2026 JekYUlll</copyright><lastBuildDate>Fri, 29 May 2026 10:30:05 +0000</lastBuildDate><atom:link href="https://horeb.top/tags/timer/index.xml" rel="self" type="application/rss+xml"/><item><title>Nginx 源码解析（十）：定时器系统</title><link>https://horeb.top/posts/infra-nginx-%E6%BA%90%E7%A0%81%E8%A7%A3%E6%9E%90%E5%8D%81%E5%AE%9A%E6%97%B6%E5%99%A8%E7%B3%BB%E7%BB%9F/</link><pubDate>Wed, 27 May 2026 00:00:00 +0000</pubDate><guid>https://horeb.top/posts/infra-nginx-%E6%BA%90%E7%A0%81%E8%A7%A3%E6%9E%90%E5%8D%81%E5%AE%9A%E6%97%B6%E5%99%A8%E7%B3%BB%E7%BB%9F/</guid><description>&lt;p&gt;前面我们分析了 Nginx 事件循环的核心骨架，，&lt;code&gt;ngx_process_events_and_timers()&lt;/code&gt; 是每个 worker 进程里的主循环函数。不过之前一直留了一个坑：传给 &lt;code&gt;epoll_wait&lt;/code&gt; 的超时时间 timer 是怎么算出来的？超时后事件怎么处理？&lt;/p&gt;
&lt;p&gt;这一篇就来填这个坑。Nginx 的定时器系统用红黑树管理所有事件超时，逻辑写得很紧凑，总共不到 300 行。&lt;/p&gt;</description></item><item><title>计时器 timer 的设计</title><link>https://horeb.top/posts/cpp-%E8%AE%A1%E6%97%B6%E5%99%A8-timer-%E7%9A%84%E8%AE%BE%E8%AE%A1/</link><pubDate>Tue, 25 Feb 2025 00:00:00 +0000</pubDate><guid>https://horeb.top/posts/cpp-%E8%AE%A1%E6%97%B6%E5%99%A8-timer-%E7%9A%84%E8%AE%BE%E8%AE%A1/</guid><description/></item></channel></rss>