From owner-freebsd-threads@FreeBSD.ORG Thu Jan 6 08:49:30 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 DDBAF16A4CE for ; Thu, 6 Jan 2005 08:49:30 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id C476843D5E; Thu, 6 Jan 2005 08:49:30 +0000 (GMT) (envelope-from davidxu@freebsd.org) Received: from freebsd.org (davidxu@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id j068nMtU099661; Thu, 6 Jan 2005 08:49:24 GMT (envelope-from davidxu@freebsd.org) Message-ID: <41DCFD2F.2040207@freebsd.org> Date: Thu, 06 Jan 2005 16:56:15 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5b) Gecko/20030723 Thunderbird/0.1 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Petri Helenius References: <41DCEA91.6040402@he.iki.fi> In-Reply-To: <41DCEA91.6040402@he.iki.fi> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-threads@freebsd.org Subject: Re: 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 08:49:31 -0000 I will have low overhead pthread library available soon, for simple mutex, it is only an atomic_cmpset_long() plus a function call (pthread_mutex_lock) overhead. David Xu Petri Helenius wrote: > > 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 > > _______________________________________________ > freebsd-threads@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > To unsubscribe, send any mail to "freebsd-threads-unsubscribe@freebsd.org" > >