I have multiple threads reading same int variable.
and one thread is writing the value.
I don’t care about the race condition.
only my concern is writing and reading int value at same time is memory safe ?
and it will not result in any application crash .
Yes, that should be all right. The only way I can envision that crashing is if one of the threads deallocates the memory backing that integer. For best results I would also make sure the integers are aligned at
sizeof(int)boundaries. (Some CPUs cannot access integers at all without this alignment. Others provide weaker guarantees of atomicity for unaligned access.)