Re: (Fwd) Re: --enable-time-hack

From: Andres Kroonmaa <andre@dont-contact.us>
Date: Mon, 11 Sep 2000 22:58:28 +0200

On 11 Sep 2000, at 20:30, Adrian Chadd <adrian@creative.net.au> wrote:

> On Mon, Sep 11, 2000, Andres Kroonmaa wrote:
> >
> > Hey, but what about moving poll itself into a separate thread?
> > What about moving HTTP, ICP, DNS socket polling into a separate thread,
> > and calling aiocheckcallbacks to get notifications back to main thread?
>
> I thought about shifting stuff around, but then you end up having to go
> once through the IO loop to get your HTTP/ICP/DNS socket data rather than
> periodically during the normal IO loop.

 well, I'm thinking how to make squid scale better on 2-cpu system ;)
 Currently all system work is done in main thread context, all work OS has
 to do during poll() is done with main thread suspended.
 It is so tempting to move blocking stuff into separate thread and leave
 main thread free for actual processing. But seems it isn't trivial.

> Also, there are WAY too many context switches with the pthreads-based aio
> code. On a linux box I have here I'm seeing something upward of 30,000/sec
> on a very idle box. Thats a lot of time to be spending context switching.
> I'm guessing there is mutex/cond black magic dating back quite a while,
> but I haven't got the time to figure it out yet.

 No, its not to do with squid code, its to do with implementation of threads
 in linux.

------------------------------------
 Andres Kroonmaa <andre@online.ee>
 Delfi Online
 Tel: 6501 731, Fax: 6501 708
 Pärnu mnt. 158, Tallinn,
 11317 Estonia
Received on Mon Sep 11 2000 - 15:00:59 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:12:37 MST