Version 8 (modified by WeiY, on Aug 14, 2012 at 5:54:51 PM) (diff)

Atomic Operations


  • Chris Johns


  • Deng Hengyi



Candidate APIs / Implementations

Goal: To provide RTEMS with core services to solve synchronization problems on multicore platforms.


  • Advanced C and assembly language programming
  • Familiarity with RTEMS kernel software architecture
  • Understand concurrency problems and solutions



  • Who helped and did work?

Miscellaneous Sections

As the project progresses, you will need to add build instructions, etc and this page will evolve from a project description into a HOWTO.


A candidate for this project is the ConcurrencyKit? (ck). Among other targets, ck works on the 32-bit x86 architecture, so a first step would be to try compiling ck with rtems for pc386 and run a sample application under QEMU. Once a sample application is working, the next step would be to get as much of the ck regression suite to run as possible. Beyond that are many possible directions. Potential students should ask on the mailing list and work with potential mentors to design a project that suits their abilities and goals.

FreeBSD Atomic

The FreeBSD Atomic Operations API defines a set of atomic operations that can then be used to build solutions to concurrency problems. The FreeBSD implementations support a lot of target architectures, so there is more freedom to pick a starting point.

NetBSD Atomic

The NetBSD kernel implements seven classes of atomic memory operations. In the NetBSD kernel if the architecture provides compare and swap (CAS) each atomic operations is built on CAS. If the architecture does not provide hardware support for atomic compare and swap (CAS), atomicity is provided by a restartable sequence or by a spinlock.

C11 and C++11 Atomic

The end of 2011 brought new releases of both the C and C++ standards for the first time both of which contain a new set of atomic types and operations. The older versions of C and C++ had no support for atomic operations at all. The older versions of GCC and Clang provide the _sync_* family of built-in functions, which provide some atomic operations support. The GCC 4.7(or newer) and latest version Clang has provided built-in functions approximately match the requirements for C++11 memory model.


  • TBD

Other sections: If you have more to say about the project that doesn't fit in the proposed sections of this template, feel free to add other sections at will.