ni...@lysator.liu.se (Niels Möller) writes:

  Does C11 provide any way to initialize a local static variable, like in
  recent C++? I.e., not code running before main, but code running the
  first time the function is entered, and guaranteed to run just once?

  > I don't think volatile matters. AFAIK, what you need is _Atomic (C11).

  If we can make this thread safe with C11, I think it's fine to document
  that mini-gmp requires C11 for thread safety. (I'd still prefer the
  simpler way of reying on float.h constants, though).

Let's remind ourselves that we are not executing GMP on a standards
document, but on actual computer systems.  :-)

Store reordering is an actual problem which we should keep in mind (but
note that x86 implements total store ordering).  Non-atomic loads/stores
is not as long as we keep to short types.

-- 
Torbjörn
Please encrypt, key id 0xC8601622
_______________________________________________
gmp-devel mailing list
gmp-devel@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-devel

Reply via email to