基本信息
源码名称:操作系统调度模拟
源码大小:5.13KB
文件格式:.rar
开发语言:Java
更新时间:2020-07-17
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 2 元 
   源码介绍
该示例是模拟操作系统的PCB以及进程调度方式,实现内存分配、挂起、解挂、阻塞等模拟。



public class PCB {
    String name;//进程名  int time;//执行时间  int status=5;//1 就绪,2运行,3阻塞,4挂起,5后备  int priority;//进程的优先级  int memory_size;//进程所占的优先级大小  int memory_point;//进程第一个块指向的内存位置  boolean cooperation;//若为true,则为同步进程,反之,为false,为独立进程   }
String run()
{
    node head = ready_array.get(0); if(!findnode(pend_array,head.pre).data.name.equals("0"))
    {
        block(head);
    } else{
    head.data.time -= 1;
    head.data.priority -= 1; if (head.data.time <= 0) { ready_array.remove(head);
        free(head); // printMemory();  return head.data.name;
    }
} return "";
}