2 public static void p1(Executor e) throws Exception {
3 FlexScheduler ls=new FlexScheduler(e, FlexScheduler.LAZY, null);
6 //Kill others at commit
7 FlexScheduler ls4=new FlexScheduler(e, FlexScheduler.COMMIT, null);
10 FlexScheduler ls5=new FlexScheduler(e, FlexScheduler.ATTACK, null);
15 System.out.println("Lazy Time="+ls.getTime());
16 System.out.println("Aborts="+ls.getAborts()+" Commit="+ls.getCommits());
17 System.out.println("Stalltime="+ls.getStallTime()+" Backofftime="+ls.getBackoffTime());
21 System.out.println("Fast Abort="+ls4.getTime());
22 System.out.println("Aborts="+ls4.getAborts()+" Commit="+ls4.getCommits());
23 System.out.println("Stalltime="+ls4.getStallTime()+" Backofftime="+ls4.getBackoffTime());
27 System.out.println("Attack Abort="+ls5.getTime());
28 System.out.println("Aborts="+ls5.getAborts()+" Commit="+ls5.getCommits());
29 System.out.println("Stalltime="+ls5.getStallTime()+" Backofftime="+ls5.getBackoffTime());
33 public static void p2(Executor e) throws Exception {
34 FlexScheduler ls6=new FlexScheduler(e, FlexScheduler.SUICIDE, null);
37 FlexScheduler ls7=new FlexScheduler(e, FlexScheduler.TIMESTAMP, null);
40 FlexScheduler ls8=new FlexScheduler(e, FlexScheduler.RANDOM, null);
45 System.out.println("Suicide Abort="+ls6.getTime());
46 System.out.println("Aborts="+ls6.getAborts()+" Commit="+ls6.getCommits());
47 System.out.println("Stalltime="+ls6.getStallTime()+" Backofftime="+ls6.getBackoffTime());
51 System.out.println("Timestamp Abort="+ls7.getTime());
52 System.out.println("Aborts="+ls7.getAborts()+" Commit="+ls7.getCommits());
53 System.out.println("Stalltime="+ls7.getStallTime()+" Backofftime="+ls7.getBackoffTime());
57 System.out.println("Random Abort="+ls8.getTime());
58 System.out.println("Aborts="+ls8.getAborts()+" Commit="+ls8.getCommits());
59 System.out.println("Stalltime="+ls8.getStallTime()+" Backofftime="+ls8.getBackoffTime());
63 public static void p3(Executor e) throws Exception {
64 FlexScheduler ls9=new FlexScheduler(e, FlexScheduler.KARMA, null);
67 FlexScheduler ls10=new FlexScheduler(e, FlexScheduler.POLITE, null);
70 FlexScheduler ls11=new FlexScheduler(e, FlexScheduler.ERUPTION, null);
76 System.out.println("Karma Abort="+ls9.getTime());
77 System.out.println("Aborts="+ls9.getAborts()+" Commit="+ls9.getCommits());
78 System.out.println("Stalltime="+ls9.getStallTime()+" Backofftime="+ls9.getBackoffTime());
82 System.out.println("Polite Abort="+ls10.getTime());
83 System.out.println("Aborts="+ls10.getAborts()+" Commit="+ls10.getCommits());
84 System.out.println("Stalltime="+ls10.getStallTime()+" Backofftime="+ls10.getBackoffTime());
88 System.out.println("Eruption Abort="+ls11.getTime());
89 System.out.println("Aborts="+ls11.getAborts()+" Commit="+ls11.getCommits());
90 System.out.println("Stalltime="+ls11.getStallTime()+" Backofftime="+ls11.getBackoffTime());
93 public static void p4(Executor e) throws Exception {
94 FlexScheduler ls12=new FlexScheduler(e, FlexScheduler.THREAD, null);
96 FlexScheduler ls13=new FlexScheduler(e, FlexScheduler.ATTACKTIME, null);
98 FlexScheduler ls14=new FlexScheduler(e, FlexScheduler.ATTACKTHREAD, null);
102 System.out.println("ThreadPriority Abort="+ls12.getTime());
103 System.out.println("Aborts="+ls12.getAborts()+" Commit="+ls12.getCommits());
104 System.out.println("Stalltime="+ls12.getStallTime()+" Backofftime="+ls12.getBackoffTime());
108 System.out.println("AttackTime Abort="+ls13.getTime());
109 System.out.println("Aborts="+ls13.getAborts()+" Commit="+ls13.getCommits());
110 System.out.println("Stalltime="+ls13.getStallTime()+" Backofftime="+ls13.getBackoffTime());
114 System.out.println("AttackThread Abort="+ls14.getTime());
115 System.out.println("Aborts="+ls14.getAborts()+" Commit="+ls14.getCommits());
116 System.out.println("Stalltime="+ls14.getStallTime()+" Backofftime="+ls14.getBackoffTime());
120 public static void main(String[] args) throws Exception {
121 //time between transactions
123 int splitobjects=100;//10 percent of objects special
124 int splitaccesses=100;//40 percent of accesses to special objects
125 int abortThreshold=0; //need 4 aborts to declare risky
126 int abortRatio=0;//need 40% aborts vs commits to declare risky
127 int deadlockdepth=10;
129 String filename=args[0];
130 Executor e=new Executor(filename);
131 System.out.println(e.maxTime());
132 if (args.length==1||args[1].equals("1"))
134 if (args.length==1||args[1].equals("2"))
136 if (args.length==1||args[1].equals("3"))
138 if (args.length==1||args[1].equals("4"))