Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

When accessing a bit-field, a thread may inadvertently access a separate bit-field in adjacent memory. This is because compilers are allowed required to store multiple adjacent bit-fields in one storage unit whenever possible. Consequently, data races may exist not just on a bit-field accessed by multiple threads but also on other bit-fields sharing the same byte or word.  A similar problem is discussed in CON00-C. Avoid race conditions with multiple threads, but this issue can be harder to diagnose because it is not immediately obvious that the same memory location is being modified.

...