Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8021117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:53:00+00:00 2026-06-04T21:53:00+00:00

I realize you get more customization but are there performance (mem/speed) benefits to using

  • 0

I realize you get more customization but are there performance (mem/speed) benefits to using the concurrent library classes over just using the stock AsyncTask or just creating threads and calling run?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T21:53:01+00:00Added an answer on June 4, 2026 at 9:53 pm

    Mostly it’s ease of use that AsyncTask brings. That paradigm of working, run this method in the background, and this other method on the UI thread is great for usability (although I’ve made improvements that make exception handling simpler by creating a subclass of vanilla AsyncTask). I think AsyncTask is great for calling services with a request-response type calls. But, not all types of concurrency are valid for AsyncTask.

    Now, there are some tasks that AsyncTask aren’t suited for. For example, if you want to load multiple images from a server at once. AsyncTask might not be the best option. For one AsyncTasks can only be run once and can’t be restarted. AsyncTasks own the thread they run the background method on and that thread can’t be reused or shared. So if you had 10 or 20 images that means 10 or 20 threads to create and shutdown if you used AsyncTasks. Or load all images at once which means your UI won’t update until all images are fully loaded from the server through 20 separate calls. Either you pay for more memory, resources, etc for nice UI response, or your UI pays the price for lower overhead. Neither is great.

    A better option is to load a thread once, send it several light weight jobs to run, and post those back to the UI thread. I created my own version of something like AsyncTask that I call PipelineHandler which creates a single thread, and runs jobs posted to it. Those jobs are something very similar to AsyncTask in that they have a method that is called off the UI thread, and another method that is called on the UI thread to perform updates. The benefit here is that I can leverage a single thread to run as many jobs as I wish. And I can easily scale up the threads servicing the queue as needed without needing to changing anything but a configuration option. Under the covers it uses the Java concurrent classes ExecutorService, but also leverages Handler to provide an ability to run something back on the UI thread. So it combines Java Concurrent lib and Android lib together to build this.

    So to answer your question I think AsyncTask is great for single time jobs like service request-response type calls, but not for batch processing like downloading images or downloading files, especially if you have to make many calls at once. Java concurrent libraries can play a part in helping you perform those types of tasks, but are limited because they only solve half the problem, namely, running things on threads. Java concurrent libraries ARE good for batch job running, but aren’t good with interfacing with the UI thread. So you will have to combine them together, more often than not, to get a solution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to realize a complex if-elif-else statement in Python but I don't get
I realize there are better compilers out there but I have preferred to stick
I realize that there are much more elegant ways to do this, and I
Realize there a lot of bulk email services, but what I'm trying to do
Using the following classes.. public class Trait { public virtual int Id { get;
I realize I'm going to get flamed for not simply writing a test myself...
I realize this question (or questions that look like this) have been asked over
I realize the following function calls are all same, but I do not understand
I've got a question regarding git branching protocol. I'm starting to get more familiar
I realize that HTTPS is supposed to be more secure because it encrypts communication

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.