Friday, September 9, 2011

Re: [android-developers] Re: java Thread class vs Android HanderThread: which is better?

Also, and correct me if I'm wrong.

AsyncTask uses an internal threadpool to balance background requests.
This is really useful if you making many network calls at once but
don't want to start a new thread for each one.
Also, you do get slightly better performance because with AsyncTask
the threads are already running. If you implement your own thread you
have the overhead of starting the thread.

On Fri, Sep 9, 2011 at 12:50 PM, Pratik Prajapati
<pratik.prajapati@gmail.com> wrote:
> yup. got it. Thanks
>
> On Fri, Sep 9, 2011 at 11:12 AM, Doug <beafdefx@gmail.com> wrote:
>>
>> On Sep 7, 8:52 pm, Pratik Prajapati <pratik.prajap...@gmail.com>
>> wrote:
>> > Android documentation says that "consider
>> >
>> > usingAsyncTask<http://developer.android.com/reference/android/os/AsyncTask.html>
>> >  or
>> > HandlerThread<http://developer.android.com/reference/android/os/HandlerThread.html>,
>> > instead of the traditional
>> > Thread<http://developer.android.com/reference/java/lang/Thread.html>
>> >  class"
>> >
>> > Any specific reason for this? Is it like " HanderThread" is just
>> > simpler implantation or also provides better performance?
>>
>> HandlerThread is (surprise) a thread with a Handler attached to it to
>> process the messages in the thread's Looper.  If you don't need or use
>> a Handler for processing messages, then you don't need HandlerThread.
>>
>> Doug
>>
>> --
>> 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
>
>
> --
> Kind Regards,
> Pratik Prajapati
>
>
> --
> 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

--
~ Jeremiah:9:23-24
Android 2D MMORPG: http://solrpg.com/http://www.youtube.com/user/revoltingx

--
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

No comments:

Post a Comment