Closed lluckydog closed 7 months ago
One possibility is that core_affinity
is returning one CoreId
for each CPU thread. On a typical CPU with SMT, this means 2 CoreId
s per physical CPU. As a result, by scheduling the three threads on the first three CoreId
s, two of them end up running on the same CPU and contending with each other's resources.
You could try to spread out your core choices (e.g. cores 0, 2, and 4) and see if that fixes the issue.
Also, if you have one of the newer Intel CPUs with the P/E architecture, make sure you're binding to the P cores, not the E cores.
Thank you for your kind reply. I found the CPU with SMT in my situation, and your first advice helped me a lot!
I'm very impressed about the performance in the crossbeam library. However, when I bind CPU to the thread, the channel seems to perform poorly. I wonder if I mistake with anything? The result is listed below:
the code is like follows: