<html><head></head><body bgcolor="#FFFFFF"><div><br></div><div><br>在 2012-3-27,15:27,Ralf Corsepius <<a href="mailto:ralf.corsepius@rtems.org">ralf.corsepius@rtems.org</a>> 写道:<br><br></div><div></div><blockquote type="cite"><div><span>On 03/26/2012 06:19 PM, Thomas Doerfler wrote:</span><br><blockquote type="cite"><span>Hi,</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>I am a bit confused about this discussion. I havn't looked into the</span><br></blockquote><blockquote type="cite"><span>RTEMS/GSOC project related to atomic support, but I agree with Sebastian</span><br></blockquote><blockquote type="cite"><span>that it doesn't make sense to implement an RTEMS-specific atomic API</span><br></blockquote><blockquote type="cite"><span>that would replace the C11 standard API.</span><br></blockquote><span></span><br><span>I agree in sofar as C11 could be a promise about an emerging, future standard.</span><br><span></span><br><span>So far, IMO, C11 is too young to be considered stable and established standard and to be utilized as foundation of works.</span><br><span></span><br><span>[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]</span><br><span></span><br></div></blockquote>Really, we should make c<span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); "><font class="Apple-style-span" color="#000000">areful evaluation of the stability of C11 atomic support when it will be used by RTEMS.</font></span><div><div><div><blockquote type="cite"><div><blockquote type="cite"><span></span>What might make sense is to<br></blockquote><blockquote type="cite"><span>- develop an API for RTEMS synchronization/kernel services which is ON</span><br></blockquote><blockquote type="cite"><span>TOP of the C11 atomic standard</span><br></blockquote><span></span><br><span>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.</span><br><span></span><br><span> 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.</span><br><span></span><br></div></blockquote>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.<br><blockquote type="cite"><div><blockquote type="cite"><span>- develp support routines (maybe in newlib, maybe in RTEMS) that</span><br></blockquote><blockquote type="cite"><span>implements a synchronization function.</span><br></blockquote><span></span><br><span>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).</span><br><span></span><br><span>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.</span><br><span></span><br><blockquote type="cite"><span>Maybe for the discussion the following wiki page might help:</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span><a href="http://gcc.gnu.org/wiki/Atomic">http://gcc.gnu.org/wiki/Atomic</a></span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>It lists the architectures that GCC directly supports for atomics. All</span><br></blockquote><blockquote type="cite"><span>other architectures (including ARM, M68K) require library support to get</span><br></blockquote><blockquote type="cite"><span>atomic operations to work properly. So at least _this_ would be work</span><br></blockquote><blockquote type="cite"><span>that requires doing.</span><br></blockquote><span>Well, IMO, The state Atomics in GCC currently is in speaks for itself.</span><br><span>It's an Herculanean effort, which not even the GCC folks are able to implement on the broadness which would actually be required.</span><br><span></span><br><span>Ralf</span><br><span>_______________________________________________</span><br><span>rtems-users mailing list</span><br><span><a href="mailto:rtems-users@rtems.org">rtems-users@rtems.org</a></span><br><span><a href="http://www.rtems.org/mailman/listinfo/rtems-users">http://www.rtems.org/mailman/listinfo/rtems-users</a></span><br></div></blockquote></div></div></div></body></html>