?? processschedule.java~43~
字號(hào):
package cn.edu.cauc.crab.ossimulate;import java.util.*;/** * <p>Title: OS simulate</p> * <p>Description: This is my home work.</p> * <p>Copyright: Copyleft (c) 2004</p> * <p>Company: CAUC</p> * @author Crab * @version 0.1 *//** * PCB for scheduling. * just use for scheduling. * * @author Crab * @version 0.1 */class PCB { //init when the process arrive Process process; int arriveTime;// when process add to queue. int serveTime;// the cpu time process need. int leftTime;// left how long the process will end. int beginTime;// when process beging to work. int finishTime;// process finish the work. int rollTime;// = finishTime - arriveTime int nullWorkRate;// = rollTime / serveTime}/** * To simulate process scheduling. * * @author Crab * @version 0.1 */public class ProcessSchedule { List PCBs;// pcb container public ProcessSchedule() { PCBs = new LinkedList(); } public void addProcess(Process process, int arriveTime) { PCB pcb = new PCB(); pcb.process = process; pcb.arriveTime = arriveTime; pcb.serveTime = process.getTime(); pcb.leftTime = pcb.serveTime; PCBs.add(pcb); } /* //For the Unit test. public static void main(String[] args) { ProcessSchedule pSch = new ProcessSchedule(); pSch.addProcess(new Process(10), 5); PCB pcb = (PCB)pSch.PCBs.get(0); System.out.println(pcb.arriveTime); } */}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -