Received: by 10.204.139.84 with SMTP id d20mr293171bku.4.1314990852734; Fri, 02 Sep 2011 12:14:12 -0700 (PDT) X-BeenThere: android-developers@googlegroups.com Received: by 10.204.148.152 with SMTP id p24ls1729934bkv.0.gmail; Fri, 02 Sep 2011 12:12:23 -0700 (PDT) Received: by 10.204.10.66 with SMTP id o2mr272871bko.12.1314990743491; Fri, 02 Sep 2011 12:12:23 -0700 (PDT) Received: by 10.204.10.66 with SMTP id o2mr272869bko.12.1314990743447; Fri, 02 Sep 2011 12:12:23 -0700 (PDT) Return-Path: Received: from mail-fx0-f42.google.com (mail-fx0-f42.google.com [209.85.161.42]) by gmr-mx.google.com with ESMTPS id k16si2145fah.0.2011.09.02.12.12.22 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 02 Sep 2011 12:12:22 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.161.42 is neither permitted nor denied by best guess record for domain of hack...@android.com) client-ip=209.85.161.42; Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 209.85.161.42 is neither permitted nor denied by best guess record for domain of hack...@android.com) smtp.mail=hack...@android.com Received: by fxe23 with SMTP id 23so4296431fxe.1 for ; Fri, 02 Sep 2011 12:12:22 -0700 (PDT) Received: by 10.223.5.11 with SMTP id 11mr438998fat.12.1314990742241; Fri, 02 Sep 2011 12:12:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.152.6.41 with HTTP; Fri, 2 Sep 2011 12:12:02 -0700 (PDT) In-Reply-To: References: From: Dianne Hackborn Date: Fri, 2 Sep 2011 12:12:02 -0700 Message-ID: Subject: Re: [android-developers] Can we create two ThreadPoolExecutor running on android? To: android-developers@googlegroups.com Content-Type: multipart/alternative; boundary=00151747b4021303b104abfa247e --00151747b4021303b104abfa247e Content-Type: text/plain; charset=ISO-8859-1 Personally I think there is no reason to do this. AsyncTask just has a facility to deliver results back to the main thread. This is nothing tied to UI. The main thread just happens to be where UI is running as well as many other things such as the callbacks to Service itself. If you don't want to do stuff in these callbacks, you don't need to. On Tue, Aug 30, 2011 at 9:30 AM, usher wrote: > AsyncTask is managing a thread pool with 5 core thread. Once we start > to use AsyncTask, it will start to set up this thread pool on android > phone. > > The reason I don't want to AsyncTask is because I am going to create a > service, and start threads from service, which means there is not much > UI updates from task. However, asynctask has to been created and > execute on UI thread. > > So I am going to create another different thread pool which will be > used to manage this kind of threads. What I am worrying about is that > if I create another thread pool with 5 core threads, would that be too > much threads(10 core threads) running on the android? will that slow > it down and cause bad performance? > > Thanks. > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscribe@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --00151747b4021303b104abfa247e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Personally I think there is no reason to do this. =A0AsyncTask just has a f= acility to deliver results back to the main thread. =A0This is nothing tied= to UI. =A0The main thread just happens to be where UI is running as well a= s many other things such as the callbacks to Service itself. =A0If you don&= #39;t want to do stuff in these callbacks, you don't need to.




--
Diann= e Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private = questions to me, as I don't have time to provide private support, and s= o won't reply to such e-mails.=A0 All such questions should be posted o= n public forums, where I and others can see and answer them.

--00151747b4021303b104abfa247e--