At my workplace there is a common powerful 24-core server on which we run our tasks. To use the full power of a multi-core processor, I wrote a multi-threaded version of a long-term program, so that 24 threads are simultaneously launched on each core (through the threading
library in Jython
).
The program runs quickly if there are no other tasks. However, I did a lot of work simultaneously on one core, and as a result, a thread running on that particular core took a long time, slowing down the entire program (since the threads had to join the data at the end). However, threads on other processors completed execution long ago - so I basically had 23 cores idle and 1 core worked with thread and hard work, or at least that's what my diagnosis is. This was further confirmed by looking at the output of the time
command, the sys time was very low compared to user time (which means a lot was expected).
In this case, the operating system ( Linux
) does not switch tasks to different CPUs if one processor is loaded and the other ones do not work? If not, can I do this in my program (in Jython
). Sometimes itβs not difficult to request different CPU loads, and then switch to one that is relatively free.
Thanks.
source share