全文预览

处理机调度模拟程序-----操作系统课程设计

上传者:科技星球 |  格式:doc  |  页数:22 |  大小:85KB

文档介绍
Рpublic void run(){Р}Рpublic void workMethod(int id,int sletim){РSystem.out.println();РSystem.out.println("Process"+id+":: Start running!!!");РSystem.out.println();РDate date1 = new Date();РSystem.out.println("开始时间:"+(date1.toString()).substring( 10,20));Р/*?帮助调试线程的执行Р* try {Р* wait();Р}catch(Exception e){РSystem.out.println("Process"+processID+" 有异常:"+e.toString() );Р}Р*/Рint sleeptime =sletim;РSystem.out.println("sleep time"+sleeptime);Рfor(int i =0;i<20;i++){Рvariable=variable+i;Р}Рtry {Рsleep(sleeptime);Р//sleep(sleeptime);Р}catch(Exception e){РSystem.out.println(e.toString() );Р}РSystem.out.println("Process"+id+":: Finished!!!");РDate date2 = new Date();РSystem.out.println("结束时间:"+(date2.toString()).substring( 10,20));РSystem.out.println("执行后的公共变量是:"+variable);РSystem.out.println();Р}

收藏

分享

举报
下载此文档