How to get 100% CPU usage from a C program

前端 未结 9 2539
半阙折子戏
半阙折子戏 2020-11-27 10:12

This is quite an interesting question so let me set the scene. I work at The National Museum of Computing, and we have just managed to get a Cray Y-MP EL super computer from

9条回答
  •  死守一世寂寞
    2020-11-27 10:52

    The reason you're getting 15% on a hex core processor is because your code uses 1 core at 100%. 100/6 = 16.67%, which using a moving average with process scheduling (your process would be running under normal priority) could easily be reported as 15%.

    Therefore, in order to use 100% cpu, you would need to use all the cores of your CPU - launch 6 parallel execution code paths for a hex core CPU and have this scale right up to however many processors your Cray machine has :)

提交回复
热议问题