?? roundscheduler.java
字號:
import java.util.Random ;
public class RoundScheduler extends Scheduler {
public int quant ;
private int pronow ;
public RoundScheduler() {
quant =1 ;
pronow=0;
}
public synchronized void run() {
while (true) {
int noProcs = processList.size() ;
if (noProcs == 0) System.exit(0) ;
int next = (pronow)%noProcs ;pronow++;
// for(int i=0;i<noProcs;)
SimProc nextRunner = (SimProc) processList.elementAt(next) ;
synchronized(nextRunner) { nextRunner.notify() ;}
try { wait() ;}
catch (Exception e) {
System.out.println("Unexpected interrupt in run " + e) ;
}
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -