From owner-freebsd-current@FreeBSD.ORG Sat Oct 20 06:55:45 2007 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C73AA16A419 for ; Sat, 20 Oct 2007 06:55:45 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outS.internet-mail-service.net (outS.internet-mail-service.net [216.240.47.242]) by mx1.freebsd.org (Postfix) with ESMTP id B260D13C46A for ; Sat, 20 Oct 2007 06:55:45 +0000 (UTC) (envelope-from julian@elischer.org) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.40) with ESMTP; Fri, 19 Oct 2007 23:45:03 -0700 X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id 4014812673F for ; Fri, 19 Oct 2007 23:45:03 -0700 (PDT) Message-ID: <4719A402.9040708@elischer.org> Date: Fri, 19 Oct 2007 23:45:22 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: FreeBSD Current Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: kthread vs kproc X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Sat, 20 Oct 2007 06:55:45 -0000 after chatting with alc this afternoon I decided to revive a set of changes I have had sitting around for a time. Basically I change all teh kthread_xxx calls to kproc_xxx as they all act on processes, and then introduce a new interface set called kthread_xxx that actually do make threads. The first step is a wholesale renaming of the old code to 'kproc' with the following patch http://people.freebsd.org/~julian/kproc.diff the next step is to introduce the new thread creation code. (not-yet up to date version below) The last step is to convert as many of the kprocs as possible to be kthreads. some (for instance in the aio code I believe) need to remain separate processes. As Alan and I decided this evening, this has several advantages. 1/ threads have less overhead than processes 2/ creation of kprocs requires locks etc that are problematic in some situations while kthreads require a lot less, and can be done in a more light weight manner. if I'd had my witts about me I'd have done this before we branched 7 to catch any ABI incompatibilities.. oh well. here's the out of date replacement code: http://people.freebsd.org/~julian/kthread.diff I will be updating it...