3 ms·
Don't the standard synchronization APIs documented in the article handle memory barriers for you?
by 01100011 7y ago
Don't the standard synchronization APIs documented in the article handle memory barriers for you?
- rrss 7y agoYes. As long as you use correctly-constructed synchronization primitives (e.g. pthreads), you don't need to worry about memory consistency. When you need to start worrying is when you start implementing your own synchronization (either rolling your own primitives or going lock-free). 'moring needs to clarify what they are talking about. It's perfectly possible to write correct code using pthreads on modern hardware with no understanding of memory consistency.