I don't think that is a big issue.

Either the value isn't accessed often, and then it make no sense to cache it, or it is accessed often and it make sense to precalculate the cached value when building the object.

Doing the calculation at that point avoid synchronization cost involved otherwise.

People here talk about the atomicity of a pointer write. This is true, but the object pointed isn't guaranteed to be committed to memory, so synchronization is required anyway.

Reply via email to