Add tiles-rendered-at-once setting, control update tile concurrency

This commit is contained in:
Mike Primm 2011-12-10 11:32:57 +08:00 committed by mikeprimm
parent 9bdf13e460
commit fd887b47b4
3 changed files with 6 additions and 1 deletions

View File

@ -23,6 +23,7 @@ public class AsynchronousQueue<T> {
this.dequeueTime = dequeueTime; this.dequeueTime = dequeueTime;
this.accelDequeueTime = accelDequeueTime; this.accelDequeueTime = accelDequeueTime;
this.accelDequeueThresh = accelDequeueThresh; this.accelDequeueThresh = accelDequeueThresh;
if(pendinglimit < 1) pendinglimit = 1;
this.pendinglimit = pendinglimit; this.pendinglimit = pendinglimit;
} }

View File

@ -683,7 +683,8 @@ public class MapManager {
}, },
(int) (configuration.getDouble("renderinterval", 0.5) * 1000), (int) (configuration.getDouble("renderinterval", 0.5) * 1000),
configuration.getInteger("renderacceleratethreshold", 30), configuration.getInteger("renderacceleratethreshold", 30),
(int)(configuration.getDouble("renderaccelerateinterval", 0.2) * 1000), (Runtime.getRuntime().availableProcessors()+1)/2); (int)(configuration.getDouble("renderaccelerateinterval", 0.2) * 1000),
configuration.getInteger("tiles-rendered-at-once", (Runtime.getRuntime().availableProcessors()+1)/2));
/* On dedicated thread, so default to no delays */ /* On dedicated thread, so default to no delays */
timeslice_int = (long)(configuration.getDouble("timesliceinterval", 0.0) * 1000); timeslice_int = (long)(configuration.getDouble("timesliceinterval", 0.0) * 1000);

View File

@ -130,6 +130,9 @@ renderacceleratethreshold: 60
# How often to render tiles when backlog is above renderacceleratethreshold # How often to render tiles when backlog is above renderacceleratethreshold
renderaccelerateinterval: 0.2 renderaccelerateinterval: 0.2
# How many update tiles to work on at once (if not defined, default is 1/2 the number of cores)
tiles-rendered-at-once: 2
# Save and restore pending tile renders - prevents their loss on server shutdown or /reload # Save and restore pending tile renders - prevents their loss on server shutdown or /reload
saverestorepending: true saverestorepending: true