Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 13 Dec 2015 15:59:50 +0100
From: Szabolcs Nagy <>
Subject: Re: stdatomic implementation

* Jens Gustedt <> [2015-12-13 11:01:22 +0100]:
> Its integration into musl should be straight forward and remains my
> primary choice for having it distributed. You can find it at


i recently run into a problem that you may be interested in:
the gcc atomic builtins do not handle atomic pointer types as

T *p;

adds 1 to (char*)p instead of sizeof(T).

> Under the hood it uses a new lock algorithm based on futex waits for
> the slow path, that has proven to be more efficient than anything else
> that I looked at: musl's internal lock, mtx_t or pthread_mutex_t, or
> spinlocks. You can find a discussion of that at
> Before I go (more) public with this, I would very much like to hear
> what you think.

i havent read the paper yet but it is worth noting that
glibc implements weaker pthread semantics than musl, so
on glibc pthread_mutex_lock/unlock is acquire/release.
(which makes pthread_mutex_trylock non-conforming, but
it's closer to the c11 semantics, same for spinlocks).

so it would be interesting to benchmark against glibc
primitives too.

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.