threads[i].setPriority(Thread.MAX_PRIORITY); }else if(i >= (num / 3) && i < (num / 3) * 2){//部分线程设置为中级线程 threads[i] = new SleepThread("中优先级线程-" + i); threads[i].setPriority(Thread.NORM_PRIORITY); }else{//
In addition to the errors indicated above, setpriority() may fail if: EPERM A process was located, but its effective user ID did not match either the effective or the real user ID of the caller, and was not privileged (on Linux: did not have the CAP_SYS_NICE capability). But see ...