System.out.println("Lazy Time="+ls.getTime());
System.out.println("Aborts="+ls.getAborts()+" Commit="+ls.getCommits());
System.out.println("Stalltime="+ls.getStallTime()+" Backofftime="+ls.getBackoffTime());
+ System.out.println("Abortedtime="+ls.getAbortedTime());
ls=null;
ls4.join();
System.out.println("Fast Abort="+ls4.getTime());
System.out.println("Aborts="+ls4.getAborts()+" Commit="+ls4.getCommits());
System.out.println("Stalltime="+ls4.getStallTime()+" Backofftime="+ls4.getBackoffTime());
+ System.out.println("Abortedtime="+ls4.getAbortedTime());
ls4=null;
ls5.join();
System.out.println("Attack Abort="+ls5.getTime());
System.out.println("Aborts="+ls5.getAborts()+" Commit="+ls5.getCommits());
System.out.println("Stalltime="+ls5.getStallTime()+" Backofftime="+ls5.getBackoffTime());
+ System.out.println("Abortedtime="+ls5.getAbortedTime());
ls5=null;
}
System.out.println("Suicide Abort="+ls6.getTime());
System.out.println("Aborts="+ls6.getAborts()+" Commit="+ls6.getCommits());
System.out.println("Stalltime="+ls6.getStallTime()+" Backofftime="+ls6.getBackoffTime());
+ System.out.println("Abortedtime="+ls6.getAbortedTime());
ls6=null;
ls7.join();
System.out.println("Timestamp Abort="+ls7.getTime());
System.out.println("Aborts="+ls7.getAborts()+" Commit="+ls7.getCommits());
System.out.println("Stalltime="+ls7.getStallTime()+" Backofftime="+ls7.getBackoffTime());
+ System.out.println("Abortedtime="+ls7.getAbortedTime());
ls7=null;
ls8.join();
System.out.println("Random Abort="+ls8.getTime());
System.out.println("Aborts="+ls8.getAborts()+" Commit="+ls8.getCommits());
System.out.println("Stalltime="+ls8.getStallTime()+" Backofftime="+ls8.getBackoffTime());
+ System.out.println("Abortedtime="+ls8.getAbortedTime());
ls8=null;
}
System.out.println("Karma Abort="+ls9.getTime());
System.out.println("Aborts="+ls9.getAborts()+" Commit="+ls9.getCommits());
System.out.println("Stalltime="+ls9.getStallTime()+" Backofftime="+ls9.getBackoffTime());
+ System.out.println("Abortedtime="+ls9.getAbortedTime());
ls9=null;
ls10.join();
System.out.println("Polite Abort="+ls10.getTime());
System.out.println("Aborts="+ls10.getAborts()+" Commit="+ls10.getCommits());
System.out.println("Stalltime="+ls10.getStallTime()+" Backofftime="+ls10.getBackoffTime());
+ System.out.println("Abortedtime="+ls10.getAbortedTime());
ls10=null;
ls11.join();
System.out.println("Eruption Abort="+ls11.getTime());
System.out.println("Aborts="+ls11.getAborts()+" Commit="+ls11.getCommits());
System.out.println("Stalltime="+ls11.getStallTime()+" Backofftime="+ls11.getBackoffTime());
+ System.out.println("Abortedtime="+ls11.getAbortedTime());
}
public static void p4(Executor e) throws Exception {
System.out.println("ThreadPriority Abort="+ls12.getTime());
System.out.println("Aborts="+ls12.getAborts()+" Commit="+ls12.getCommits());
System.out.println("Stalltime="+ls12.getStallTime()+" Backofftime="+ls12.getBackoffTime());
+ System.out.println("Abortedtime="+ls12.getAbortedTime());
ls12=null;
ls13.join();
System.out.println("AttackTime Abort="+ls13.getTime());
System.out.println("Aborts="+ls13.getAborts()+" Commit="+ls13.getCommits());
System.out.println("Stalltime="+ls13.getStallTime()+" Backofftime="+ls13.getBackoffTime());
+ System.out.println("Abortedtime="+ls13.getAbortedTime());
ls13=null;
ls14.join();
System.out.println("AttackThread Abort="+ls14.getTime());
System.out.println("Aborts="+ls14.getAborts()+" Commit="+ls14.getCommits());
System.out.println("Stalltime="+ls14.getStallTime()+" Backofftime="+ls14.getBackoffTime());
+ System.out.println("Abortedtime="+ls14.getAbortedTime());
ls14=null;
}
return backoffcycles;
}
+ public long getAbortedTime() {
+ return abortedcycles;
+ }
+
+ //Computes wasted time
+ public void timewasted(int currthread, long currtime) {
+ Event e=currentevents[currthread];
+ Transaction trans=e.getTransaction();
+ int eIndex=e.getEvent();
+ long eTime=e.getTime();
+ long timeleft=eTime-currtime;
+ long totaltime=0;
+ for(int i=0;i<=eIndex;i++)
+ totaltime+=trans.getTime(i);
+ totaltime-=timeleft;//subtract off time to the next event
+ abortedcycles+=totaltime;
+ }
+
//Aborts another thread...
public void reschedule(int currthread, long currtime, long backofftime) {
long time=currtime+backofftime;
serAbort.addPoint(currtime, threadid);
} else if (policy==COMMIT||policy==LOCKCOMMIT) {
//abort it immediately
+ timewasted(threadid, currtime);
reschedule(threadid, currtime, 0);
abortcount++;
}
}
} else {
abortcount++;
+ timewasted(ev.getThread(), currtime);
}
//add next transaction event...could be us if we aborted
//abort other transactions
for(Iterator thit=threadstokill.iterator();thit.hasNext();) {
Integer thread=(Integer)thit.next();
+ timewasted(thread, time);
reschedule(thread, time, 0);
abortcount++;
}
if (dback>0)
backoff[thread]=dback;
int atime=r.nextInt(backoff[thread]);
+ timewasted(thread, time);
reschedule(thread, time, atime);
abortcount++;
}
if (dback>0)
backoff[thread]=dback;
int atime=r.nextInt(backoff[thread]);
+ timewasted(thread, time);
reschedule(thread, time, atime);
abortcount++;
}
retrycount[ev.getThread()]=0;
for(Iterator thit=threadstokill.iterator();thit.hasNext();) {
Integer thread=(Integer)thit.next();
+ timewasted(thread, time);
reschedule(thread, time, 0);
abortcount++;
}
} else if (policy==ATTACK) {
for(Iterator thit=threadstokill.iterator();thit.hasNext();) {
Integer thread=(Integer)thit.next();
+ timewasted(thread, time);
reschedule(thread, time, r.nextInt(backoff[thread.intValue()]));
int dback=backoff[thread.intValue()]*2;
if (dback>0)
}
return true;
} else if (policy==SUICIDE) {
+ timewasted(ev.getThread(), time);
reschedule(ev.getThread(), time, r.nextInt(backoff[ev.getThread()]));
int dback=backoff[ev.getThread()]*2;
if (dback>0)
}
if (opponenttime>ev.getTransaction().getTime(ev.getEvent())) {
//kill ourself
+ timewasted(ev.getThread(), time);
reschedule(ev.getThread(), time, 0);
abortcount++;
return false;
//kill the opponents
for(Iterator thit=threadstokill.iterator();thit.hasNext();) {
Integer thread=(Integer)thit.next();
+ timewasted(thread, time);
reschedule(thread, time, 0);
abortcount++;
}
}
if (ev.getThread()>tid) {
//kill ourself
+ timewasted(ev.getThread(), time);
reschedule(ev.getThread(), time, 0);
abortcount++;
return false;
//kill the opponents
for(Iterator thit=threadstokill.iterator();thit.hasNext();) {
Integer thread=(Integer)thit.next();
+ timewasted(thread, time);
reschedule(thread, time, 0);
abortcount++;
}
}
if (opponenttime>ev.getTransaction().getTime(ev.getEvent())) {
//kill ourself
+ timewasted(ev.getThread(), time);
reschedule(ev.getThread(), time, 0);
threadinfo[ev.getThread()].aborted=true;
abortcount++;
//kill the opponents
for(Iterator thit=threadstokill.iterator();thit.hasNext();) {
Integer thread=(Integer)thit.next();
+ timewasted(thread, time);
reschedule(thread, time, 0);
threadinfo[thread.intValue()].aborted=true;
abortcount++;
} else {
for(Iterator thit=threadstokill.iterator();thit.hasNext();) {
Integer thread=(Integer)thit.next();
+ timewasted(thread, time);
reschedule(thread, time, 0);
threadinfo[thread.intValue()].aborted=true;
abortcount++;
}
if (opponentthr<tev) {
//kill ourself
+ timewasted(ev.getThread(), time);
reschedule(ev.getThread(), time, 0);
threadinfo[ev.getThread()].aborted=true;
abortcount++;
//kill the opponents
for(Iterator thit=threadstokill.iterator();thit.hasNext();) {
Integer thread=(Integer)thit.next();
+ timewasted(thread, time);
reschedule(thread, time, 0);
threadinfo[thread.intValue()].aborted=true;
abortcount++;
} else {
for(Iterator thit=threadstokill.iterator();thit.hasNext();) {
Integer thread=(Integer)thit.next();
+ timewasted(thread, time);
reschedule(thread, time, 0);
threadinfo[thread.intValue()].aborted=true;
abortcount++;