Skip to content

Commit

Permalink
possible fix for problem in http://forum.yacy-websuche.de/viewtopic.p…
Browse files Browse the repository at this point in the history
…hp?p=17655#p17655

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6376 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
orbiter committed Oct 6, 2009
1 parent f837170 commit 51f2bbf
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions source/de/anomic/kelondro/index/RowCollection.java
Expand Up @@ -535,10 +535,13 @@ public synchronized final void sort() {
}
final byte[] swapspace = new byte[this.rowdef.objectsize];
final int p = partition(0, this.chunkcount, this.sortBound, swapspace);
if ((sortingthreadexecutor != null) &&
(!sortingthreadexecutor.isShutdown()) &&
(serverProcessor.useCPU > 1) &&
(this.chunkcount > 8000)) {
if (sortingthreadexecutor != null &&
!sortingthreadexecutor.isShutdown() &&
serverProcessor.useCPU > 1 &&
this.chunkcount > 8000 &&
p > isortlimit * 5 &&
this.chunkcount - p > isortlimit * 5
) {
// sort this using multi-threading
final Future<Integer> part0 = partitionthreadexecutor.submit(new partitionthread(this, 0, p, 0));
final Future<Integer> part1 = partitionthreadexecutor.submit(new partitionthread(this, p, this.chunkcount, p));
Expand Down

0 comments on commit 51f2bbf

Please sign in to comment.