操作系统优先级和时间片调度+内存管理(2)

2020-04-17 04:10

public int getMemoryLimit() { return this.MemoryLimit; }

public boolean equals(ProcessPCB pcb) {

if(pcb.getPID() == this.getPID()) { return true; }

else return false; }

public String toString() { return this.getPID() + \ +

this.getRequiredTime() + \ + this.getPriority() + \

+ this.getStatus() + \ +

this.getMemoryBase() + \ + this.getMemoryLimit() + \; }

public void run() {

if(this.RequiredTime!=0){

this.RequiredTime = this.RequiredTime-1; this.Priority = this.Priority-1;} } }

//这是进程存放和添加迭代器的类 package Final;

import java.util.ArrayList; import java.util.Iterator; public

class

PCBRecords

implements

Iterable {

private ArrayList PCBItems;

public ArrayList getPCBItems() { return this.PCBItems; }

public PCBRecords() {

this.PCBItems = new ArrayList(); }

public void addItem(ProcessPCB PcbItem) { this.PCBItems.add(PcbItem); }

public void removeItem(ProcessPCB PCbItem) { this.PCBItems.remove(PCbItem); }

public ProcessPCB getItem(ProcessPCB processPCB) {

for (ProcessPCB pCbItem : this.PCBItems) {

if (pCbItem.equals(processPCB)) { return pCbItem; }

} return null; }

public ProcessPCB getItem(String pid) { for (ProcessPCB pcBItem : this.PCBItems) {

if (pcBItem.getPID().equals(pid)) { return pcBItem; }

} return null; }

public int getNumberOfItems() { return this.PCBItems.size(); }

public String[] getItemsProperties() { String

itemsProperties[]

=

new

String[getNumberOfItems()];

int i = 0;

for(Iterator iterator1 = PCBItems.iterator(); iterator1.hasNext();) {

ProcessPCB

stu_Item =

(ProcessPCB)iterator1.next(); itemsProperties[i++] stu_Item.toString(); }

return itemsProperties; }

public Iterator iterator() { return this.PCBItems.iterator(); } }

//这是内存管理类 package Final;

public class MemoryItem { private int memoryBase=0; private int memoryLimit=0; private int availableStatus=0;

public MemoryItem(int initMemoryBase, int initMemoryLimit) {

this.memoryBase = initMemoryBase;

=


操作系统优先级和时间片调度+内存管理(2).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:认识色阶和曲线 - 图文

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: