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 <nsz@...t70.net>
To: musl@...ts.openwall.com
Subject: Re: stdatomic implementation

* Jens Gustedt <jens.gustedt@...ia.fr> [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
> 
> stdatomic.gforge.inria.fr
> 

nice

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

T *p;
__atomic_fetch_add(&p,1);

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

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64843

> 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
> 
> https://hal.inria.fr/hal-01236734
> 
> 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.