Project about Atomic Operations

Joel Sherrill joel.sherrill at
Mon Mar 26 16:46:25 UTC 2012

On 03/26/2012 11:19 AM, Thomas Doerfler wrote:
> Hi,
> I am a bit confused about this discussion. I havn't looked into the
> RTEMS/GSOC project related to atomic support, but I agree with Sebastian
> that it doesn't make sense to implement an RTEMS-specific atomic API
> that would replace the C11 standard API.
> What might make sense is to
> - develop an API for RTEMS synchronization/kernel services which is ON
> TOP of the C11 atomic standard
> - develp support routines (maybe in newlib, maybe in RTEMS) that
> implements a synchronization function.
I think they are discussed in terms of being libc methods but
in reality are provided by the compiler.  GCC 4.7 has initial

> Maybe for the discussion the following wiki page might help:
> It lists the architectures that GCC directly supports for atomics. All
> other architectures (including ARM, M68K) require library support to get
> atomic operations to work properly. So at least _this_ would be work
> that requires doing.
Right any atomic implementation done in this project should
be fed upstream to gcc and/or clang.  In the case of
gcc, that would require an assignment. I can help with that.
We have had quick turn around on assignments for GSOC students.

This in addition to wrapping RTEMS primitives on top of gcc atomics
which gets us back to something like FreeBSD stdatomics.h. :)
> wkr,
> Thomas.
> Am 26.03.2012 18:00, schrieb Yang Wei:
>> 在 2012-3-26,23:45,Sebastian Huber<sebastian.huber at>  写道:
>>> On 03/26/2012 05:32 PM, Gedare Bloom wrote:
>>>> Maybe we should design our API to be at least a superset of what the
>>>> compiler must provide for C11 compliance. Target architectures /
>>>> compilers that do not support the C11 atomics will need the atomic
>>>> operations implemented in assembly language. For targets that are
>>>> supported the API will thinly wrap the C-language atomic features and
>>>> can share code.
>>> This is reinventing the wheel.  I don't see why we need the 100th atomic library.
>> The C11 support for atomic primitive since 2011. Whether the compiler like gcc has support all the atomic primitives and for all architectures? And Rtems does not use standard library provided by compiler, so we still support all the atomic primitives on the newlib. There are also lots of work to do if we support all the atomic primitives defined by C11 standard
>>> -- 
>>> Sebastian Huber, embedded brains GmbH
>>> Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
>>> Phone   : +49 89 18 90 80 79-6
>>> Fax     : +49 89 18 90 80 79-9
>>> E-Mail  : sebastian.huber at
>>> PGP     : Public key available on request.
>>> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>> _______________________________________________
>> rtems-users mailing list
>> rtems-users at

Joel Sherrill, Ph.D.             Director of Research&   Development
joel.sherrill at        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
     Support Available             (256) 722-9985

More information about the users mailing list