// #4 SHELL package ooos; // UML shows Proc inherits ("is a") from Thread, hence, "start" method, etc. public class Proc extends Thread { // UML shows that Proc "has a" PCB named pcb // UML shows TWO constructors for Proc objects // This constructor requires two parameters, hence, allows apps to make // processes of differing priorites. This is not typical. public Proc(String name, int priority) { // 1.1: this line of code calls the parent (Thread) constructor // and 1.1 is triggered by the 1: call below // 1.2: is the second line of code in this constructor // UML "create" is generic for Java's "new" } // This constructor is simpler, more typical, and only needs the name, like Philosopher #1 // UML shows "create" calling this particular constructor public Proc(String name) { // 1: is the ONLY line of code within this constructor // look above for the 1.1: line of code } public void Start(){ // 1: UML shows ONLY one line of code, and it is NOT the "start" call below. // The Thread inherited start call is only here to give the Processes.java // test program concurrency. Look at the results at the beginning of test.txt // REMOVE the start call when you get to this programming. // Your OOOS will provide the concurrency/scheduling by this time. start(); } public void Stop(){ // 1: } public void Suspend() { // 1: // 2: IF // 2_1: // 2_2a: IF // 2_2b: ELSE // There is NO ELSE to 2: because that would not be a legal suspension, // hence there is nothing to do } public void Resume() { // 1: IF // 1_1: // 1_2: } public void Yield(){ // looks like Resume } // setState is mutator method, getstate and getPrio are accessor methods // Note the spelling of "getstate" so as not to confuse with Thread's getState public void setPrio(int priority){ // 1: // 2: IF // 2_1: // 3: IF // 3_1: // 3_2: // 3_3: } // UML shows currentProc is underlined, what does that mean? }