struct rectangle {
uint64_t x = 0;
uint64_t y = 0;
uint64_t dummy[6];
};
int rect_construct(PMEMobjpool *pop, struct rectangle *rect)
{
rect->y = 10;
rect->x = 5;
pmemobj_persist(pop, rect, sizeof *rect);
return 0;
}
Hi all !
I have some questions about the above code. When executing rect_construct funtion,system crashes.
Assuming that the architecture is x86, x and y are in the same cacheline.
Obviously, the value recorded on PM may be(x=5,y=10) , or(x=0,y=0), or (x=0,y=10).
Is it possible to cause (x=5, y = 0)? It is said that x86-TSO can guarantee that this will not happen,I'm not sure.
Thanks!