What is the use of a Thread pool in Java?

A thread pool is a group of threads initially created that waits for jobs and executes them. The idea is to have the threads always existing, so that we won’t have to pay overhead time for creating them every time. They are appropriate when we know there’s a stream of jobs to process, even though there could be some time when there are no jobs.

Here’s a nice diagram from Wikipedia:
alt text

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)