Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Nov 2004 14:18:02 -0500 (EST)
From:      Daniel Eischen <deischen@freebsd.org>
To:        Petri Helenius <pete@he.iki.fi>
Cc:        freebsd-threads@freebsd.org
Subject:   Re: mutex performance
Message-ID:  <Pine.GSO.4.43.0411171409360.3786-100000@sea.ntplx.net>
In-Reply-To: <419BA142.9000801@he.iki.fi>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 17 Nov 2004, Petri Helenius wrote:

>
> Do you feel that mutex performance could be improved from the current
> 2-3 million lock/unlock operations per second on uncontested mutexes on
> ~2.4Ghz prescott? Which seems to be about 1000 cycles per lock/unlock.

I'm not sure what you're trying to say above.

> I have a fairly basic producer/consumer application to optimize and I'm
> trying to decide on the performance-optimal synchronization method.

Mutex performance is not optimal since I designed the low-level
locking so that it would work on 80386 which doesn't have cmpxchg.
The mutexes are also pointers instead of actual structures, so
there's an extra indirection and checks for NULL.  libthr mutexes
should be faster in the uncontested case since they do use the
atomic compare/set primitives.

I want to change libpthread locks to drop the 80386 support
and just use the atomic primitives for default mutex types.
In 6.0, we'll also change all the mutexes, CVs, and semaphores
so they aren't pointers -- that will save an indirection and
also allow them to be process shared.

-- 
DE



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.43.0411171409360.3786-100000>