42
edits
Changes
→Synchronization
== Synchronization ==
The other way to eliminating false sharing is to implement a mutual exclusion construct. This the better method than using padding as there is no wasting of memory and cache lines are not rendered inaccessible due to being invalidated. Programming a mutual exclusion implementation is done by using the omp pragma critical. The critical section restricts statements to a single thread to process at a time, making variables local to a single thread.
=Conclusion =