Multithreading – OMP flush and CC NUMA architectures

I miss the CC NUMA architecture and the need to refresh variables As we all know, if two threads modify the same cache line, the "error sharing" condition will rise, forcing the cache line to reload again

int flag=0;

Then, in the parallel area, thread 0 allocates shared variables:

flag=1;

Thread 1:

while (!flag){}

Cycle not refreshed and terminated? If not, why are we in CC NUMA architecture?

Solution

Don't forget that the compiler can also perform optimizations that break the above code, not just the CPU

Therefore, I think that no matter whether the hardware supports cache consistency, it still needs to be refreshed

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>