fix for synchronization deadlock with flushMissNameCache.

see also: http://www.yacy-forum.de/viewtopic.php?p=32939#32939

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3472 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 18 years ago
parent e2ac5f62bd
commit 5b0a84ce09

@ -557,7 +557,7 @@ public final class httpc {
int cutofftime = intTime(System.currentTimeMillis()) - maxNameCacheMissAge;
int size;
String k;
synchronized (nameCacheMiss) {
synchronized (nameCacheMissAges) {
size = nameCacheMissAges.size();
while ((size > 0) &&
(size > maxNameCacheMissSize) || (nameCacheMissAges.getMinScore() < cutofftime)) {

@ -2919,6 +2919,30 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
return false;
}
public void setPerformance(int wantedPPM) {
// we consider 3 cases here
// wantedPPM <= 10: low performance
// 10 < wantedPPM < 1000: custom performance
// 1000 <= wantedPPM : maximum performance
if (wantedPPM <= 10) wantedPPM = 10;
if (wantedPPM >= 1000) wantedPPM = 1000;
int newBusySleep = 60000 / wantedPPM;
serverThread CRAWLSTACK_thread = getThread(CRAWLSTACK);
serverThread INDEXER_thread = getThread(INDEXER);
serverThread PROXY_CACHE_ENQUEUE_thread = getThread(PROXY_CACHE_ENQUEUE);
serverThread CRAWLJOB_REMOTE_TRIGGERED_CRAWL_thread = getThread(CRAWLJOB_REMOTE_TRIGGERED_CRAWL);
serverThread CRAWLJOB_GLOBAL_CRAWL_TRIGGER_thread = getThread(CRAWLJOB_GLOBAL_CRAWL_TRIGGER);
serverThread CRAWLJOB_LOCAL_CRAWL_thread = getThread(CRAWLJOB_LOCAL_CRAWL);
serverThread INDEX_DIST_thread = getThread(INDEX_DIST);
CRAWLJOB_LOCAL_CRAWL_thread.setBusySleep(newBusySleep);
setConfig(CRAWLJOB_LOCAL_CRAWL, Long.toString(newBusySleep));
}
public void startTransferWholeIndex(yacySeed seed, boolean delete) {
if (transferIdxThread == null) {
this.transferIdxThread = new plasmaDHTFlush(this.log, this.wordIndex, seed, delete,

Loading…
Cancel
Save