批處理系統(tǒng)作業(yè)調(diào)度實驗(共7頁)_第1頁
批處理系統(tǒng)作業(yè)調(diào)度實驗(共7頁)_第2頁
批處理系統(tǒng)作業(yè)調(diào)度實驗(共7頁)_第3頁
批處理系統(tǒng)作業(yè)調(diào)度實驗(共7頁)_第4頁
批處理系統(tǒng)作業(yè)調(diào)度實驗(共7頁)_第5頁
已閱讀5頁,還剩2頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

1、精選優(yōu)質(zhì)文檔-傾情為你奉上 動態(tài)分區(qū)存儲管理方式的主存分配回收實驗報告年級 08級 學(xué)號 姓名 陳云云 成績 專業(yè) 數(shù)學(xué)與應(yīng)用數(shù)學(xué) 實驗地點 主樓402 指導(dǎo)教師 王碩 實驗項目 批處理系統(tǒng)作業(yè)調(diào)度 實驗日期 2010年10月27日 一、實驗?zāi)康?加深對作業(yè)概念的理解;深入了解批處理系統(tǒng)如何組織作業(yè)、管理作業(yè)和調(diào)度作業(yè);二、實驗要求編寫程序完成批處理系統(tǒng)中的作業(yè)調(diào)度,要求采用響應(yīng)比高者優(yōu)先的作業(yè)調(diào)度算法。實驗具體包括:首先確定作業(yè)控制塊的內(nèi)容,作業(yè)控制塊的組成方式;然后完成作業(yè)調(diào)度;最后編寫主函數(shù)對所作工作進程測試。三、實驗原理:操作系統(tǒng)根據(jù)允許并行工作的道數(shù)和一定的算法從系統(tǒng)中選取若干作業(yè)把

2、它們裝入主存儲器,使它們有機會獲得處理器運行,這項工作被稱為“作業(yè)調(diào)度”。實現(xiàn)這部分功能的程序就是“作業(yè)調(diào)度程序”。四、實驗程序設(shè)計#include "stdafx.h"#include <iostream> using namespace std;#include <string>#include "JCB.h"class JCB public:int creat(int name, int length, int tape, int printer, int waittime, int runtime );void shedu

3、le(JCB *head);JCB *next;JCB();virtual JCB();private:int name;int printer;int tape;int waittime;int runtime; long length;int JCB:creat(int name, int length, int tape, int printer, int waittime, int runtime) this->name=name;this->printer=printer;this->tape=tape;this->waittime=waittime;this

4、->runtime=runtime;this->length=length; return 0;void JCB:shedule(JCB *head)JCB *p,*q;JCB *k1,*k2;long temp;int a;longmemory=65536; int tape=4; int printer=2;q=head;p=q->next;cout<<"運行次序為:"<<endl;while(p!=NULL)a=0;k1=k2=NULL; while(p!=NULL) if(p->length>memory|p-&

5、gt;tape>tape|p->printer>printer)cout<<p->name << "作業(yè)不滿足條件不能執(zhí)行"<<endl;k1=p;p=p->next ;delete k1;q->next=p; else temp= (p->runtime+p->waittime )/p->runtime; if(a<temp) a=temp; k1=q; k2=p; q=p; p=q->next; if(k2!=NULL) cout<<k2->name&

6、lt;<"作業(yè)執(zhí)行"<<endl; p=k2; k2=k2->next ; delete p; k1->next=k2; q=head; p=q->next;int main()JCB *head;JCB *p;head=new JCB; head->next=NULL;p=head;int a=0;int name;int printer;int tape;int waittime;int runtime;int length;cout<<"輸入作業(yè)相關(guān)數(shù)據(jù)(以作業(yè)大小為負數(shù)停止輸入"<<

7、;endl;cout<<"輸入作業(yè)名、作業(yè)大小、磁帶機數(shù)、打印機數(shù)、等待時間、估計執(zhí)行時間"<<endl; cin >> name; cin >> length; cin >> tape; cin >> printer; cin >> waittime; cin >> runtime; while(length>0) p->next=new JCB; p=p->next; a=p->creat( name, length,tape,printer, waittime, runtime ); cout<<endl; p->next=NULL; cin >> name; cin >> length; if(length<0) break; cin >> tape; cin >> printer; cin >> waittime; cin >> runtime; head->shedule(head);return

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論