What is the use of a Thread pool in Java?

前端 未结 7 1958
醉梦人生
醉梦人生 2020-12-04 09:02

What is the use of a Thread pool? Is there a good real world example?

7条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-04 09:26

    Thread Pools from the Java Tutorials has a good overview:

    Using worker threads minimizes the overhead due to thread creation. Thread objects use a significant amount of memory, and in a large-scale application, allocating and deallocating many thread objects creates a significant memory management overhead.

提交回复
热议问题