Browse Source

Limit the number of decoder threads to 4

They just end up burning CPU fighting each other without much
improvement to the decoding time beyond four threads.
tags/v1.6.90
Pierre Ossman 8 years ago
parent
commit
a0eb1e8af9
1 changed files with 6 additions and 1 deletions
  1. 6
    1
      common/rfb/DecodeManager.cxx

+ 6
- 1
common/rfb/DecodeManager.cxx View File

@@ -51,7 +51,12 @@ DecodeManager::DecodeManager(CConnection *conn) :
vlog.error("Unable to determine the number of CPU cores on this system");
cpuCount = 1;
} else {
vlog.info("Detected %d CPU core(s) available for decoding", (int)cpuCount);
vlog.info("Detected %d CPU core(s)", (int)cpuCount);
// No point creating more threads than this, they'll just end up
// wasting CPU fighting for locks
if (cpuCount > 4)
cpuCount = 4;
vlog.info("Creating %d decoder thread(s)", (int)cpuCount);
}

while (cpuCount--) {

Loading…
Cancel
Save