Ejemplo n.º 1
0
  public Job getJob(int id) {
    Job retJob = null;

    retJob = Am.getJob(id);
    if (retJob == null) {
      retJob = A1in.getJob(id);
    }
    return retJob;
  }
Ejemplo n.º 2
0
 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;
     }
   }
 }
Ejemplo n.º 3
0
  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);
        }
      }
    }
  }
Ejemplo n.º 4
0
 /* methods for the A1out buffer */
 public Job FindInA1out(int id) {
   return A1out.getJob(id);
 }
Ejemplo n.º 5
0
 /* methods for the A1in buffer */
 public Job FindInA1in(int id) {
   return A1in.getJob(id);
 }
Ejemplo n.º 6
0
 /* methods for the Am buffer */
 public Job FindInAm(int id) {
   return Am.getJob(id);
 }