On 2019-01-09, at 07:34:27, Mark Boonie wrote: > Speaking for myself, I would consider it "proper" to align the operands > and skip the CS -- the architecture guarantees the behavior, so doing the > update with CS seems like overkill. (I'd probably also add a comment in > the code for each operand pointing out the reason for the alignment > requirement). > > If alignment can't be ensured (e.g., you're passed some random address by > a caller) then that's a different story. > Does CS tell the right story, or does CS itself require alignment?
On 2019-01-09, at 05:06:09, Rob van der Heij wrote: > > The CPU cache is the other motivation to stay away from heavy use of shared > variables but keep things per CPU with a low-frequency distribution > process. When you keep the per-CPU objects far enough apart, you avoid > frequent invalidating cache lines on the sibling CPU. > Is there any hardware or software support for this? Operands nicely cache line separated today might be in the same line on next year's model. -- gil
