Mod 5: Thread pools Flashcards
Why would we want to limit the number of threads?
Thread creation is expensive, we want to decrease overhead
What is a thread pool?
A thread pool is a collection of thread , where the threads is recycled
What are an example of shared resources in thread pool?
The queue holding tasks waiting for an available thread
In java, which classes are used to work with thread pools?
(1) Executor
(2) Executors
(3) ExecutorService
What are some advantages of a thread pool?
(1) Saves resources
(2) Improved performance
(3) Prevent overload
(4) Managed way of using threads
What is “overload”?
Overload occurs when overhead exceeds available time to perform tasks, and the system stops responding
What are some dissadvantages of thread pools?
(1) Lack of control over specific threads
(2) Limited scalability
(3) Potential for thread starvation
(4) Complex programming
(5) Increased memory usage