コード例 #1
0
ファイル: TaskReader.cs プロジェクト: ICanHaz/Os-model
 public override void Execute()
 {
     switch (Checkpoint)
     {
         case 1:
             if (!GetTask())
             {
                 break;
             }
             Checkpoint++;
             goto case 2;
         case 2:
             supervisorMemory = (SupervisorMemory) base.RequestResource("SupervisorMemory");
             if (supervisorMemory == null)
             {
                 break;
             }
             else
             {
                 LoadTaskIntoSupervisorMemory();
                 supervisorMemory.Free();
                 supervisorMemory.Clear();
                 CreateResource(new TaskInSupervisorMemory(this, Resources.State.Free, "TaskInSupervisorMemory", TaskSource, new List<string> { "TaskParser" }));
                 State = Processes.State.Blocked;
                 break;
             }
     }
 }
コード例 #2
0
ファイル: StartStop.cs プロジェクト: ICanHaz/Os-model
 private void InitResources()
 {
     CreateResource(new UserMemory(this, Resources.State.Free, "UserMemory", new List<string> { "Loader" }));
     CreateResource(new TaskInput(this, Resources.State.Free,
                                  "TaskInput", new Queue<string>(new List<string> { "Tasks/Fibonacci.txt" }),
                                  new List<string> { "TaskReader" }));
     //CreateResource(new InterruptInformation(this, Resources.State.Occupied, "EndOfOs", Resources.Type.VMWorkFinish,
                                             //new List<string> { "VirtualMachine1", "VirtualMachine2", "VirtualMachine3" }));
     supervisorMemory = new SupervisorMemory(this, Resources.State.Free, "SupervisorMemory", new List<string> { "TaskReader" });
     // CreateResource(new EndOfOs(this, Resources.State.Free, "EndOfOs", new List<string> { "StartStop" }))
     CreateResource(supervisorMemory);
 }