From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: Deduplicating atomics written in terms of CAS
Date: Sun, 17 May 2015 02:14:30 -0400 [thread overview]
Message-ID: <20150517061430.GL17573@brightrain.aerifal.cx> (raw)
In-Reply-To: <alpine.LNX.2.11.1505170857510.22867@monopod.intra.ispras.ru>
On Sun, May 17, 2015 at 09:00:15AM +0300, Alexander Monakov wrote:
> It seems the prototype of a_cas_p has changed:
>
> void *a_cas_p(volatile void **p, void *t, void *s)
>
> Shouldn't the type of the first argument be 'void * volatile *'?
Yes, thanks for catching it. BTW changing from the current void* to
this will probably expose minor aliasing bugs I want to fix. I might
just change all pointers used with a_cas_p to uintptr_t, and have
a_cas_p work on uintptr_t, and force the code using them to cast back
and forth to real pointers. Alternatively we could try to get rid of
a_cas_p entirely. I'd like to trim down both the set of atomic
primitives we're using and the number of direct uses of atomics
(versus higher-level primitives like locks). Some candidates to
remove:
- a_cas_p
- a_or_l (only used in sigaction; could be replaced by a_or)
- a_and (not used at all)
- a_and_64/a_or_64 (malloc only; these are misnamed too)
Actually a_cas_p is the hardest to remove; while none of the users of
it are performance-critical themselves, they are using it as a means
of avoiding locking where the consumer of the data being written can't
or doesn't want to require a lock.
Rich
next prev parent reply other threads:[~2015-05-17 6:14 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-17 4:55 Rich Felker
2015-05-17 6:00 ` Alexander Monakov
2015-05-17 6:14 ` Rich Felker [this message]
2015-05-17 7:37 ` Jens Gustedt
2015-05-17 16:28 ` Rich Felker
2015-05-17 16:59 ` Jens Gustedt
2015-05-17 17:59 ` Rich Felker
2015-05-17 22:23 ` Jens Gustedt
2015-05-17 22:33 ` Rich Felker
2015-05-17 23:22 ` Jens Gustedt
2015-05-18 10:19 ` Szabolcs Nagy
2015-05-18 11:03 ` Jens Gustedt
2015-05-17 6:49 ` Jens Gustedt
2015-05-17 16:22 ` Rich Felker
2015-05-17 17:19 ` Jens Gustedt
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=20150517061430.GL17573@brightrain.aerifal.cx \
--to=dalias@libc.org \
--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).