2 public static void main(String[] args) throws Exception {
3 //time between transactions
5 int splitobjects=100;//10 percent of objects special
6 int splitaccesses=100;//40 percent of accesses to special objects
7 int abortThreshold=0; //need 4 aborts to declare risky
8 int abortRatio=0;//need 40% aborts vs commits to declare risky
11 String filename=args[0];
12 Executor e=new Executor(filename);
13 System.out.println(e.maxTime());
14 FlexScheduler ls=new FlexScheduler(e, FlexScheduler.LAZY, null);
19 //Kill others at commit
20 FlexScheduler ls4=new FlexScheduler(e, FlexScheduler.COMMIT, null);
25 FlexScheduler ls5=new FlexScheduler(e, FlexScheduler.ATTACK, null);
30 FlexScheduler ls6=new FlexScheduler(e, FlexScheduler.POLITE, null);
35 FlexScheduler ls7=new FlexScheduler(e, FlexScheduler.KARMA, null);
40 System.out.println("Lazy Time="+ls.getTime());
41 System.out.println("Aborts="+ls.getAborts()+" Commit="+ls.getCommits());
44 System.out.println("Fast Abort="+ls4.getTime());
45 System.out.println("Aborts="+ls4.getAborts()+" Commit="+ls4.getCommits());
48 System.out.println("Attack Abort="+ls5.getTime());
49 System.out.println("Aborts="+ls5.getAborts()+" Commit="+ls5.getCommits());
52 System.out.println("Polite Abort="+ls6.getTime());
53 System.out.println("Aborts="+ls6.getAborts()+" Commit="+ls6.getCommits());
56 System.out.println("Karma Abort="+ls7.getTime());
57 System.out.println("Aborts="+ls7.getAborts()+" Commit="+ls7.getCommits());
58 ls=null;ls4=null;ls5=null;ls6=null;ls7=null;
61 //Lock object accesses
62 FlexScheduler ls2=new FlexScheduler(e, FlexScheduler.LOCK, abortThreshold, abortRatio, deadlockdepth, null);
65 System.out.println("Deadlock count="+ls2.getDeadLockCount());
66 System.out.println("Lock Abort="+ls2.getTime());
67 System.out.println("Aborts="+ls2.getAborts()+" Commit="+ls2.getCommits());
71 //Lock Commit object accesses
72 FlexScheduler ls3=new FlexScheduler(e, FlexScheduler.LOCKCOMMIT, abortThreshold, abortRatio, deadlockdepth, null);
75 System.out.println("Deadlock count="+ls3.getDeadLockCount());
76 System.out.println("LockCommit Abort="+ls3.getTime());
77 System.out.println("Aborts="+ls3.getAborts()+" Commit="+ls3.getCommits());