Re: [squid-users] why does squid use select() ?

From: Colin Campbell <sgcccdc@dont-contact.us>
Date: Fri, 25 May 2001 08:23:56 +1000 (EST)

Hi,

On Thu, 24 May 2001 Sadhna.Ahuja@nokia.com wrote:

> Hi,
> Squid runs as a single process and uses select() for I/O on
> different sockets. Why doesn't it fork() a different process to achieve
> concurrency? Is that to avoid the overheads of creating a new process? What
> are the advantages and disadvantages?

Squid needs to update its cache index all the time (swap.state). With one
process there is no contention. If you introduce multiple processes you
have to start locking objects. Complexity increases. For the same reason
you cannot have multiple squids sharing the same cache. While programming
for the select() loop, especially when in non-blocking mode, can be far
more complex than forking a new process, the overall result is simpler.

Colin
Received on Thu May 24 2001 - 16:24:13 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:00:17 MST