Atomic Operations and Required Architecture Support for RTEMS SMP
sebastian.huber at embedded-brains.de
Wed Aug 28 13:19:36 UTC 2013
as part of a GSoC project we made the atomic operations API compatible with the
C11 operations and use them for the implementation. I added some tests today
and now begin to think if this was really such a good idea:
Surprisingly it seems that the atomic operations support is not shared by the C
and C++ compiler parts in GCC.
I just realized that the C11 atomic_flag type has no load operation. This
makes it not suitable to implement a simple test and test and set lock. So
this type is useless for us. The only special thing with atomic_flag is that
it is guaranteed to be lock free. This is the minimum requirement for atomic
This leads to the following question: What is the RTEMS (!) minimum requirement
for SMP support?
I think an architecture must support a compare and swap instruction or the load
linked and store conditional model. We should make it clear that a simple
atomic swap is not enough to support SMP.
Under this requirement we can remove the atomic flag from the RTEMS API.
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 embedded-brains.de
PGP : Public key available on request.
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
More information about the devel