From owner-freebsd-current@FreeBSD.ORG Wed Apr 2 16:08:17 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3524037B401 for ; Wed, 2 Apr 2003 16:08:17 -0800 (PST) Received: from canning.wemm.org (canning.wemm.org [192.203.228.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id CB25C43FA3 for ; Wed, 2 Apr 2003 16:08:16 -0800 (PST) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by canning.wemm.org (Postfix) with ESMTP id AEB842A8A7; Wed, 2 Apr 2003 16:08:16 -0800 (PST) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: Matthew Dillon In-Reply-To: <200304030000.h33000uO087097@apollo.backplane.com> Date: Wed, 02 Apr 2003 16:08:16 -0800 From: Peter Wemm Message-Id: <20030403000816.AEB842A8A7@canning.wemm.org> cc: current@freebsd.org Subject: Re: libthr and 1:1 threading. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Apr 2003 00:08:17 -0000 Matthew Dillon wrote: > A better solution would be to give AIO the capability to > operate synchronously if the operation would occur in a > non-blocking fashion (inclusive of blockages on page faults), > and asynchronously otherwise. Without wanting to get too far off into the weeds, squid does something interesting. They need to be able to nonblock for everything including open(), read(), unlink(), readdir() etc. So what they do is implement a fairly significant superset of the traditional AIO stuff using pthreads. It seems to work pretty well for them, even with linuxthreads style threads. Granted, squid's needs are not exactly typical. But I did want to point out that a good part of the delays come not only from data IO but operations like opening a file (pathname traversal), creating or removing a file, reading a directory etc. This is a particular problem when the disk is really busy. Cheers, -Peter -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5