On multi core a spin lock may be better than a CAS since in a low contention
environment the only cost is a CAS.

Ben

On Fri, Feb 4, 2011 at 9:45 AM, Rich Felker <[email protected]> wrote:

> On Wed, Feb 02, 2011 at 09:10:01AM +0100, Ricard Wanderlof wrote:
> >
> > On Tue, 1 Feb 2011, Rich Felker wrote:
> >
> > >A better fix would probably be to create a global lock on the
> > >atomic compare and exchange function so that only one thread can
> > >execute a compare and exchange at a time. This would impact
> > >performance rather badly, but that's better than having subtle
> > >race condition bugs that occur randomly once in 5 years of
> > >execution...
> >
> > I think many people would argue that given the stability of given a
> > system as a whole, a random crash once per 5 years would be
> > prefereble to a severe performance penelty which impacts the system
> > on a continuous basis.
>
>
>
_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to