: Re: [MPlayer-dev-eng] [PATCH] use pthreads for caching

Martin Simmons vyslnqaaxytp at spammotel.com
Sat Jan 27 22:55:41 CET 2007


>>>>> On Sat, 27 Jan 2007 15:41:08 -0500, Rich Felker said:
> On Sat, Jan 27, 2007 at 05:45:20PM +0200, Uoti Urpala wrote:
> > On Sat, 2007-01-27 at 10:09 -0500, Rich Felker wrote:
> > > Yes. It's not a matter of the implementation being fast or slow. It's
> > > fundamentally impossible to make synchronization fast. Each "lock"
> > > prefix requires a couple hundred cycles on my machine, and I'm told
> > > it's even worse on machines with higher clocks.
> > 
> > Where did you get those numbers?
> 
> Timing my spinlock implementation with an without the lock prefix on
> the xchg opcode, in a setting with no contention (no threads).

Which CPU is this BTW?  I've not found one yet where the lock prefix makes any
timing difference for single threaded operations (I've checked various ages of
Intel and AMD chips, including Pentium III, Athlon (5yrs old), Pentium IV,
Core Duo, Athlon 64 X2).

__Martin



More information about the MPlayer-dev-eng mailing list