barrier in os

barrier in os

how to implement bariier of threads in language c or c++.

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Do you mean a memory barrier or a thread synchronization barrier?

To implement a threading barrier, I recommend using OpenMP (see www.openmp.orgfor a specification). The Intel, Gnu, and Microsoft compilers all have OpenMP support in C/C++. These allow you to create threads with a simple pragma and synchronize them all with another simple pragma. Check your compiler documentation and search for the term "barrier" for details.

Leave a Comment

Please sign in to add a comment. Not a member? Join today