现在的位置: 首页 > 综合 > 正文

boa并发性的理解

2013年12月06日 ⁄ 综合 ⁄ 共 504字 ⁄ 字号 评论关闭

boa文档上有如下描述:

Boa is a single-tasking HTTP server.  That means that unlike
traditional web servers, it does not fork for each incoming
connection, nor does it fork many copies of itself to handle multiple
connections.  It internally multiplexes all of the ongoing HTTP
connections, and forks only for CGI programs (which must be separate
processes), automatic directory generation, and automatic file
gunzipping. 

在网上看到的资料,有些人误以为此段描述的含义是,boa不能处理并发请求,只能在完成一个请求之后再处理下一个请求。这个观点是错误的。
boa源码内部采用状态机来处理请求的状态。boa的业务线程是由select实现的事件驱动机制。经过实践,boa能够在处理一个cgi请求时响应其他的请求,而不是阻塞在那里死等。

抱歉!评论已关闭.