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

Rich Felker dalias at aerifal.cx
Sat Jan 27 23:46:44 CET 2007


On Sat, Jan 27, 2007 at 09:55:41PM +0000, Martin Simmons wrote:
> >>>>> 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).

K6-III+. Chipset is some VIA thing IIRC.

Rich



More information about the MPlayer-dev-eng mailing list