mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Torvald Riegel <triegel@redhat.com>
To: Rich Felker <dalias@libc.org>
Cc: Oleg Endo <oleg.endo@t-online.de>,
	gcc@gcc.gnu.org,        musl@lists.openwall.com
Subject: Re: SH runtime switchable atomics - proposed design
Date: Thu, 21 Jan 2016 12:22:08 +0100	[thread overview]
Message-ID: <1453375328.23593.20.camel@localhost.localdomain> (raw)
In-Reply-To: <20160121012229.GT238@brightrain.aerifal.cx>

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.



  reply	other threads:[~2016-01-21 11:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-19 20:28 Rich Felker
2016-01-19 20:51 ` Rich Felker
2016-01-20 23:08 ` Oleg Endo
2016-01-21  1:22   ` Rich Felker
2016-01-21 11:22     ` Torvald Riegel [this message]
2016-01-21 11:32     ` Oleg Endo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1453375328.23593.20.camel@localhost.localdomain \
    --to=triegel@redhat.com \
    --cc=dalias@libc.org \
    --cc=gcc@gcc.gnu.org \
    --cc=musl@lists.openwall.com \
    --cc=oleg.endo@t-online.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).