From fe51f4d6680117d5760cb7d2fcb2044e613c157d Mon Sep 17 00:00:00 2001 From: orbiter Date: Thu, 23 Apr 2009 20:54:13 +0000 Subject: [PATCH] less synchronization may help to prevent deadlocks git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5863 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/kelondro/text/IndexCell.java | 8 ++++---- .../de/anomic/kelondro/text/ReferenceContainerArray.java | 2 +- source/de/anomic/plasma/plasmaSearchRankingProcess.java | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/source/de/anomic/kelondro/text/IndexCell.java b/source/de/anomic/kelondro/text/IndexCell.java index a5c8973d4..e563d7037 100644 --- a/source/de/anomic/kelondro/text/IndexCell.java +++ b/source/de/anomic/kelondro/text/IndexCell.java @@ -96,13 +96,13 @@ public final class IndexCell extends AbstractBu * @throws IOException * @throws IOException */ - public synchronized void add(ReferenceContainer newEntries) throws IOException { + public void add(ReferenceContainer newEntries) throws IOException { this.ram.add(newEntries); serverProfiling.update("wordcache", Long.valueOf(this.ram.size()), true); cleanCache(); } - public synchronized void add(byte[] termHash, ReferenceType entry) throws IOException { + public void add(byte[] termHash, ReferenceType entry) throws IOException { this.ram.add(termHash, entry); serverProfiling.update("wordcache", Long.valueOf(this.ram.size()), true); cleanCache(); @@ -153,8 +153,8 @@ public final class IndexCell extends AbstractBu * @throws IOException */ public ReferenceContainer delete(byte[] termHash) throws IOException { - ReferenceContainer c0 = this.ram.delete(termHash); - ReferenceContainer c1 = this.array.get(termHash); + ReferenceContainer c0 = this.ram.delete(termHash); + ReferenceContainer c1 = this.array.get(termHash); if (c1 == null) { if (c0 == null) return null; return c0; diff --git a/source/de/anomic/kelondro/text/ReferenceContainerArray.java b/source/de/anomic/kelondro/text/ReferenceContainerArray.java index db5695384..a8b1ce26b 100644 --- a/source/de/anomic/kelondro/text/ReferenceContainerArray.java +++ b/source/de/anomic/kelondro/text/ReferenceContainerArray.java @@ -81,7 +81,7 @@ public final class ReferenceContainerArray { this.array.clear(); } - public synchronized int size() { + public int size() { return (this.array == null) ? 0 : this.array.size(); } diff --git a/source/de/anomic/plasma/plasmaSearchRankingProcess.java b/source/de/anomic/plasma/plasmaSearchRankingProcess.java index 3a389239b..fbb5891b1 100644 --- a/source/de/anomic/plasma/plasmaSearchRankingProcess.java +++ b/source/de/anomic/plasma/plasmaSearchRankingProcess.java @@ -296,7 +296,7 @@ public final class plasmaSearchRankingProcess { // finally remove the best entry from the doubledom cache m = this.doubleDomCache.get(bestEntry.element.metadataHash().substring(6)); o = m.pop(); - assert o == null || o.element.metadataHash().equals(bestEntry.element.metadataHash()); + assert o == null || o.element.metadataHash().equals(bestEntry.element.metadataHash()) : "bestEntry.element.metadataHash() = " + bestEntry.element.metadataHash() + ", o.element.metadataHash() = " + o.element.metadataHash(); return bestEntry; }