From 313033493238d63a62ed32e12341c69189d80e58 Mon Sep 17 00:00:00 2001 From: orbiter Date: Sat, 13 Jun 2009 23:34:16 +0000 Subject: [PATCH] - start first with threads that run more loops - join first with threads that run less loops git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6067 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/tools/DidYouMean.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/source/de/anomic/tools/DidYouMean.java b/source/de/anomic/tools/DidYouMean.java index 10f20a3dd..ddc7666e3 100644 --- a/source/de/anomic/tools/DidYouMean.java +++ b/source/de/anomic/tools/DidYouMean.java @@ -52,14 +52,14 @@ public class DidYouMean { this.ChangingOneLetter.start(); this.AddingOneLetter.start(); - this.DeletingOneLetter.start(); this.ReversingTwoConsecutiveLetters.start(); + this.DeletingOneLetter.start(); try { - this.ChangingOneLetter.join(TIMEOUT); - this.AddingOneLetter.join(TIMEOUT); this.DeletingOneLetter.join(TIMEOUT); this.ReversingTwoConsecutiveLetters.join(TIMEOUT); + this.ChangingOneLetter.join(TIMEOUT); + this.AddingOneLetter.join(TIMEOUT); } catch (InterruptedException e) { } @@ -70,7 +70,8 @@ public class DidYouMean { } - private class ChangingOneLetter extends Thread { + private class ChangingOneLetter extends Thread { + // tests: alphabet.length * len public void run() { String s; int count = 0; @@ -87,6 +88,7 @@ public class DidYouMean { } private class DeletingOneLetter extends Thread { + // tests: len public void run() { String s; int count = 0; @@ -101,6 +103,7 @@ public class DidYouMean { } private class AddingOneLetter extends Thread { + // tests: alphabet.length * len public void run() { String s; int count = 0; @@ -117,10 +120,11 @@ public class DidYouMean { } private class ReversingTwoConsecutiveLetters extends Thread { + // tests: alphabet.length * (len - 1) public void run() { String s; int count = 0; - for(int i=0; i