mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Matthew Fernandez <matthew.fernandez@nicta.com.au>
To: Rich Felker <dalias@aerifal.cx>, <musl@lists.openwall.com>
Subject: Re: 64-bit atomic ops on 32-bit ARM
Date: Thu, 6 Feb 2014 10:08:57 +1100	[thread overview]
Message-ID: <52F2C489.7090608@nicta.com.au> (raw)
In-Reply-To: <20140205230605.GG15627@brightrain.aerifal.cx>

Ah, so it's used for operating on 64-bit bitfields. Presumably the meaning of each bit is orthogonal
to the others so the atomicity of the write as a whole is irrelevant. Thanks for the clarification,
Rich.

On 06/02/14 10:06, Rich Felker wrote:
> On Thu, Feb 06, 2014 at 09:56:47AM +1100, Matthew Fernandez wrote:
>> Hi all,
>>
>> The header atomic.h contains a couple of functions for operations on 64-bit types. Despite their
>> name, these do not appear to be atomic to me. For example:
>>
>>   static inline void a_and_64(volatile uint64_t *p, uint64_t v)
>
> The function name is simply a misnomer. It should be called "atomic
> bitclear" (and, for "or", "atomic bitset). That's the only way it's
> actually used. In other words we don't care that the and/or operation
> on both words happen atomically with respect to one another, only that
> each bit individually behaves atomically with respect to being set and
> cleared.
>
> BTW, changing the name and semantics would also allow us to drop from
> performing two atomic operations to just performing on atomic
> operation (on the word that actually needs to change). This would be a
> fairly significant optimization, I think. But for now it's not a bug,
> just a missed optimization.
>
> Rich
>

________________________________

The information in this e-mail may be confidential and subject to legal professional privilege and/or copyright. National ICT Australia Limited accepts no liability for any damage caused by this email or its attachments.


      reply	other threads:[~2014-02-05 23:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-05 22:56 Matthew Fernandez
2014-02-05 23:06 ` Rich Felker
2014-02-05 23:08   ` Matthew Fernandez [this message]

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=52F2C489.7090608@nicta.com.au \
    --to=matthew.fernandez@nicta.com.au \
    --cc=dalias@aerifal.cx \
    --cc=musl@lists.openwall.com \
    /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).