------------------------------------------------------- CS 6560: OOOS Expected Output ------------------------------------------------------- TEST: SCHEDULING Implement: PCB, Queue, FIFOQueue Scheduler [but just the signatures for now] Proc [in OOOS.java, uncomment 2 refs to sch] Null, Scheduler [full implementation now] PrioQueue Compile : javac Processes.java Execute : java Processes Output : Should approximate the following depending on Start(), System.out/Yield() pairs Process #1 Running Process #2 Running Process #1 running at step 6 Process #2 running at step 6 Process #1 running at step 5 Process #2 running at step 5 Process #1 running at step 4 Process #2 running at step 4 Process #1 running at step 3 Process #2 running at step 3 Process #1 running at step 2 Process #2 running at step 2 Process #1 running at step 1 Process #2 running at step 1 ------------------------------------------------------- TEST: SEMAPHORES Implement: Semaphore DiningPhilosophers [start with a copy of Processes.java] [instead of OOOS.out, use System.out/Yield() pairs] [instead of Stop(), use System.out.exit(0)] Compile : javac DiningPhilosophers.java Execute : java DiningPhilosophers Output : Philosopher #1 Running Philosopher #2 Running Philosopher #1 eating at step 6 Philosopher #2 eating at step 6 Philosopher #1 eating at step 5 Philosopher #2 eating at step 5 Philosopher #1 eating at step 4 Philosopher #2 eating at step 4 Philosopher #1 eating at step 3 Philosopher #2 eating at step 3 Philosopher #1 eating at step 2 Philosopher #2 eating at step 2 Philosopher #1 eating at step 1 ***** Note: The exit in #1 causes #2 to abort early ------------------------------------------------------- TEST: PORTS Implement: PortIF, Message, Port Compile : javac LeaderElection.java Execute : java LeaderElection Output : LeaderProc #1 Running LeaderProc #2 Running LeaderProc #3 Running LeaderProc #4 Running LeaderProc #5 Running LeaderProc #6 Running LeaderProc #1 sends i: 1 LeaderProc #2 sends i: 2 LeaderProc #3 sends i: 3 LeaderProc #4 sends i: 4 LeaderProc #5 sends i: 5 LeaderProc #6 sends i: 6 LeaderProc #1 sends next_temp_id: 6 LeaderProc #2 sends next_temp_id: 6 LeaderProc #3 sends next_temp_id: 6 LeaderProc #4 sends next_temp_id: 6 LeaderProc #5 sends next_temp_id: 6 LeaderProc #6 elects itself leader i: 6 ------------------------------------------------------- TEST: OUTPUT Implement: Buffer, OutConsumer, OutProducer DiningPhilosophers [use your original version] [in OOOS.java, uncomment 2 refs to out] [instead of System.out/Yield() pairs, use OOOS.out] Compile : javac DiningPhilosophers.java Execute : java DiningPhilosophers Output : Philosopher #1 Running Philosopher #2 Running Philosopher #1 eating at step 6 Philosopher #2 eating at step 6 Philosopher #1 eating at step 5 Philosopher #2 eating at step 5 Philosopher #1 eating at step 4 Philosopher #2 eating at step 4 Philosopher #1 eating at step 3 Philosopher #2 eating at step 3 Philosopher #1 eating at step 2 Philosopher #2 eating at step 2 Philosopher #1 eating at step 1 ***** Note: The exit in #1 causes #2 to abort early ------------------------------------------------------- TEST: DISK Implement: DiskReq, BufPool, DiskQueue, DiskLower DiskUpper [in OOOS.java, uncomment 2 refs to disk] Compile : javac DiskClient.java Config : rm -rf OOOSDISK Execute : java DiskClient Output : DiskClient #1 Running DiskClient write to disk block #25 DiskClient write to disk block #76 DiskClient write to disk block #95 DiskClient write to disk block #26 DiskClient write to disk block #8 DiskClient write to disk block #8 DiskLower write to disk block #25 DiskLower write to disk block #26 DiskLower write to disk block #76 DiskLower write to disk block #95 DiskLower write to disk block #8 DiskLower write to disk block #8 DiskClient #1 wasting some time DiskClient #1 wasting more time DiskClient write to disk block #69 DiskClient write to disk block #83 DiskClient write to disk block #39 DiskClient write to disk block #0 DiskClient write to disk block #38 DiskClient write to disk block #46 DiskClient read from disk block #25 DiskLower write to disk block #69 DiskLower write to disk block #83 DiskLower write to disk block #46 DiskLower write to disk block #39 DiskLower write to disk block #38 DiskLower read from disk block #25 DiskLower write to disk block #0 DiskClient read from disk block #76 DiskLower read from disk block #76 DiskClient read from disk block #95 DiskLower read from disk block #95 DiskClient read from disk block #26 DiskLower read from disk block #26 DiskClient read from disk block #8 DiskLower read from disk block #8 DiskClient read from disk block #8 DiskLower read from disk block #8