celix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [celix] Oipo edited a comment on pull request #214: Fix data race in get/set bundle state
Date Sun, 03 May 2020 20:16:10 GMT

Oipo edited a comment on pull request #214:
URL: https://github.com/apache/celix/pull/214#issuecomment-623172986

   So there are two ways to use atomics in C11: 
   1) ~~use the _Atomic specifier. No atomic functions are possible, but assign/increment/decrement
are all usable as normal and atomic. I believe these are all SEQ_CST operations, so everything
includes a memory fence now.~~ C++ does not support the _Atomic syntax and gives compile errors.
   2) Do not use the _Atomic specifier, but use atomic_init and assorted functions. This allows
for relaxing the memory model where needed, pollutes the code but eliminates the memory fences
and doesn't reduce performance. However, most operations are not in a hot loop so I believe
performance is not worth the polluting of code.
   ~~Which of the two should we go for?~~ I believe options 2 is the only sane way forward.

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:

View raw message