Re: Spinlocks and CPU Architectures

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Spinlocks and CPU Architectures
Date: 2005-10-11 15:36:43
Message-ID: 20051011153642.GF22806@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 11, 2005 at 11:12:46AM -0400, Tom Lane wrote:
> This seems pretty unworkable from a packaging standpoint. Even if you
> teach autoconf how to tell which model it's running on, there's no
> guarantee that the resulting executables will be used on that same
> machine. We would have to make a run-time test, and I do not think that
> that idea is attractive either --- adding a conditional branch to the
> spinlock code will likely negate whatever performance improvement we
> could hope to get.

Well, as long as the code you've got works on all the systems you
expect, you have the choice. If you start getting to the point where
there is no single piece of code that works across all the expected
systems, then you have an issue.

I don't think we're there yet, but I don't think using a function
pointer would be all that expensive?

Performence measuring I guess...
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2005-10-11 16:45:58 Re: Spinlocks and CPU Architectures
Previous Message Tom Lane 2005-10-11 15:12:46 Re: Spinlocks and CPU Architectures