Where is the thread pool used in Android application development?

Question: When do I need to use thread pool for Android application development?
Performance optimization

Question: Why does thread creation and destruction easily lead to frequent GC execution?

Question: Where is the thread pool useful in Rxjava?
In java, Executors has four functions for creating thread pools, among them:

 public static ScheduledExecutorService newScheduledThreadPool(int corePoolSize) {
      return new ScheduledThreadPoolExecutor(corePoolSize);
  }

ScheduledExecutorService is an interface, and ScheduledThreadPoolExecutor implements this interface, so the function newScheduledThreadPool() returns a ScheduledExecutorService object.
In Schedulers.io(), a thread pool is generated: ScheduledExecutorService.
Reference
Reference Two
Reference Three

Guess you like

Origin blog.csdn.net/zhangjin1120/article/details/110082875