Programmer: Bill McQuain CS 1704: Process Management Simulation Script file: cs.txt Log file: cslog.txt ---------------------------------------------------------------------- Command 1: start P01 0 Process 0 added. ---------------------------------------------------------------------- Command 2: start P02 0 Process 1 added. ---------------------------------------------------------------------- Command 3: start P03 0 Process 2 added. ---------------------------------------------------------------------- Command 4: start P11 1 Process 3 added. ---------------------------------------------------------------------- Command 5: start P12 1 Process 4 added. ---------------------------------------------------------------------- Command 6: start P13 1 Process 5 added. ---------------------------------------------------------------------- Command 7: start P31 3 Process 6 added. ---------------------------------------------------------------------- Command 8: start P32 3 Process 7 added. ---------------------------------------------------------------------- Command 9: start P33 3 Process 8 added. ---------------------------------------------------------------------- Command 10: start P41 4 Process 9 added. ---------------------------------------------------------------------- Command 11: start P42 4 Process 10 added. ---------------------------------------------------------------------- Command 12: start P43 4 Process 11 added. ---------------------------------------------------------------------- Command 13: ps all Processes with priority 0: P01 PID: 0 Priority: 0 P02 PID: 1 Priority: 0 P03 PID: 2 Priority: 0 Processes with priority 1: P11 PID: 3 Priority: 1 P12 PID: 4 Priority: 1 P13 PID: 5 Priority: 1 Processes with priority 2: Processes with priority 3: P31 PID: 6 Priority: 3 P32 PID: 7 Priority: 3 P33 PID: 8 Priority: 3 Processes with priority 4: P41 PID: 9 Priority: 4 P42 PID: 10 Priority: 4 P43 PID: 11 Priority: 4 ---------------------------------------------------------------------- Command 14: switch 0 Process 0 now in run mode. ---------------------------------------------------------------------- Command 15: switch 1 Process 3 now in run mode. ---------------------------------------------------------------------- Command 16: switch 3 Process 6 now in run mode. ---------------------------------------------------------------------- Command 17: switch 4 Process 9 now in run mode. ---------------------------------------------------------------------- Command 18: switch 0 Process 1 now in run mode. ---------------------------------------------------------------------- Command 19: switch 1 Process 4 now in run mode. ---------------------------------------------------------------------- Command 20: ps all Running process: P12 PID: 4 Priority: 1 Call stack: Stack is empty. Processes with priority 0: P03 PID: 2 Priority: 0 P01 PID: 0 Priority: 0 P02 PID: 1 Priority: 0 Processes with priority 1: P13 PID: 5 Priority: 1 P11 PID: 3 Priority: 1 Processes with priority 2: Processes with priority 3: P32 PID: 7 Priority: 3 P33 PID: 8 Priority: 3 P31 PID: 6 Priority: 3 Processes with priority 4: P42 PID: 10 Priority: 4 P43 PID: 11 Priority: 4 P41 PID: 9 Priority: 4 ---------------------------------------------------------------------- Command 21: switch 4 Process 10 now in run mode. ---------------------------------------------------------------------- Command 22: switch 4 Process 11 now in run mode. ---------------------------------------------------------------------- Command 23: ps all Running process: P43 PID: 11 Priority: 4 Call stack: Stack is empty. Processes with priority 0: P03 PID: 2 Priority: 0 P01 PID: 0 Priority: 0 P02 PID: 1 Priority: 0 Processes with priority 1: P13 PID: 5 Priority: 1 P11 PID: 3 Priority: 1 P12 PID: 4 Priority: 1 Processes with priority 2: Processes with priority 3: P32 PID: 7 Priority: 3 P33 PID: 8 Priority: 3 P31 PID: 6 Priority: 3 Processes with priority 4: P41 PID: 9 Priority: 4 P42 PID: 10 Priority: 4 ---------------------------------------------------------------------- Command 24: switch 4 Process 9 now in run mode. ---------------------------------------------------------------------- Command 25: ps all Running process: P41 PID: 9 Priority: 4 Call stack: Stack is empty. Processes with priority 0: P03 PID: 2 Priority: 0 P01 PID: 0 Priority: 0 P02 PID: 1 Priority: 0 Processes with priority 1: P13 PID: 5 Priority: 1 P11 PID: 3 Priority: 1 P12 PID: 4 Priority: 1 Processes with priority 2: Processes with priority 3: P32 PID: 7 Priority: 3 P33 PID: 8 Priority: 3 P31 PID: 6 Priority: 3 Processes with priority 4: P42 PID: 10 Priority: 4 P43 PID: 11 Priority: 4 ---------------------------------------------------------------------- Command 26: switch 2 No eligible processes. ---------------------------------------------------------------------- Command 27: ps all Running process: P41 PID: 9 Priority: 4 Call stack: Stack is empty. Processes with priority 0: P03 PID: 2 Priority: 0 P01 PID: 0 Priority: 0 P02 PID: 1 Priority: 0 Processes with priority 1: P13 PID: 5 Priority: 1 P11 PID: 3 Priority: 1 P12 PID: 4 Priority: 1 Processes with priority 2: Processes with priority 3: P32 PID: 7 Priority: 3 P33 PID: 8 Priority: 3 P31 PID: 6 Priority: 3 Processes with priority 4: P42 PID: 10 Priority: 4 P43 PID: 11 Priority: 4 ---------------------------------------------------------------------- Command 28: exit Exiting script execution. ----------------------------------------------------------------------