A large prime number is not something easily defined as atomic best define something else but lets assume that your large prime is a 32bit integer and your cpu guarantees that all 32bit read and write are atomic then No you assume that the reading thread will read after at least one writing thread has written a number which is.... well.... unsafe.
Sorry I should be more clear what i meant with large. Desepite of 1,2,3,5,7,11,13 which all share the same high-bytes, I meant 32-bit primes, not really large prime like (2^57,885,161 − 1).
So the only unsafe thing is that i could read the initialization value, because no thread has written to it.
So putting the initialization value to the set (or simply init the thing with a value of the set),
Is it still possible to get a variable not in the set ? Or even worse is it possible that the program hangs, blocks or does a SIGSEGV ?