<?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/%E4%B8%AD%E6%96%AD/</link><description>Recent content in 中断 on Tony Bai</description><generator>Hugo</generator><language>zh-cn</language><copyright>2004-2026 Tony Bai. 版权所有.</copyright><lastBuildDate>Fri, 25 Oct 2013 00:00:00 +0800</lastBuildDate><atom:link href="https://tonybai.com/tags/%E4%B8%AD%E6%96%AD/index.xml" rel="self" type="application/rss+xml"/><item><title>为阻塞型函数调用添加超时机制</title><link>https://tonybai.com/2013/10/25/add-timeout-to-blocking-function-call/</link><pubDate>Fri, 25 Oct 2013 00:00:00 +0800</pubDate><guid>https://tonybai.com/2013/10/25/add-timeout-to-blocking-function-call/</guid><description>我们产品中的一个子模块在进行Oracle实时数据库查询时，常常因数据库性能波动或异常而被阻塞在OCI API的调用上，为此我们付出了“惨痛”的代价。说来说去还是我们的程序设计的不够完善，在此类阻塞型函数调用方面缺少微小粒度的超时机制。 调用阻塞多发生在I/O操作（磁盘、网络、低速设备）、第三方API调用等方面。对于文件/网络I/O操作，我们可利用在非阻塞文件描述符上select /poll的超时机...</description></item></channel></rss>