AsyncTask are executed seriallu but we can execute them parallely using executeOnExecutor. How many Asynctask we can execute parallely in Android?
-
Possible duplicate of [How many AsyncTasks i can run in an single process application](http://stackoverflow.com/questions/24505981/how-many-asynctasks-i-can-run-in-an-single-process-application) – ישו אוהב אותך Oct 10 '16 at 07:13
3 Answers
I believe this StackOverflow post has already answered your question: How many AsyncTasks i can run in an single process application
How many AsyncTasks can you run at once?
In most versions of Android, the answer is 128.
Please do a quick search before asking these questions.

- 1
- 1

- 73
- 1
- 10
Android uses ThreadPool inside AsyncTask. Maximum size of this thread pool is
MAXIMUM_POOL_SIZE = CPU_COUNT * 2 + 1;
So maximum number of AysncTask depends on CPU Count.
Reference:
http://dsalgos.com/971/how-many-asynctasks-can-you-execute-in-parallel

- 449
- 3
- 16
-
1Adding to this, you can also create your own executor, with your own settings. So with a custom executor, it can be theoretically unlimited. – Daniel Zolnai Oct 10 '16 at 06:38
Check this answer.
AsyncTask uses a thread pool pattern for running the stuff from doInBackground(). The issue is initially (in early Android OS versions) the pool size was just 1, meaning no parallel computations for a bunch of AsyncTasks. But later they fixed that and now the size is 5, so at most 5 AsyncTasks can run simultaneously. Unfortunately I don't remember in what version exactly they changed that.
Running multiple AsyncTasks at the same time -- not possible?
Also check the above link. Hope it will help.