public Job getJob(int id) { Job retJob = null; retJob = Am.getJob(id); if (retJob == null) { retJob = A1in.getJob(id); } return retJob; }
public Job release(int id) { if (Am.getJob(id) != null) { return Am.DequeueJob(id); } else { if (A1in.getJob(id) != null) { return A1in.DequeueJob(id); } else { // ERROR! // job is neither in Am nor A1in, so why are we here???! assert (false); return null; } } }
public void Request(int id) { Job reclaimed = null; if (Am.getJob(id) != null) { Am.EnqueueJob(0, Am.DequeueJob(id)); } else { if (A1out.getJob(id) != null) { reclaimed = Reclaim(id); Am.EnqueueJob(0, reclaimed); } else { if (A1in.getJob(id) != null) { // do nothing } else { reclaimed = Reclaim(id); A1in.EnqueueJob(0, reclaimed); } } } }
/* methods for the A1out buffer */ public Job FindInA1out(int id) { return A1out.getJob(id); }
/* methods for the A1in buffer */ public Job FindInA1in(int id) { return A1in.getJob(id); }
/* methods for the Am buffer */ public Job FindInAm(int id) { return Am.getJob(id); }