資源簡介
進程調度輪轉法優先權法運作原理實驗流程:
產生 n個進程,對每個進程產生一個PCB,并用隨機數產生進程的優先權及進程所需的CPU時間。
按優先權大小,把n個進程拉成一個就緒隊列。
鏈首進程投入運行一個時間片。時間片到,進程所需的CPU時間減一,優先權減三,輸出各進程的運行情況。
所需的CPu時間=0?
!=0的話,將進程插入就緒隊列
=0的話,撤銷進程。
就緒隊列為空,結束。否則,繼續運行。

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.Linq;
using?System.Text;
namespace?OS_experiment
{
????class?PCB
????{
????????public?int?process;
????????public?int?priority;
????????public?int?servertime;
????????public?PCB(int?processint?priority?int?servertime)
????????{
????????????this.process?=?process;
????????????this.priority?=?priority;
????????????this.servertime?=?servertime;
????????}
????}
????class?tryCatch
????{
????????public?int?test(string?m)
????????{
????????????try
????????????{
????????????????int?i?=?0;
????????????????i?=?int.Parse(m);
????????????????return?i;
????????????}
????????????catch?(Exception?ex)
????????????{
????????????????Console.WriteLine(ex.Message);
????????????????return?0;
????????????}
????????}
????}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????54272??2011-04-19?00:28??進程調度\OS?experiment.doc
?????文件????????929??2011-04-17?22:16??進程調度\OS?experiment.sln
????..A..H.?????23552??2011-06-02?17:45??進程調度\OS?experiment.suo
????..A.SH.???????162??2011-04-29?23:14??進程調度\~$?experiment.doc
?????文件????????818??2011-04-18?16:38??進程調度\OS?experiment\class1.cs
?????文件??????11465??2011-06-02?16:56??進程調度\OS?experiment\Form1.Designer.cs
?????文件???????8543??2011-06-02?16:56??進程調度\OS?experiment\Form1.cs
?????文件???????3809??2011-04-17?22:55??進程調度\OS?experiment\OS?experiment.csproj
?????文件????????494??2011-04-17?22:16??進程調度\OS?experiment\Program.cs
?????文件???????7851??2011-06-02?16:56??進程調度\OS?experiment\Form1.resx
?????文件??????15360??2011-06-02?16:56??進程調度\OS?experiment\bin\Debug\OS?experiment.exe
?????文件??????40448??2011-06-02?16:56??進程調度\OS?experiment\bin\Debug\OS?experiment.pdb
?????文件??????14328??2011-06-02?17:24??進程調度\OS?experiment\bin\Debug\OS?experiment.vshost.exe
?????文件????????490??2007-07-21?01:33??進程調度\OS?experiment\bin\Debug\OS?experiment.vshost.exe.manifest
?????文件???????2914??2011-06-02?17:24??進程調度\OS?experiment\obj\Debug\OS?experiment.csproj.FileListAbsolute.txt
?????文件??????15360??2011-06-02?16:56??進程調度\OS?experiment\obj\Debug\OS?experiment.exe
?????文件??????40448??2011-06-02?16:56??進程調度\OS?experiment\obj\Debug\OS?experiment.pdb
?????文件????????180??2011-06-02?16:56??進程調度\OS?experiment\obj\Debug\OS_experiment.Form1.resources
?????文件????????180??2011-04-17?22:55??進程調度\OS?experiment\obj\Debug\OS_experiment.Properties.Resources.resources
?????文件????????847??2011-06-02?16:56??進程調度\OS?experiment\obj\Debug\OS?experiment.csproj.GenerateResource.Cache
?????文件???????1376??2011-04-17?22:16??進程調度\OS?experiment\Properties\AssemblyInfo.cs
?????文件???????2876??2011-04-17?22:16??進程調度\OS?experiment\Properties\Resources.Designer.cs
?????文件???????5612??2011-04-17?22:16??進程調度\OS?experiment\Properties\Resources.resx
?????文件???????1098??2011-04-17?22:16??進程調度\OS?experiment\Properties\Settings.Designer.cs
?????文件????????249??2011-04-17?22:16??進程調度\OS?experiment\Properties\Settings.settings
?????目錄??????????0??2011-06-08?12:58??進程調度\OS?experiment\obj\Debug\TempPE
?????目錄??????????0??2011-06-08?12:58??進程調度\OS?experiment\bin\Debug
?????目錄??????????0??2011-06-08?12:58??進程調度\OS?experiment\obj\Debug
?????目錄??????????0??2011-06-08?12:58??進程調度\OS?experiment\bin
?????目錄??????????0??2011-06-08?12:58??進程調度\OS?experiment\obj
............此處省略6個文件信息
- 上一篇:五子棋,C語言代碼,dos環境支持鼠標操作
- 下一篇:數據倉庫建模之金融銀行模型篇
評論
共有 條評論