i want to mesure the number of processor cycle used in communication between two threads in openmp program .
my program consist of thread 0 write a matrix 1000*1000 and thread 1 read the matrix
-we used rdtsc() to count the number of cycle but i m not sure that thread 0 is runing on core 1 and thread 1 is runing on core 2 .
i want a function that help me to place thread 0 in core 1 and thread 1 in core 2
You can lock each thread to run on a specific processor or group of processors. The technique may vary depending on your operating system and tools. Using Microsoft Visual Studio Use SetThreadAffinityMask to specify a bit mask of processors on which the thread is restricted to running on. See documentation for how to make the call.