Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Nov 2004 10:07:21 +0200
From:      Petri Helenius <pete@he.iki.fi>
To:        Niall Douglas <s_sourceforge@nedprod.com>
Cc:        freebsd-threads@freebsd.org
Subject:   Re: mutex performance
Message-ID:  <419DA9B9.50105@he.iki.fi>
In-Reply-To: <419DA7EC.20473.1CFB6AE9@localhost>
References:  <419DA7EC.20473.1CFB6AE9@localhost>

next in thread | previous in thread | raw e-mail | index | archive | help
Niall Douglas wrote:

>In my library TnFOX (http://www.nedprod.com/TnFOX/) where I've 
>completely rewritten mutexs for speed:
>
>                        FXAtomicInt   FXMutex
>    SMP Build, 1 thread :  51203277  18389113
>    SMP Build, 2 threads:   4793978   5337603
>Non-SMP Build, 1 thread : 103305785  27352297
>Non-SMP Build, 2 threads:  54929964  10978153
>
>This is on a dual Athon 1700 (1.43Ghz), so that's 77.76 cycles per 
>lock/unlock with SMP build and 52.28 cycles on non-SMP build. The 
>difference between SMP and non-SMP is that the former uses the lock 
>prefix on the x86 instructions.
>
>So yes, I think there is some scope for improvement.
>  
>
Are these mutexes spinlocks or "real" locks which make the thread 
actually yield if they have to wait longer? Or should I RTFS? :-)

Pete



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?419DA9B9.50105>