資源簡介
我自己上學期寫的操作系統課設(理發師問題,時間片輪轉調度算法,優先數調度算法)c#,vs可視化
用c#及vs實現可視化
詳情可見文件里的課設報告

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Threading.Tasks;
using?System.Windows.Forms;
using?System.Threading;
namespace?barbers
{
????public?partial?class?Form1?:?Form
????{
????????int?cnt;
????????PictureBox[]?pic;
????????public?Form1()//
????????{
????????????InitializeComponent();
????????????cnt?=?0;
????????????pic?=?new?PictureBox[4];
????????????pic[0]?=?c0;
????????????pic[1]?=?c1;
????????????pic[2]?=?c2;
????????????pic[3]?=?c3;
????????????timer1.Enabled?=?true;
????????????timer2.Enabled?=?true;
????????}
????????private?void?label1_Click(object?sender?EventArgs?e)
????????{
????????}
????????private?void?Form1_Load(object?sender?EventArgs?e)
????????{
????????}
????????private?void?button1_Click(object?sender?EventArgs?e)
????????{
????????????if?(cnt?4)
????????????{
????????????????if?(cnt?==?0)
????????????????????MessageBox.Show(“理發師醒了開始干活“);
????????????????cnt++;
????????????}
????????????else
????????????????MessageBox.Show(“沒有空座位顧客離開了“);
????????}
????????private?void?timer1_Tick(object?sender?EventArgs?e)
????????{
????????????//cnt數量監聽器?改變GUI
????????????for?(int?i?=?0;?i?????????????{
????????????????pic[i].Visible?=?true;
????????????}
????????????for?(int?i?=?cnt;?i?????????????{
????????????????pic[i].Visible?=?false;
????????????????//MessageBox.Show(“剪完了“);
????????????}
????????}
????????private?void?timer2_Tick(object?sender?EventArgs?e)
????????{//顧客數大于1?喚醒理發師線程
?????????//cnt數量監聽器?改變timers的Enable
????????????if?(cnt?>?0)
????????????{
????????????????timer3.Enabled?=?true;
????????????}
????????}
????????private?void?timer3_Tick(object?sender?EventArgs?e)
????????{
????????????if?(cnt?>?0)
????????????{
????????????????cnt--;
????????????????if?(cnt?==?0)
????????????????{
????????????????????timer3.Enabled?=?false;
????????????????????MessageBox.Show(“理發師睡著了“);
????????????????}
????????????}
????????}
????}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????777943??2018-11-15?19:06??os課設\os課設個人報告概述.docx
?????目錄???????????0??2018-08-03?20:21??os課設\
?????目錄???????????0??2018-07-08?13:59??os課設\OStest1\
?????目錄???????????0??2018-07-08?13:59??os課設\OStest1\.vs\
?????目錄???????????0??2018-07-08?13:59??os課設\OStest1\.vs\OStest1\
?????目錄???????????0??2018-07-08?13:59??os課設\OStest1\.vs\OStest1\v15\
?????目錄???????????0??2018-07-08?13:07??os課設\OStest1\.vs\OStest1\v15\Server\
?????目錄???????????0??2018-08-03?20:21??os課設\OStest1\.vs\OStest1\v15\Server\sqlite3\
?????目錄???????????0??2018-07-08?13:59??os課設\OStest1\.vs\進程模擬調度\
?????目錄???????????0??2018-07-08?14:18??os課設\OStest1\.vs\進程模擬調度\v15\
?????文件???????36352??2018-07-08?22:04??os課設\OStest1\.vs\進程模擬調度\v15\.suo
?????目錄???????????0??2018-07-08?14:18??os課設\OStest1\.vs\進程模擬調度\v15\Server\
?????目錄???????????0??2018-07-08?14:18??os課設\OStest1\.vs\進程模擬調度\v15\Server\sqlite3\
?????文件???????????0??2018-07-08?14:18??os課設\OStest1\.vs\進程模擬調度\v15\Server\sqlite3\db.lock
?????文件????????4096??2018-07-08?14:18??os課設\OStest1\.vs\進程模擬調度\v15\Server\sqlite3\storage.ide
?????文件???????32768??2018-07-08?21:59??os課設\OStest1\.vs\進程模擬調度\v15\Server\sqlite3\storage.ide-shm
?????文件??????601552??2018-07-08?14:19??os課設\OStest1\.vs\進程模擬調度\v15\Server\sqlite3\storage.ide-wal
?????目錄???????????0??2018-07-08?14:18??os課設\OStest1\OStest1\
?????文件???????18123??2018-07-08?12:35??os課設\OStest1\OStest1\Form1.Designer.cs
?????文件????????8778??2018-07-08?13:03??os課設\OStest1\OStest1\Form1.cs
?????文件????????5814??2018-07-08?12:35??os課設\OStest1\OStest1\Form1.resx
?????文件????????2836??2018-07-07?21:55??os課設\OStest1\OStest1\Form2.Designer.cs
?????文件?????????542??2018-07-08?11:42??os課設\OStest1\OStest1\Form2.cs
?????文件????????5814??2018-07-07?21:55??os課設\OStest1\OStest1\Form2.resx
?????文件????????2718??2018-07-07?21:55??os課設\OStest1\OStest1\Form3.Designer.cs
?????文件?????????422??2018-07-08?13:03??os課設\OStest1\OStest1\Form3.cs
?????文件????????5814??2018-07-07?21:55??os課設\OStest1\OStest1\Form3.resx
?????文件?????????270??2018-07-08?11:02??os課設\OStest1\OStest1\FormInfo.cs
?????文件????????2077??2018-07-08?11:54??os課設\OStest1\OStest1\Frmshowend.Designer.cs
?????文件????????1922??2018-07-08?13:03??os課設\OStest1\OStest1\Frmshowend.cs
?????文件????????5817??2018-07-08?11:54??os課設\OStest1\OStest1\Frmshowend.resx
............此處省略94個文件信息
- 上一篇:三菱PLC與C#等通訊
- 下一篇:Visual C#.NET 應用編程150例
評論
共有 條評論