I am just starting to study multi-core architecture and I mean the question. I have a test application that takes the number of threads as an argument, creates these threads, sets the affinity (using sched_setaffinity), and then has a busy cycle (while (1)) in each thread task. I am using Fedora 19 VM (3.11.9-200.fc19.x86_64) with 4 processors. Now, when I create 4 threads, set their proximity to 4 different processors, the processor load is even small. What is it like:
PID USER PR NI VIRT RES SHR S% CPU% MEM TIME + COMMAND
2113 root 20 0 0 0 0 R 92.90 0.000 18: 22.91 multicolor
2114 root 20 0 0 0 0 R 92.23 0.000 18: 07.29 multicolor
2112 root 20 0 0 0 0 R 49.28 0.000 9: 41.48 multicolor
2111 root 20 0 0 0 0 R 48.61 0.000 9: 42.17 multicolor
2110 root 20 0 0 0 0 Z 0.000 0.000 0: 00.00 multicolor
Can someone give me an explanation why the 3rd and 4th cores are not as busy as the first two, although they have the same thread function?
It really helps.
thank
source
share