My question is very simple.
Why Interlocked-Increment in multi-thread is slower than 1-thread?
Is it just because of Cache line bouncing(Cache line contention)?
Or is there another reason?
I'm using Intel i7, visual studio 2012. I tested counting number using Interlocked-Increment function. and test result was that.
1 Thread - 610385971
2 Thread - 497804468
3 Thread - 351516659
4 Thread - 333275249