Example #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);
 }
Example #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);
     }
 }
Example #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;
 }
Example #4
0
 private static bool ProcessIsAlreadyAdded(Process process)
 {
     var result = Core.ReadyProcessQueue.SingleOrDefault(p => p.Id == process.Id);
     return result != null;
 }
Example #5
0
 private static void PickProcess()
 {
     CurrentProcess = Core.ReadyProcessQueue.Dequeue();
        CurrentProcess.State = Processes.State.Active;
 }
Example #6
0
 public JobGovernor(int priority, State state, Process parentProcess, string id)
     : base(priority, state, parentProcess, id)
 {
 }
Example #7
0
 public StartStop(int priority, State state, Process parentProcess, string id)
     : base(priority, state, parentProcess, id)
 {
 }
Example #8
0
 public TaskInput(Process creator, State state, string id, Queue<string> taskList, List<string> processList)
     : base(creator, state, id, processList)
 {
     Tasks = taskList;
 }
Example #9
0
 public ReadIn(int priority, State state, Process parentProcess, string id)
     : base(priority, state, parentProcess, id)
 {
 }
Example #10
0
 public static void DeleteProcess(Process process)
 {
     process.Delete();
     //TODO: delete from ReadyProcessQueue
 }
Example #11
0
 public Interrupt(int priority, State state, Process parentProcess, string id)
     : base(priority, state, parentProcess, id)
 {
 }
Example #12
0
 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;
 }
Example #14
0
 public StartJobGovernor(Process creator, State state, Memory virtualMemory, string id, List<string> processList)
     : base(creator, state, id, processList)
 {
     VirtualMemory = virtualMemory;
 }
Example #15
0
 public UserMemory(Process creator, State state, string id, List<string> processList)
     : base(creator, state, id, processList)
 {
 }
Example #16
0
 public EndOfOs(Process creator, State state, string id, List<string> processList)
     : base(creator, state, id, processList)
 {
 }
Example #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);
 }
Example #18
0
 public WriteOut(int priority, State state, Process parentProcess, string id)
     : base(priority, state, parentProcess, id)
 {
 }
Example #19
0
 public VirtualMachine(int priority, State state, Memory virtualMemory, Process parentProcess, string id)
     : base(priority, state, parentProcess, id)
 {
     this.virtualMemory = virtualMemory;
 }
Example #20
0
 public TaskParser(int priority, State state, Process parentProcess, string id)
     : base(priority, state, parentProcess, id)
 {
 }
Example #21
0
 public TaskReady(Process creator, State state, Memory virtualMemory, string id, List<string> processList)
     : base(creator, state, id, processList)
 {
     VirtualMemory = virtualMemory;
 }
Example #22
0
 public Task(Process creator, State state, string id, TaskInSupervisorMemory taskSource, List<string> processList)
     : base(creator, state, id, processList)
 {
     this.taskSource = taskSource;
 }