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