From a9be47cea45c19f2869732252e9922bf88fa4d86 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Fri, 26 Jun 2009 10:34:20 -0700 Subject: Tweak the core and maximum pool sizes for AsyncTask. This change allows up to 5 AsyncTasks to run concurrently. Before, only 1 task could run at a time, which was too limited. This change also bumps up the maximum number of tasks that can be created; this large number is not an issue because tasks are queued up and run only 5 at a time. --- core/java/android/os/AsyncTask.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core/java/android') diff --git a/core/java/android/os/AsyncTask.java b/core/java/android/os/AsyncTask.java index 6c135825a99f..abfb27412de0 100644 --- a/core/java/android/os/AsyncTask.java +++ b/core/java/android/os/AsyncTask.java @@ -127,12 +127,12 @@ import java.util.concurrent.atomic.AtomicInteger; public abstract class AsyncTask { private static final String LOG_TAG = "AsyncTask"; - private static final int CORE_POOL_SIZE = 1; - private static final int MAXIMUM_POOL_SIZE = 10; + private static final int CORE_POOL_SIZE = 5; + private static final int MAXIMUM_POOL_SIZE = 128; private static final int KEEP_ALIVE = 10; private static final BlockingQueue sWorkQueue = - new LinkedBlockingQueue(MAXIMUM_POOL_SIZE); + new LinkedBlockingQueue(10); private static final ThreadFactory sThreadFactory = new ThreadFactory() { private final AtomicInteger mCount = new AtomicInteger(1); -- cgit v1.2.3