In the Android application from the Application-class will start a few singletons, each with a few AsyncTask's. In this case, it will simultaneously run a maximum of 5 or 128 AsyncTask's? SDK>16
-
1Your question is not clear at all – Reena Mar 10 '17 at 05:50
-
What's your question? – MathankumarK Mar 10 '17 at 05:51
-
Thare can only be so many *simultaneously* running threads as you have cores in your hardware. – Henry Mar 10 '17 at 05:52
2 Answers
How many async task can be used in a class android? check this thread, I think it would be useful. Summary - you can run as much as you want, but they would execute parallel or serial after some point (when all threads would be used). And it depends on device.

- 1
- 1

- 2,109
- 14
- 23
When first introduced, AsyncTasks were executed serially on a single background thread. Starting with DONUT, this was changed to a pool of threads allowing multiple tasks to operate in parallel. Starting with HONEYCOMB, tasks are executed on a single thread to avoid common application errors caused by parallel execution.
Based on the description above, I assumed that starting from API 11, all tasks will be executed in serial execution on a single thread, meaning that one at a time, unless we call AsyncTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
on every tasks we execute, but still the number of tasks can be run at a time is still depends on resources at that time, e.g. number of cores are free to processing.

- 1,914
- 14
- 20