3 ms·
That's not sufficient on its own (leaving aside the problem of multiple initialization). While compare and swap will likely have the necessary write barrier bui
by rbehrends 13y ago
That's not sufficient on its own (leaving aside the problem of multiple initialization). While compare and swap will likely have the necessary write barrier built in, you need a matching read barrier when accessing the object.
I.e. reads could otherwise get re-ordered so that you see the pointer and the not-yet-initialized object at the same time.
- vy8vWJlco 13y agoRight. I was still thinking in terms of my thread-local-less model posted before when I wrote the above, which took for granted those barriers once past init.