Last active
August 29, 2015 14:19
-
-
Save aerodame/c1dc6c7a1b6b28815361 to your computer and use it in GitHub Desktop.
ThreadOS Single Queue debugger
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ----------------------- 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 ----------------------------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment