(完整word版)操作系统实验报告实验一进程管理.pdf
-
资源ID:55117845
资源大小:157.37KB
全文页数:9页
- 资源格式: PDF
下载积分:4.3金币
快捷下载
会员登录下载
微信登录下载
三方登录下载:
微信扫一扫登录
友情提示
2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
|
(完整word版)操作系统实验报告实验一进程管理.pdf
1 实验一进程管理一、目的进程调度是处理机管理的核心内容。本实验要求编写和调试一个简单的进程调度程序。通过本实验加深理解有关进程控制块、进程队列的概念,并体会和了解进程调度算法的具体实施办法。二、实验内容及要求1、设计进程控制块PCB 的结构(PCB 结构通常包括以下信息:进程名(进程ID)、进程优先数、轮转时间片、进程所占用的CPU 时间、进程的状态、当前队列指针等。可根据实验的不同,PCB 结构的内容可以作适当的增删)。为了便于处理,程序中的某进程运行时间以时间片为单位计算。各进程的轮转时间数以及进程需运行的时间片数的初始值均由用户给定。2、系 统 资 源(r1rw),共 有w 类,每 类 数 目 为r1 rw。随机 产 生n 进 程Pi(id,s(j,k),t),0=i=n,0=j=m,0=k=dt 为总运行时间,在运行过程中,会随机申请新的资源。3、每个进程可有三个状态(即就绪状态W、运行状态R、等待或阻塞状态B),并假设初始状态为就绪状态。建立进程就绪队列。4、编制进程调度算法:时间片轮转调度算法本程序用该算法对n 个进程进行调度,进程每执行一次,CPU 时间片数加1,进程还需要的时间片数减 1。在调度算法中,采用固定时间片(即:每执行一次进程,该进程的执行时间片数为已执行了1个单位),这时,CPU 时间片数加1,进程还需要的时间片数减1,并排列到就绪队列的尾上。三、实验环境操作系统环境:Windows 系统。编程语言:C#。四、实验思路和设计1、程序流程图2 对进程进行初始化,建立就绪队列、阻塞队列。Input()触发时钟,调用时间片轮转调度算法。runFcfs()取就绪队列的第一个进程,判断其运行的时间片是否达到所需次数。如果达到,则释放资源如果没达到,则运行一个时间片。running()输出就绪队列和阻塞队列的信息。outputall()就绪队列为空?检查阻塞队列,对于当前资源数目满足阻塞队列的进程,由阻塞转入就绪队列。testblock()检查是否有新进程产生,如果有,则判断系统资源是否够用,如果够用,则分配给该进程,插入就绪队列。如果不够用,则插入阻塞队列。testnew()显示三类资源情况。rescore()结束开始是否文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M33 2、主要程序代码/PCB 结构体struct pcb public int id;/进程 ID public int ra;/所需资源A 的数量public int rb;/所需资源B 的数量public int rc;/所需资源C 的数量public int ntime;/所需的时间片个数public int rtime;/已经运行的时间片个数public char state;/进程状态,W(等待)、R(运行)、B(阻塞)/public int next;ArrayList hready=new ArrayList();ArrayList hblock=new ArrayList();Random random=new Random();/ArrayList p=new ArrayList();int m,n,r,a,a1,b,b1,c,c1,h=0,i=1,time1Inteval;/m为要模拟的进程个数,n 为初始化进程个数/r 为可随机产生的进程数(r=m-n)/a,b,c 分别为 A,B,C 三类资源的总量/i 为进城计数,i=1n/h 为运行的时间片次数,time1Inteval 为时间片大小(毫秒)/对进程进行初始化,建立就绪数组、阻塞数组。public void input()/对进程进行初始化,建立就绪队列、阻塞队列 m=int.Parse(textBox4.Text);n=int.Parse(textBox5.Text);a=int.Parse(textBox6.Text);b=int.Parse(textBox7.Text);c=int.Parse(textBox8.Text);a1=a;b1=b;c1=c;r=m-n;time1Inteval=int.Parse(textBox9.Text);timer1.Interval=time1Inteval;for(i=1;i=0&(b-jincheng.rb)=0&(c-jincheng.rc)=0)a=a-jincheng.ra;b=b-jincheng.rb;c=c-jincheng.rc;jincheng.state=W;hready.Add(jincheng);/加入就绪队列 else jincheng.state=B;hblock.Add(jincheng);/加入阻塞队列 listBox1.Items.Add(当前进程状态:+jincheng.state);/从数组起始地址开始输出该数组的内容public void disp(ArrayList list)ArrayList list1=new ArrayList();list1=list;if(list1.Count 0)for(int j=0;j list1.Count;j+)pcb p=(pcb)list1j;listBox1.Items.Add(+p.id.ToString()+p.state.ToString()+p.ra.ToString()+p.rb.ToString()+p.rc.ToString()+p.ntime.ToString()+p.rtime.ToString()+rn);else listBox1.Items.Add(rnt 该队列中没有进程!rn);/输出就绪数组和阻塞数组的信息public void outputall()listBox1.Items.Add(rn=CPU运行了:+h.ToString()+次=rn);文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M35 listBox1.Items.Add(*当前就绪队列的信息!*);listBox1.Items.Add(进程 ID 进程状态A 资源数B 资源数C 资源数所需时间片已运行时间片);disp(hready);listBox1.Items.Add(*当前就阻塞列的信息!*);listBox1.Items.Add(进程 ID 进程状态A 资源数B 资源数C 资源所需时间片已运行时间片);disp(hblock);/运行就绪数组的头进程,运行一个时间片,轮转一个时间片,时间片轮转调度算法public void running()ArrayList hready1=new ArrayList();hready1=hready;pcb p1=new pcb();p1=(pcb)hready10;p1.state=R;p1.rtime=p1.rtime+1;h=h+1;listBox1.Items.Add(rn当前正在运行进程ID 是:+p1.id+rn);listBox1.Items.Add(rn进程 ID 进程状态A 资源数B 资源数C 资源数所需时间片已运行时间片 rn);listBox1.Items.Add(p1.id+p1.state+p1.ra+p1.rb+p1.rc+p1.ntime+p1.rtime);if(p1.ntime=p1.rtime)listBox1.Items.Add(p1.id.ToString()+的进程已经完成!rn);a=a+p1.ra;b=b+p1.rb;c=c+p1.rc;hready.RemoveAt(0);else p1.state=W;hready1.Add(p1);hready.RemoveAt(0);/检测当前资源数目是否满足阻塞数组里进程的需求public void testblock()ArrayList hblock1=new ArrayList();hblock1=hblock;for(int m=0;m=0)&(b-p1.rb=0)&(c-p1.rc=0)p1.state=W;hready.Add(p1);a=a-p1.ra;b=b-p1.rb;c=c-p1.rc;listBox1.Items.Add(ID号为:+p1.id+的进程由阻塞队列转入就绪队列rn);hblock.RemoveAt(m);m-;/检测是否有新的进程产生,随机产生新进程public void testnew()int t;if(r0)/r 为随机产生的进程数目 t=random.Next(9)+1;if(t=0&(b-jincheng.rb)=0&(c-jincheng.rc)=0)a=a-jincheng.ra;b=b-jincheng.rb;c=c-jincheng.rc;jincheng.state=W;listBox1.Items.Add(进程状态为:+jincheng.state);hready.Add(jincheng);/加入就绪队列listBox1.Items.Add(资源满足新进程请求,该进程进入就绪队列rn);文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M37 else jincheng.state=B;hblock.Add(jincheng);/加入阻塞队列listBox1.Items.Add(进程状态为:+jincheng.state);listBox1.Items.Add(资源不满足新进程请求,该进程进入阻塞队列rn);r=r-1;/系统三类资源变化情况的显示public void rescore()/系统三类资源变化情况的显示 if(a a1)textBox1.Text=a1.ToString();if(a=0&a b1)textBox2.Text=b1.ToString();if(b=0&b c1)textBox3.Text=c1.ToString();if(c=0&c 0)outputall();running();testblock();testnew();rescore();else timer1.Enabled=false;textBox1.Text=a1.ToString();textBox2.Text=b1.ToString();textBox3.Text=c1.ToString();listBox1.Items.Add(rnrn);/计时器触发时间片轮转调度算法private void timer1_Tick(object sender,EventArgs e)文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M38 runFcfs();/开始模拟按钮单击执行函数private void button1_Click(object sender,EventArgs e)runmain();button1.Enabled=false;textBox1.Enabled=false;textBox2.Enabled=false;textBox3.Enabled=false;textBox4.Enabled=false;textBox5.Enabled=false;textBox6.Enabled=false;textBox7.Enabled=false;textBox8.Enabled=false;textBox9.Enabled=false;/清除屏幕按钮单击执行函数private void button2_Click(object sender,EventArgs e)textBox1.Text=;textBox2.Text=;textBox3.Text=;textBox4.Text=;textBox5.Text=;textBox6.Text=;textBox7.Text=;textBox8.Text=;textBox9.Text=;listBox1.Items.Clear();textBox4.Enabled=true;textBox5.Enabled=true;textBox6.Enabled=true;textBox7.Enabled=true;textBox8.Enabled=true;textBox9.Enabled=true;button1.Enabled=true;/运行的主函数public void runmain()input();imer1.Enabled=true;文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M3文档编码:CD3K3U6M6K8 HY9S5W4S9L1 ZQ3D1Y3D3M39 3、运行界面和运行结果界面中,可以任意设定需要模拟的进程总数(如5),初始化进程个数(如3),还有 A、B、C 三类资源的总数(如10、10、10)。为了方便显示,还可以设定时间片的长度(如500 毫秒)。除此之外,在运行过程中,所有的资源都是随机生成的,并且其中新进程的产生也是随机的,但是产生的进程总数不会多于开始设定的模拟的进程总数,以防止不断产生新进程,程序不断运行。在显示窗口的上方,还会实时显示资源的变化情况,方便对运行的观察。当运行结束后,可以通过工具栏中的显示选项中的保存结果按钮,将结果保存成txt 文件格式,方便运行后的结果分析。五、心得体会本次实验,我的任务是设计一个允许n 个进程并发运行的进程管理模拟系统。该系统包括有简单的进程控制、同步与通讯机构,系统在运行过程中能显示各进程的状态及有关参数的变化情况,从而