From owner-cvs-all@FreeBSD.ORG Mon Oct 29 23:27:05 2007 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A37C16A46C for ; Mon, 29 Oct 2007 23:27:05 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outG.internet-mail-service.net (outG.internet-mail-service.net [216.240.47.230]) by mx1.freebsd.org (Postfix) with ESMTP id 7FFEF13C4A5 for ; Mon, 29 Oct 2007 23:27:05 +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; Mon, 29 Oct 2007 16:14:59 -0700 X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (nat.ironport.com [63.251.108.100]) by idiom.com (Postfix) with ESMTP id 3286B126860; Mon, 29 Oct 2007 16:14:59 -0700 (PDT) Message-ID: <47266992.4020605@elischer.org> Date: Mon, 29 Oct 2007 16:15:30 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: Daniel Eischen References: <200710292101.l9TL1mAE049561@repoman.freebsd.org> <472650BF.5060706@FreeBSD.org> <4726560F.5050804@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/lib/libthr/thread thr_mutex.c src/lib/libkse/thread thr_mutex.c src/include pthread.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2007 23:27:05 -0000 Daniel Eischen wrote: > On Mon, 29 Oct 2007, Kris Kennaway wrote: > >> Daniel Eischen wrote: >>> On Mon, 29 Oct 2007, Kris Kennaway wrote: >>> >>>> Daniel Eischen wrote: >>>>> >>>>> The libkse implementation already spins for a bit. The default >>>>> number of spins is 500. >>>> >>>> OK, cool. >>>> >>>>> I'm not sure that another mutex type is warranted, the default >>>>> mutex implementation should be adaptive I think. >>>> >>>> The point being that certain existing applications already know >>>> about this mutex name and will use it automatically when it exists. >>>> >>>> I am a bit wary of making this the default type though. The >>>> algorithm is a pessimization when the conditions described above are >>>> not true. >>> >>> I agree, and it applies a little to the KSE approach also. >>> Spinning is mostly a hack for not being able to tell in >>> userland if a thread is swapped in/out or is on another >>> CPU. If you solve that problem, then you can make the >>> default mutex adaptive. >> >> Yeah. It looks like Solaris does this. In principle you could do it >> cheaply with a shared page, I'm not sure what Solaris does. > > I think we should add back the thread mailbox for libthr threads. > I was in favor of keeping the mailbox for libthr, and this might > be a good use for it. I have hopes that we can add a per-thread shared page above the stack. (if asked for)