Global concurrency thread pool behavior differs between Android and Linux

We found that the behavior of the global concurrency thread pool differs between Android and Linux. On both, the thread pool starts out with a number of threads that corresponds with the number of cores the system has. However, while on Android new threads will never be added to the pool, on Linux the pool grows to a maximum of 128 threads when tasks are being blocked.

I've always understood the global concurrency thread pool to be fixed width, which would indicate the behavior on Android is correct. Do Apple platforms have the same behavior? Do we want to make sure they all behave in the same way? If so, do we need to change the behavior on Linux or Android?

For more information, see also this discussion.

Note that this was found on the Android emulator. Perhaps it behaves differently on a real Android device? Nevertheless, the question remains what would be the expected behavior and whether anything needs to be changed/fixed. If so, I can file a bug for it.

CC: @lukasa, @Finagolfin

2 Likes