Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Sat, 26 Jul 2014 17:48:54 +0200
From: Jens Gustedt <>
Subject: Re: C11 threads

Am Samstag, den 26.07.2014, 09:16 +0200 schrieb Jens Gustedt:
> And you are right mentioning that, in many situations spin locks do
> effectively suffice. C11 has atomic_flag for that. Often locks are
> just taken for critical sections of code that do a small task, just
> some instructions.

Curiously, I just tracked down a use of pthread_mutex_lock and
pthread_mutex_unlock that I couldn't explain. It came from libatomic
as of gcc-4.9.0.

Looking into that, I see that they got the locking part for the non
lock-free atomics in their POSIX version plain wrong. Not only that
this sucks in the symbols which they shouldn't, but pthread_mutex_t is
just not the right tool for the task. It should be atomic_flag.


:: INRIA Nancy Grand Est ::: AlGorille ::: ICube/ICPS :::
:: ::::::::::::::: office Strasbourg : +33 368854536   ::
:: :::::::::::::::::::::: gsm France : +33 651400183   ::
:: ::::::::::::::: gsm international : +49 15737185122 ::
:: ::

Download attachment "signature.asc" of type "application/pgp-signature" (199 bytes)

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.