less synchronization may help to prevent deadlocks

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5863 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 16 years ago
parent 58802e4201
commit fe51f4d668

@ -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;

@ -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();
}

@ -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;
}

Loading…
Cancel
Save