Beispiel #1
0
 public Resource(Process creator, State state, string id, List<string> processList)
 {
     WaitingProcesses = new PriorityQueue<Process>(new ProcessComparer());
     Creator = creator;
     State = state;
     Id = id;
     InitWaitingProcessesList(processList);
 }
Beispiel #2
0
 public static void CreateProcess(Process process)
 {
     ProcessList.Add(process);
     if (process.State == Processes.State.Ready || process.State == Processes.State.Active)
     {
         ReadyProcessQueue.Enqueue(process);
     }
 }
Beispiel #3
0
 public Process(int priority, State state, Process parentProcess, string id)
 {
     Id = id;
     Priority = priority;
     State = state;
     ParentProcess = parentProcess;
     CreatedProcesses = new List<Process>();
     CreatedResources = new List<Resource>();
     Checkpoint = 1;
 }
Beispiel #4
0
 private static bool ProcessIsAlreadyAdded(Process process)
 {
     var result = Core.ReadyProcessQueue.SingleOrDefault(p => p.Id == process.Id);
     return result != null;
 }
Beispiel #5
0
 private static void PickProcess()
 {
     CurrentProcess = Core.ReadyProcessQueue.Dequeue();
        CurrentProcess.State = Processes.State.Active;
 }
Beispiel #6
0
 public JobGovernor(int priority, State state, Process parentProcess, string id)
     : base(priority, state, parentProcess, id)
 {
 }
Beispiel #7
0
 public StartStop(int priority, State state, Process parentProcess, string id)
     : base(priority, state, parentProcess, id)
 {
 }
Beispiel #8
0
 public TaskInput(Process creator, State state, string id, Queue<string> taskList, List<string> processList)
     : base(creator, state, id, processList)
 {
     Tasks = taskList;
 }
Beispiel #9
0
 public ReadIn(int priority, State state, Process parentProcess, string id)
     : base(priority, state, parentProcess, id)
 {
 }
Beispiel #10
0
 public static void DeleteProcess(Process process)
 {
     process.Delete();
     //TODO: delete from ReadyProcessQueue
 }
Beispiel #11
0
 public Interrupt(int priority, State state, Process parentProcess, string id)
     : base(priority, state, parentProcess, id)
 {
 }
 public InterruptInformation(Process creator, State state, string id, Type type, List<string> processList)
     : base(creator, state, id, processList)
 {
     Type = type;
 }
 public TaskInSupervisorMemory(Process creator, State state, string id, string[] memory, List<string> processList)
     : base(creator, state, id, processList)
 {
     Memory = memory;
 }
Beispiel #14
0
 public StartJobGovernor(Process creator, State state, Memory virtualMemory, string id, List<string> processList)
     : base(creator, state, id, processList)
 {
     VirtualMemory = virtualMemory;
 }
Beispiel #15
0
 public UserMemory(Process creator, State state, string id, List<string> processList)
     : base(creator, state, id, processList)
 {
 }
Beispiel #16
0
 public EndOfOs(Process creator, State state, string id, List<string> processList)
     : base(creator, state, id, processList)
 {
 }
Beispiel #17
0
 public Loader(int priority, State state, Process parentProcess, string id)
     : base(priority, state, parentProcess, id)
 {
     virtualMemory = new Memory(Memory.VIRTUAL_MEMORY_BLOCK_COUNT, Memory.BLOCK_WORD_COUNT);
 }
Beispiel #18
0
 public WriteOut(int priority, State state, Process parentProcess, string id)
     : base(priority, state, parentProcess, id)
 {
 }
Beispiel #19
0
 public VirtualMachine(int priority, State state, Memory virtualMemory, Process parentProcess, string id)
     : base(priority, state, parentProcess, id)
 {
     this.virtualMemory = virtualMemory;
 }
Beispiel #20
0
 public TaskParser(int priority, State state, Process parentProcess, string id)
     : base(priority, state, parentProcess, id)
 {
 }
Beispiel #21
0
 public TaskReady(Process creator, State state, Memory virtualMemory, string id, List<string> processList)
     : base(creator, state, id, processList)
 {
     VirtualMemory = virtualMemory;
 }
Beispiel #22
0
 public Task(Process creator, State state, string id, TaskInSupervisorMemory taskSource, List<string> processList)
     : base(creator, state, id, processList)
 {
     this.taskSource = taskSource;
 }