From owner-freebsd-threads@FreeBSD.ORG Thu Jan 6 07:36:56 2005 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3522416A4CE for ; Thu, 6 Jan 2005 07:36:56 +0000 (GMT) Received: from silver.he.iki.fi (helenius.fi [193.64.42.241]) by mx1.FreeBSD.org (Postfix) with ESMTP id D411343D1D for ; Thu, 6 Jan 2005 07:36:54 +0000 (GMT) (envelope-from pete@he.iki.fi) Received: from [193.64.42.134] (h86.vuokselantie10.fi [193.64.42.134]) by silver.he.iki.fi (8.13.1/8.11.4) with ESMTP id j067al3m071583 for ; Thu, 6 Jan 2005 09:36:48 +0200 (EET) (envelope-from pete@he.iki.fi) Message-ID: <41DCEA91.6040402@he.iki.fi> Date: Thu, 06 Jan 2005 09:36:49 +0200 From: Petri Helenius User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-threads@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: higher speed mutexes X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jan 2005 07:36:56 -0000 Hi, I have some low-contention mutexes which I'm trying to make perform better and I'm wondering if the current threading library does have some primitives I could use or if I'm better off using atomic_cmpset_* and pthread_yield() if the thread hit's contention (which should be about 1:10000 of the lock/unlock operation). Any scheduling caveats from above, except obviously it would spin while waiting for the lock. Most systems I plan on running this on have dual-hypethreading CPU's. I remember there were some discussion about dropping i386 compatible support for mutexes and using atomic operations instead. Is there code/compile time options for this on a branch I could check out and give it a spin? Pete