Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
PMEMcond alignment confusion #358
In src/include/libpmemobj/thread.h three structs are defined, all of them with a 1 char alignment requirement, and 64 char size :
The original intention was likely to force 64 char alignment, but it was futile.
This should not be a problem, as long as simple integer accesses are used on x86_64 ( such unaligned accesses work with any instruction on current x86_64 as far as I know ).
Priority: 2 high
Priority: 3 medium
Dec 1, 2016
The potential solution could be to always use atomic (LOCK-prefixed) instructions when accessing PMEM lock members, as for locked instructions, the atomicity of the operation is guaranteed even if the memory access is unaligned or if it crosses the cache line boundary (at least on x86_64).