Author: toad
Date: 2008-03-10 22:04:11 +0000 (Mon, 10 Mar 2008)
New Revision: 18443

Modified:
   trunk/freenet/src/freenet/client/async/ClientRequestScheduler.java
Log:
Reinstate yield()ing here. Maybe it will help with very high latency accessing 
the datastore.

Modified: trunk/freenet/src/freenet/client/async/ClientRequestScheduler.java
===================================================================
--- trunk/freenet/src/freenet/client/async/ClientRequestScheduler.java  
2008-03-10 21:59:52 UTC (rev 18442)
+++ trunk/freenet/src/freenet/client/async/ClientRequestScheduler.java  
2008-03-10 22:04:11 UTC (rev 18443)
@@ -244,6 +244,11 @@
                                        if(block != null) {
                                                if(logMINOR) Logger.minor(this, 
"Can fulfill "+req+" ("+tok+") immediately from store");
                                                getter.onSuccess(block, true, 
tok, this);
+                                               // Even with working thread 
priorities, we still get very high latency accessing
+                                               // the datastore when 
background threads are doing it in parallel.
+                                               // So yield() here, unless 
priority is very high.
+                                               if(req.getPriorityClass() > 
RequestStarter.IMMEDIATE_SPLITFILE_PRIORITY_CLASS)
+                                                       Thread.yield();
                                        } else {
                                                anyValid = true;
                                        }


Reply via email to