GSOC2013-Atomic Operations and SMP lock debug tool

Sebastian Huber sebastian.huber at
Tue Jun 4 14:28:22 UTC 2013

Hello Hengyi,

On 06/03/2013 05:11 PM, Deng Hengyi wrote:
> Hi Sebastian,
> 	In original the proposal of the atomic project there is a roadmap of switching to C11 atomic API completely along the time. So if the C11 is mature and used by RTEMS i am very glad to switch to it.

C11 is mature.  The question is if the GCC C11 support is mature enough (at 
least the features we are interested in).  According to wiki page GCC 4.7 was the first supporting C11 atomics.

I suppose we have to add a <stdatomic.h> to Newlib, e.g. the one from FreeBSD:

> 	But i have some concern as below:
> 	1. Whether C11 support all the architecture used in RTEMS? (some architectures should not be supported if they are lack of atomic instructions)

I think the atomics are only interesting for RTEMS targets with SMP support.

> 	2. If C11 does not support some architecture how to we make the atomic API unified?

If C11 support is not available for an architecture, then this is bad luck for 
the architecture vendor.

> 	3. Also should consider the UP mode support.

It is highly use case dependent if an UP mode makes sense.  If you have for 
example a spin lock used in task and interrupt context, then you have to ensure 
that the critical section is also protected by disabled interrupts.  Some 
lock-free list operations on the other hand may work for some architectures 
even without disabled interrupts.  In general operations performed by 
interrupts and tasks should be protected by disabled interrupts.  Thus the UP 
case is included anyway.

Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

More information about the users mailing list