I am using Ubuntu 18.10 and running my own program using terminal, which requires many calculations, but when I open task manager, terminal CPU usage (including running program) is never taking more than 26%. Here is very simple program, that behaves the same way. I would like to know, how can I force my program (or terminal) to use all of my CPU speed. I also tried to run multiple terminals and start program, or use threads in my code, but it appears that those 26% splits into these terminals, and run slowly. Is it terminal limit? How can I fix it and make program run faster? Thank you
#include <stdio.h>
int main(){
int a=0;
while(1){
printf("%d\n",a);
}
return 0;
}
EDIT: using just "a" instead of "a++", to avoid overflow