From 15ce68241564bb3687309e2bd2f93d6cff46add1 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Fri, 25 Jun 2010 21:28:25 +0000 Subject: [PATCH] print more data --- Robust/TransSim/Executor.java | 5 +++-- Robust/TransSim/FileSim.java | 40 +++++++++++++++++++++++++++++------ 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/Robust/TransSim/Executor.java b/Robust/TransSim/Executor.java index e8a74959..3bb129f4 100644 --- a/Robust/TransSim/Executor.java +++ b/Robust/TransSim/Executor.java @@ -70,11 +70,12 @@ public class Executor { } public Executor(String filename) { - BufferedInputStream bir; + BufferedInputStream bir=null; try { bir=new BufferedInputStream(new FileInputStream(filename)); } catch (Exception e) { - throw new Error(); + e.printStackTrace(); + System.exit(-1); } numThreads=readInt(bir); threads=new ThreadClass[numThreads]; diff --git a/Robust/TransSim/FileSim.java b/Robust/TransSim/FileSim.java index f7825847..8baca55c 100644 --- a/Robust/TransSim/FileSim.java +++ b/Robust/TransSim/FileSim.java @@ -14,16 +14,19 @@ public class FileSim { ls.join(); 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()); 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()); 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()); ls5=null; } @@ -41,16 +44,19 @@ public class FileSim { ls6.join(); 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()); 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()); 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()); ls8=null; } @@ -69,26 +75,46 @@ public class FileSim { ls9.join(); 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()); 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()); 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()); } public static void p4(Executor e) throws Exception { - FlexScheduler ls9=new FlexScheduler(e, FlexScheduler.THREAD, null); - ls9.start(); - - ls9.join(); - System.out.println("Karma Abort="+ls9.getTime()); - System.out.println("Aborts="+ls9.getAborts()+" Commit="+ls9.getCommits()); - ls9=null; + FlexScheduler ls12=new FlexScheduler(e, FlexScheduler.THREAD, null); + ls12.start(); + FlexScheduler ls13=new FlexScheduler(e, FlexScheduler.ATTACKTIME, null); + ls13.start(); + FlexScheduler ls14=new FlexScheduler(e, FlexScheduler.ATTACKTHREAD, null); + ls14.start(); + + ls12.join(); + 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()); + 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()); + 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()); + ls14=null; } public static void main(String[] args) throws Exception { -- 2.34.1