大家好,又见面了,我是全栈君。
g++ -o eat -fopenmp eat.cpp #include "stdio.h" int main(int argc, char *argv[]) { #pragma omp parallel { while(1) { int c = 0; for(int i=0; i<(1<<30); ++i) { c += c*i; } } printf("hello multicore user!\n"); } return(0); }
然后CPU占用接近100%了。
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/108601.html原文链接:https://javaforall.net