Priority: Not specified
Affects Version/s: None
Fix Version/s: 6.0.0
There are various multi threading patterns which frequently occur in our code, but there is often some confusion over whether critical sections/locks/memory barriers are required.
- Setting a boolean on one thread, and accessing from another. [And any reordering issues of code before/after]
- Incrementing a value from one thread and checking from another
- Decrementing a value from one thread and checking from another
- check boolean, get lock, check boolean again
- Reusing the same value set from another thread gives consistent values.
X86/64 is strongly ordered, but other platforms powerpc/arm may expose problems in the existing implementation.
One question is whether we need to switch to c++11 in order to obtain the necessary atomic memory ordering constraints.