设计一个按时间片轮转法实现处理器调度的程序 (1)假定系统有5个进程,每个进程用一个PCB来代表。PCB的结构为: • 进程名——如Q1~Q5。 • 指针——把5个进程连成队列,用指针指出下一个进程PCB的首地址。 • 要求运行时间——假设进程需要运行的单位时间数。 • 已运行时间——进程已运行的单位时间数,初始值为0。 • 状态——假设两种状态,就绪和结束,用R表示就绪,用E表示结束。初始状态都为就绪状态。 (2) 每次运行之前,为每个进程任意确定它的“要求运行时间”。 (3) 把5个进程按顺序排成循环队列,用指针指出队列连接情况。用一个标志单元记录轮到运行的进程。处理器调度总是选择标志单元指示的进程运行,对所指的进程,将其“已运行时间”加1。 (4) 进程运行一次后,若“要求运行时间”等于“已运行时间”,则将状态改为“结束”,退出队列,否则将继续轮转。 (5) 若就绪队列为空,结束,否则转到(3)重复。
上传时间: 2013-12-13
上传用户:asddsd
此程序求圆的周长和面积,输入r,解出周长面积
标签: 程序
上传时间: 2016-06-02
上传用户:duoshen1989
C++STL STL(Standard Template Library,标准模板库)是惠普实验室开发的一系列软件的统称。它是由Alexander Stepanov、Meng Lee和David R Musser在惠普实验室工作时所开发出来的。现在虽说它主要出现在C++中,但在被引入C++之前该技术就已经存在了很长的一段时间。 STL的代码从广义上讲分为三类:algorithm(算法)、container(容器)和iterator(迭代器),几乎所有的代码都采用了模板类和模版函数的方式,这相比于传统的由函数和类组成的库来说提供了更好的代码重用机会。在C++标准中,STL被组织为下面的13个头文件:<algorithm>、<deque>、<functional>、<iterator>、<vector>、<list>、<map>、<memory>、<numeric>、<queue>、<set>、<stack>和<utility>。以下笔者就简单介绍一下STL各个部分的主要特点。
标签: STL Standard Template Library
上传时间: 2016-06-20
上传用户:cylnpy
The last step in training phase is refinement of the clusters found above. Although DynamicClustering counters all the basic k-means disadvantages, setting the intra-cluster similarity r may require experimentation. Also, a cluster may have a lot in common with another, i.e., sequences assigned to it are as close to it as they are to another clusteR. There may also be denser sub-clusters within the larger ones.
标签: DynamicClusteri refinement Although clusters
上传时间: 2014-01-04
上传用户:watch100
熟悉用单片机产生声音的方法 硬件要求:拨码开关S10的第3位置ON,其他位置OFF LIST P=16F877A,R=DEC 定义器件,默认为十进制
上传时间: 2013-12-26
上传用户:wpwpwlxwlx
/*快速排序采用分治算法,将所需要排序的内容从文件读入放入数组a[p:r],按以下三个步骤进行排序 以a[p]为基准元素将数组分为三段,将大于基准元素的放到后面的单元,小的放到前面的单元, 再用递归对a[p:q-1],a[q+1:r]进行排序,最后合并 时间复杂度:最坏时间复杂度:O(n2) 平均时间复杂度:O(nlogn) */
上传时间: 2016-06-29
上传用户:chenbhdt
压缩目录下的Test_USB_Test.exe是PC侧的应用程序,dsp5509_10MHz_clk.out、dsp5509_12MHz_clk.out、和dsp5509_16MHz_clk.out是分别针对5509时钟为10M、12M和16M的out文件。基于ccs2.2开发。 在ccs2.2中load针对自己硬件平台的.out文件,用USB线连接好5509与PC,运行.out,会提示检测到USB设备,指定driver目录下的驱动即可。 再运行Test_USB_Test.exe,其操作格式为Test_USB_Test.exe w 32 r 32 即从PC向dsp写入32个字符,再读取32个5509返回的字符,在dsp上将输入的字符做了简单的+1操作。
标签: Test_USB_Test exe 目录 应用程序
上传时间: 2016-06-29
上传用户:小草123
pashload是应用在linux下的网络带宽测试源程序精确度比较高 ///////////////////////////////////// Pathload is a tool for estimating the available bandwidth of an end-to-end path from a host S (sender) to a host R (receiver). The available bandwidth is the maximum IP-layer throughput that a flow can get in the path from S to R, without reducing the rate of the rest of the traffic in the path.
标签: pashload Pathload linux tool
上传时间: 2016-06-29
上传用户:xzt
DESProcess FILE *mfp,*cfp int ttch=0,xorRes,ttbitdiff=0 char mch,cch float bdiff=0 if((mfp=fopen(mfile,"r"))==NULL) {cout<<"Cannot open the file to compare"<<endl } if((cfp=fopen(cfile,"r"))==NULL) {cout<<"Cannot open the file to compare"<<endl } else { while(!feof(mfp)&!feof(cfp)) { ttch++ mch=fgetc(mfp) cch=fgetc(cfp) xorRes=mch^cch ttbitdiff+=(xorRes&1)+(xorRes&2)/2+(xorRes&4)/4+(xorRes&8)/8+(xorRes&16)/16+(xorRes&32)/32+(xorRes&64)/64+(xorRes&128)/128 } bdiff=float(ttbitdiff)*100/float(ttch*8) } *bitdiff8byte=float(ttbitdiff)*100/float(8*8) return bdiff
标签: DESProcess ttbitdiff xorRes bdiff
上传时间: 2016-07-02
上传用户:1079836864
快速排序算法是基于分治策略的另一个排序算法。其基本思想是,对于输入的字数组a[p:r],按以下3个步骤进行排序: (1)分解:以a[p]为基准元素将a[p:r]划分成3段a[p:q-1],a[q]和a[q+1:r],使得a[p:q-1]中任何元素小于等于a[q],a[q+1:r],中的任何元素大于等于a[q]。下标q在划分过程中确定 (2)递归求解:通过递归调用快速排序算法,分别对a[p:q-1]和a[q+1:r]进行排序 (3)合并:在a[p:q-1]和a[q+1:r]已经排好序的情况下,不需要执行任何运算,a[p:r]就已排好序 平均算法复杂度O(nlogn)
上传时间: 2016-07-09
上传用户:wuyuying