Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

less synchronization may help to prevent deadlocks

orbiterfe51f4d66801
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<ReferenceType extends Reference> extends AbstractBu
* @throws IOException
* @throws IOException
*/
- public synchronized void add(ReferenceContainer<ReferenceType> newEntries) throws IOException {
+ public void add(ReferenceContainer<ReferenceType> 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<ReferenceType extends Reference> extends AbstractBu
* @throws IOException
*/
public ReferenceContainer<ReferenceType> delete(byte[] termHash) throws IOException {
- ReferenceContainer<ReferenceType> c0 = this.ram.delete(termHash);
- ReferenceContainer<ReferenceType> c1 = this.array.get(termHash);
+ ReferenceContainer<ReferenceType> c0 = this.ram.delete(termHash);
+ ReferenceContainer<ReferenceType> 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<ReferenceType extends Reference> {
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;
}