[android-developers] Re: Can we create two ThreadPoolExecutor running on android?
A quick Google search did not turn it up, but I seem to recall some
rather heated discussion in this very group about the promise and
problems of using AsyncTask with a Service instead of an Activity. The
consensus I remember from it (my memory might not be too accurate) is
that it creates more problems than it solves.
So that would explain why he does not want to rely on AsyncTask's "
facility to deliver results back to the main thread." That and the
fact that Threads aren't being started from an Activity in the first
place.
On Sep 2, 12:12 pm, Dianne Hackborn <hack...@android.com> wrote:
> 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 <usher...@gmail.com> 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.
--
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
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home