What can make a program run slower when using more threads?

后端 未结 7 1167
耶瑟儿~
耶瑟儿~ 2020-12-10 09:20

This question is about the same program I previously asked about. To recap, I have a program with a loop structure like this:

for (int i1 = 0; i1 < N; i1+         


        
7条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-10 09:42

    Off the top of my head:

    • Context switches
    • Resource contention
    • CPU contention (if they aren't getting split to multiple CPUs).
    • Cache thrashing

提交回复
热议问题