91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 49KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2021-05-09
  • 語言: C#
  • 標簽: C#??操作系統??

資源簡介

用C#編寫的進程調度程序,包括優先權調度算法,時間片輪轉法。能夠顯示每一步進程的變化情況。

資源截圖

代碼片段和文件信息

using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Text;
using?System.Windows.Forms;
using?System.Collections;

namespace?OStest1
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????int?n;//進程數
????????public?ArrayList?a1?=?new?ArrayList();
????????private?void?button1_Click(object?sender?EventArgs?e)
????????{
????????????button1.Visible?=?false;
????????????n?=?int.Parse(textBox1.Text);
????????????Random?rd?=?new?Random();
????????????for?(int?i?=?0;?i?????????????{
????????????????pcb?p?=?new?pcb(Convert.ToChar(65?+?i).ToString()?rd.?Next(1?10)?rd.Next(1?20)?0);
????????????????a1.Add(p);
????????????}
????????????show();
?
????????????if?(radioButton1.Checked)
????????????{
????????????????button2.Visible?=?true;
????????????????button3.Visible?=?true;
????????????}
????????????else?if?(radioButton2.Checked)
????????????{
????????????????button4.Visible?=?true;
????????????}
????????????else?MessageBox.Show(“請選擇調度算法。“);
???????????
????????}
????????????
????????public?void?sort()
????????{
????????????pcb[]?PCB?=?new?pcb[a1.Count];
????????????a1.CopyTo(PCB);
????????????for?(int?j?=?1;?j?<=a1?.Count?-1;?j++)
????????????{
????????????????for?(int?i?=?0;?i?????????????????{
????????????????????pcb?p;
????????????????????if?(PCB[i].prority?<=?PCB[i?+?1].prority)
????????????????????{
????????????????????????p?=?PCB[i];
????????????????????????PCB[i]?=?PCB[i?+?1];
????????????????????????PCB[i?+?1]?=?p;
????????????????????}
????????????????????else
????????????????????{
????????????????????}
????????????????}
????????????}
????????????int?b=a1?.Count?;
????????????a1.Clear();
????????????for?(int?i?=?0;?i?????????????{
????????????????a1.Add(PCB[i]);
????????????}
????????}
????????public??void?show()
????????{
????????????listBox1.Items.Clear();
????????????listBox1.Items.Add(“進程號??優先權??所需時間片數??已服務時間“);
????????????pcb[]?PCB?=?new?pcb[a1.Count];
????????????a1.CopyTo(PCB);
????????????for?(int?i?=?0;?i?????????????{

????????????????string?s?=?PCB[i].proc_no.ToString()?+?“??????????“?+?PCB[i].prority.ToString()?+?“??????????“?+?PCB[i].needTime.ToString()+“?????????“+PCB[i].servTime?;
????????????????listBox1.Items.Add(s);
????????????}
????????}

????????private?void?button2_Click(object?sender?EventArgs?e)
????????{
????????????if?(a1.Count?==?0)
????????????????MessageBox.Show(“進程服務完畢。“);
????????????else?if?(a1.Count?==?1)
????????????{
????????????????pcb[]?p?=?new?pcb[1];
????????????????a1.CopyTo(p);
????????????????if??(p[0].needTime?!=?p[0].servTime)
????????????????{
????????????????????p[0].servTime++;
????????????????????p[0].prority--;
????????????????????show();
????????????????}
????????????????else?
?????

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件??????24576??2012-06-12?19:33??OStest1\OStest1\bin\Debug\OStest1.exe

?????文件??????52736??2012-06-12?19:33??OStest1\OStest1\bin\Debug\OStest1.pdb

?????文件???????5632??2005-12-08?14:51??OStest1\OStest1\bin\Debug\OStest1.vshost.exe

?????文件???????5076??2012-06-12?19:33??OStest1\OStest1\Form1.cs

?????文件???????7747??2012-06-12?19:32??OStest1\OStest1\Form1.Designer.cs

?????文件???????5814??2012-06-12?19:32??OStest1\OStest1\Form1.resx

?????文件????????443??2012-05-19?23:52??OStest1\OStest1\Form2.cs

?????文件???????2721??2012-05-14?00:23??OStest1\OStest1\Form2.Designer.cs

?????文件???????5814??2012-05-14?00:10??OStest1\OStest1\Form2.resx

?????文件????????332??2012-05-14?01:21??OStest1\OStest1\Form3.cs

?????文件???????2635??2012-05-14?01:21??OStest1\OStest1\Form3.Designer.cs

?????文件???????5814??2012-05-14?01:21??OStest1\OStest1\Form3.resx

?????文件????????230??2012-05-11?17:13??OStest1\OStest1\FormInfo.cs

?????文件????????958??2012-06-12?19:32??OStest1\OStest1\obj\Debug\OStest1.csproj.GenerateResource.Cache

?????文件??????24576??2012-06-12?19:33??OStest1\OStest1\obj\Debug\OStest1.exe

?????文件????????180??2012-06-12?19:32??OStest1\OStest1\obj\Debug\OStest1.Form1.resources

?????文件????????180??2012-05-14?00:10??OStest1\OStest1\obj\Debug\OStest1.Form2.resources

?????文件????????180??2012-05-14?01:21??OStest1\OStest1\obj\Debug\OStest1.Form3.resources

?????文件??????52736??2012-06-12?19:33??OStest1\OStest1\obj\Debug\OStest1.pdb

?????文件????????180??2012-05-04?00:21??OStest1\OStest1\obj\Debug\OStest1.Properties.Resources.resources

?????文件???????1966??2012-06-13?23:58??OStest1\OStest1\obj\OStest1.csproj.FileListAbsolute.txt

?????文件???????3972??2012-05-13?11:00??OStest1\OStest1\OStest1.csproj

?????文件????????545??2012-05-19?22:41??OStest1\OStest1\pcb.cs

?????文件????????466??2012-05-04?00:18??OStest1\OStest1\Program.cs

?????文件???????1162??2012-05-04?00:18??OStest1\OStest1\Properties\AssemblyInfo.cs

?????文件???????2870??2012-05-04?00:18??OStest1\OStest1\Properties\Resources.Designer.cs

?????文件???????5612??2012-05-04?00:18??OStest1\OStest1\Properties\Resources.resx

?????文件???????1092??2012-05-04?00:18??OStest1\OStest1\Properties\Settings.Designer.cs

?????文件????????249??2012-05-04?00:18??OStest1\OStest1\Properties\Settings.settings

?????文件????????910??2012-05-04?00:18??OStest1\OStest1.sln

............此處省略13個文件信息

評論

共有 條評論