Threads are often scheduled to execute on CPU 0
The execution of the encode thread of our program is very time-consuming. Using WPR to record the CPU usage, and opening it with WPA, it is found that the execution time of the thread on CPU 0 is too long. The remote desktop connects to the computer, the execution time on CPU 0 becomes shorter, and the encoding thread returns to normal. In addition, turn off CPU 0 in Task Manager-set affinity , and the encode thread can also return to normal.
CPU:11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz 2.42 GHz
System:Windows10 21H2 19044.1288
abnormal:
normal(the execution time on CPU 0 becomes shorter):