From owner-freebsd-current@FreeBSD.ORG Wed Apr 2 16:26:27 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 38BC437B401 for ; Wed, 2 Apr 2003 16:26:27 -0800 (PST) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id BA47F43F93 for ; Wed, 2 Apr 2003 16:26:26 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) by apollo.backplane.com (8.12.9/8.12.6) with ESMTP id h330QQVI087257; Wed, 2 Apr 2003 16:26:26 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.9/8.12.6/Submit) id h330QQbH087256; Wed, 2 Apr 2003 16:26:26 -0800 (PST) Date: Wed, 2 Apr 2003 16:26:26 -0800 (PST) From: Matthew Dillon Message-Id: <200304030026.h330QQbH087256@apollo.backplane.com> To: Peter Wemm References: <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:26:27 -0000 That's a cute trick. The ultimate solution is to implement a semi-synchronous message passing API to replace the myrid system calls we have now. Roughly speaking, what the Amiga did for messages, ports, and I/O, is far superior then what is done in Linux and *BSD. You get the benefit of being able to operate syncnronously when possible, and having a convenient cup-holder for the operation state if you decide you have to 'block' the operation (instead of the state being strewn all over the call stack in a syscall implementation). Userland can decide whether to block or not block on an operation entirely independant of the OS deciding whether to block or not block on an operation. -Matt Matthew Dillon :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