Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ----------------------- Start Debugger Method ---------------------------
- // Provide a simple debugger of the TCBs in queue
- // Format of output is = Q[]-> { [p,t] [p,t] [p,t] ... }
- // Where p = Process ID
- // t = Thread ID
- // -------------------------------------------------------------------------
- private void dumpQueue(int time) {
- if (DEBUG) {
- System.out.print("\nT("+time+"): ");
- // how many TCBs are in queue
- int N = queue.size();
- System.out.print("Q[]-> {");
- // print out TCBs in addition to Scheduler TCB
- for(int j=0; j < N; j++) {
- TCB t = (TCB)queue.get(j);
- //if(t.getTid() != 0)
- // System.out.print(" ["+t.getPid()+","+t.getTid()+":"+t.getThread());
- System.out.print(" ["+t.getPid()+","+t.getTid()+"]");
- }
- System.out.print(" } ");
- // }
- }
- }
- // ----------------------- End Debugger Method -----------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement