Max Android Threads

I want to know if there is a maximum number of threads that can be run on an Android device. Does it depend on the type of device?

+5
source share
2 answers

As @Xaver Kapeller commented, you can create as many Threads as you want, but more Thread is actually not part of the solution.

A core (CPU) in a Processor will only process one Task ( Process or Thread ) at a given time.

therefore, in a Processor with 1 core, one Thread will be processed at a time. so technically no matter how many threads you open for this Processor , it will serve the thread at a given time. All threads that work will sequentially use the processor, using the quantum time of the processor, which only seems parallel.

Processor with 2 cores will process 2 threads at a time (two threads running simultaneously).

Processor core with 4 core will process 4 threads at a time (simultaneously executing four threads.

Processor with 8 cores will process 8 threads at a time (simultaneously executing eight threads and so on

+7
source

The maximum number of threads that can be run on an Android device depends on whether the device has a 32-bit processor or a 64-bit processor, and here , you can run tests to determine the maximum number of threads that you can create in your version of Android.

0
source

Source: https://habr.com/ru/post/1242021/


All Articles