|
Message-ID: <1453375328.23593.20.camel@localhost.localdomain> Date: Thu, 21 Jan 2016 12:22:08 +0100 From: Torvald Riegel <triegel@...hat.com> To: Rich Felker <dalias@...c.org> Cc: Oleg Endo <oleg.endo@...nline.de>, gcc@....gnu.org, musl@...ts.openwall.com Subject: Re: SH runtime switchable atomics - proposed design On Wed, 2016-01-20 at 20:22 -0500, Rich Felker wrote: > On Thu, Jan 21, 2016 at 08:08:18AM +0900, Oleg Endo wrote: > > Do you have plans to add other atomic operations (like > > arithmetic)? > > No, at least not in musl. From musl's perspective cas is the main one > that's used anyway. But even in general I don't think there's a > significant advantage to doing 'direct' arithmetic ops without a cas > loop even when you can (with llsc, gusa, or imask model). With gusa > and imask the only time you benefit from not implementing them in > terms of cas is on the _highly_ unlucky/unlikely occasion where an > interrupt occurs between the old-value read before cas and the cas. > For llsc there's more potential advantage because actual smp > contention is possible, but sh4a is probably not a very interesting > target anymore. Things like atomic increments are combinable, so you can make them scale better. You can do combining too with CAS, but if you're using the CAS to implement an increment, the program would have to issue another CAS, so you're not gaining as much.
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.