How can I detect false separation slowing performance?

I am setting up a high-performance multi-threaded application, and I suspect that a false exchange may be the reason why performance is poor. How can I verify that this is so?

I am running C ++ on Ubuntu 12.04 using gcc 4.82.

+4
source share
2 answers

I will post something that I just came across with C ++ Concurrency in action.

One way to check for a false exchange is to add huge blocks of indentation between data items that can be accessed by different threads at the same time.

struct protected_data
{
   std::mutex m;
   char padding[65536];
   my_data data_to_protect; 
}; 

, , .

+4

, , " , X ?" " Y ", : , .

, , . , (CODEXL AMD VTune Pro Intel), , .

.

+2