Project about Atomic Operations

Yang Wei wei.a.yang at gmail.com
Tue Mar 27 08:57:28 UTC 2012



在 2012-3-27,15:27,Ralf Corsepius <ralf.corsepius at rtems.org> 写道:

> On 03/26/2012 06:19 PM, 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.
> 
> I agree in sofar as C11 could be a promise about an emerging, future standard.
> 
> So far, IMO, C11 is too young to be considered stable and established standard and to be utilized as foundation of works.
> 
> [Remember how long it took until comparable precessors (c89, c99) were stable and well established. Their implementation timeframes were measured in decades - I'd be surprised, if c11 would be different]
> 
Really, we should make careful evaluation of the stability of C11 atomic support when it will be used by RTEMS.
>> What might make sense is to
>> - develop an API for RTEMS synchronization/kernel services which is ON
>> TOP of the C11 atomic standard
> 
> One option I see, would be to treat c11-atomics as optional and conditional and to consider their API as API-template for RTEMS specific atomics.
> 
> This would mean, if C11 should be adopted for RTEMS, I'd recomment RTEMS to implement an RTEMS-specific wrapper layer, which optionally and conditionally may utilize c11-atomics as one potential implementation option underneath.
> 
Yes, I agree with ralf. Firstly we can refer the atomic API definition of C11 and design the compatible API on the RTEMS. And also we do not need implement all the API it supports. At least the atomic primitives on which the synchronization primitives is built should be provided.
>> - develp support routines (maybe in newlib, maybe in RTEMS) that
>> implements a synchronization function.
> 
> On a wider scope, I think, one would have to analyse whether c11-atomics actually meet RTEMS demands and ... whether lowlevel atomic operations are actually necessary and/or useful, rsp. if some atomics aren't better implemented on higher levels (e.g. using RTEMS score functions).
> 
> At least I would rather avoid any low level, RTEMS-specific (esp. ASM) atomic operations, because such low level code in longer terms often turns into a nightmare.
> 
>> Maybe for the discussion the following wiki page might help:
>> 
>> http://gcc.gnu.org/wiki/Atomic
>> 
>> 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.
> Well, IMO, The state Atomics in GCC currently is in speaks for itself.
> It's an Herculanean effort, which not even the GCC folks are able to implement on the broadness which would actually be required.
> 
> Ralf
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20120327/c75d95e1/attachment.html>


More information about the users mailing list