-
1
-
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28
-
29
-
30
-
31
-
32
-
33
-
34
-
35
-
36
-
37
-
38
-
39
-
40
-
41
-
42
목차
[Debug]
OS2011.exe
OS2011.ilk
OS2011.pdb
[OS2011]
main.cpp
OS2011.vcxproj
OS2011.vcxproj.filters
OS2011.vcxproj.user
OSProcess.cpp
OSProcess.h
ReadyQueue.cpp
ReadyQueue.h
[Debug]
CL.write.1.tlog
link.6096.read.1.tlog
link.6096.write.1.tlog
link.6096-cvtres.read.1.tlog
link.6096-cvtres.write.1.tlog
link.command.1.tlog
link.read.1.tlog
link.write.1.tlog
link-cvtres.read.1.tlog
link-cvtres.write.1.tlog
main.obj
mt.command.1.tlog
mt.read.1.tlog
mt.write.1.tlog
OS2011.exe.embed.manifest
OS2011.exe.embed.manifest.res
OS2011.exe.intermediate.manifest
OS2011.lastbuildstate
OS2011.log
OS2011_manifest.rc
OSProcess.obj
rc.command.1.tlog
rc.read.1.tlog
rc.write.1.tlog
ReadyQueue.obj
vc100.idb
vc100.pdb
cl.command.1.tlog
CL.read.1.tlog
OS2011.sln
OS2011.suo
OS2011.exe
OS2011.ilk
OS2011.pdb
[OS2011]
main.cpp
OS2011.vcxproj
OS2011.vcxproj.filters
OS2011.vcxproj.user
OSProcess.cpp
OSProcess.h
ReadyQueue.cpp
ReadyQueue.h
[Debug]
CL.write.1.tlog
link.6096.read.1.tlog
link.6096.write.1.tlog
link.6096-cvtres.read.1.tlog
link.6096-cvtres.write.1.tlog
link.command.1.tlog
link.read.1.tlog
link.write.1.tlog
link-cvtres.read.1.tlog
link-cvtres.write.1.tlog
main.obj
mt.command.1.tlog
mt.read.1.tlog
mt.write.1.tlog
OS2011.exe.embed.manifest
OS2011.exe.embed.manifest.res
OS2011.exe.intermediate.manifest
OS2011.lastbuildstate
OS2011.log
OS2011_manifest.rc
OSProcess.obj
rc.command.1.tlog
rc.read.1.tlog
rc.write.1.tlog
ReadyQueue.obj
vc100.idb
vc100.pdb
cl.command.1.tlog
CL.read.1.tlog
OS2011.sln
OS2011.suo
본문내용
#ifndef __READYQUEUE_H__
#define __READYQUEUE_H__
#include "ReadyQueue.h"
#include "windows.h"
#endif
#ifndef __IOSTREAM__
#define __IOSTREAM__
#include
using namespace std;
#endif
#define SEC 1000
int main(void){
ReadyQueue RQueue;
OSProcess *osP1 = CreateOSProcess();
OSProcess *osP2 = CreateOSProcess();
OSProcess *osP3 = CreateOSProcess();
OSProcess *osP4 = CreateOSProcess();
OSProcess *osP5 = CreateOSProcess();
RQueue.push(osP1);
RQueue.push(osP2);
RQueue.push(osP3);
RQueue.push(osP4);
RQueue.push(osP5);
for(int i=0;i<2;i++)
{
RQueue.pop();
osP1->SetProcessState(RUNNING);
cout<<" Process1"<<" ID : "<GetProcessID()<
osP1->SetProcessState(READY);
RQueue.push(osP1);
Sleep(1000);
RQueue.pop();
osP2->SetProcessState(RUNNING);
cout<<" Process2"<<" ID : "<GetProcessID()<
osP2->SetProcessState(READY);
RQueue.push(osP2);
Sleep(1000);
RQueue.pop();
osP3->SetProcessState(RUNNING);
cout<<" Process3"<<" ID : "<GetProcessID()<
osP3->SetProcessState(READY);
RQueue.push(osP3);
Sleep(1000);
RQueue.pop();
osP4->SetProcessState(RUNNING);
cout<<" Process4"<<" ID : "<GetProcessID()<
osP4->SetProcessState(READY);
RQueue.push(osP4);
Sleep(1000);
RQueue.pop();
osP5->SetProcessState(RUNNING);
cout<<" Process5"<<" ID : "<GetProcessID()<
osP5->SetProcessState(READY);
RQueue.push(osP5);
Sleep(1000);
}
return 0;
}
#define __READYQUEUE_H__
#include "ReadyQueue.h"
#include "windows.h"
#endif
#ifndef __IOSTREAM__
#define __IOSTREAM__
#include
using namespace std;
#endif
#define SEC 1000
int main(void){
ReadyQueue RQueue;
OSProcess *osP1 = CreateOSProcess();
OSProcess *osP2 = CreateOSProcess();
OSProcess *osP3 = CreateOSProcess();
OSProcess *osP4 = CreateOSProcess();
OSProcess *osP5 = CreateOSProcess();
RQueue.push(osP1);
RQueue.push(osP2);
RQueue.push(osP3);
RQueue.push(osP4);
RQueue.push(osP5);
for(int i=0;i<2;i++)
{
RQueue.pop();
osP1->SetProcessState(RUNNING);
cout<<" Process1"<<" ID : "<
osP1->SetProcessState(READY);
RQueue.push(osP1);
Sleep(1000);
RQueue.pop();
osP2->SetProcessState(RUNNING);
cout<<" Process2"<<" ID : "<
osP2->SetProcessState(READY);
RQueue.push(osP2);
Sleep(1000);
RQueue.pop();
osP3->SetProcessState(RUNNING);
cout<<" Process3"<<" ID : "<
osP3->SetProcessState(READY);
RQueue.push(osP3);
Sleep(1000);
RQueue.pop();
osP4->SetProcessState(RUNNING);
cout<<" Process4"<<" ID : "<
osP4->SetProcessState(READY);
RQueue.push(osP4);
Sleep(1000);
RQueue.pop();
osP5->SetProcessState(RUNNING);
cout<<" Process5"<<" ID : "<
osP5->SetProcessState(READY);
RQueue.push(osP5);
Sleep(1000);
}
return 0;
}
소개글