diff options
author | John Reck <jreck@google.com> | 2015-07-07 12:17:50 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2015-07-07 16:19:57 -0700 |
commit | c452654a4571ef010a00cef79f82b6b2179704f6 (patch) | |
tree | 2f6c65842178e128a29aa19dbb03d5c50d1f9a38 /libs/hwui/thread | |
parent | 00c713fd379edca0f3b472f55bd5d315bad671fb (diff) | |
download | frameworks_base-c452654a4571ef010a00cef79f82b6b2179704f6.zip frameworks_base-c452654a4571ef010a00cef79f82b6b2179704f6.tar.gz frameworks_base-c452654a4571ef010a00cef79f82b6b2179704f6.tar.bz2 |
Restrict number of hwuiTask threads
Bug: 22324907
Change-Id: I0013557ede15949a5bd6f3f75bc5dd023a9f945b
Diffstat (limited to 'libs/hwui/thread')
-rw-r--r-- | libs/hwui/thread/TaskManager.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/hwui/thread/TaskManager.cpp b/libs/hwui/thread/TaskManager.cpp index f0ed0bb..e9dde29 100644 --- a/libs/hwui/thread/TaskManager.cpp +++ b/libs/hwui/thread/TaskManager.cpp @@ -33,7 +33,9 @@ TaskManager::TaskManager() { // Get the number of available CPUs. This value does not change over time. int cpuCount = sysconf(_SC_NPROCESSORS_CONF); - int workerCount = MathUtils::max(1, cpuCount / 2); + // Really no point in making more than 2 of these worker threads, but + // we do want to limit ourselves to 1 worker thread on dual-core devices. + int workerCount = cpuCount > 2 ? 2 : 1; for (int i = 0; i < workerCount; i++) { String8 name; name.appendFormat("hwuiTask%d", i + 1); |