Re: public barrier functions



On Mon, Dec 12, 2005 at 10:41:55PM +0100, Sebastian Wilhelmi wrote:
> > And while I am at it, would it be possible to change the atomic
> > operations to inline functions? I'd think it is much better inline
> > single-instruction functions as otherwise the call overhead is too
> > great.
> 
> That would make it impossible to fix the corresponding implementations
> also for already compiled programs, should bugs surface (which they
> already did) and it would also make it impossible to guarantee, that all
> programs really use the same implementation, i.e. with inline functions
> one module could use the asm version (because gcc is used) and the
> second module would use the mutex versions (because another compiler is
> used). That would be very bad of course.

Yes, I'd agree here. I think it's more important to have a consistent
library of such operations across all programs, an an easy way to apply
bugfixes, than it is to have down-to-the-cycle optimisation.

But I'd be interested to see some benchmarks; see how much this
actually matters. Run a typical program twice; once with functions and
once with some inlines/macros. It's quite likely that in a real-world
program, the ratio of time it actually spends doing the atomic operation
function calls, to the amount of CPU time in general, will actually be
rather small indeed. Such an optimisation is likely to be of little
actual benefit, for the cost it brings.

-- 
Paul "LeoNerd" Evans

leonerd leonerd org uk
ICQ# 4135350       |  Registered Linux# 179460
http://www.leonerd.org.uk/

Attachment: signature.asc
Description: Digital signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]