How would you implement a thread pool?

How would you implement a thread pool?

Creating too many threads in one JVM can cause the system to run out of memory or thrash due to excessive memory consumption. To prevent resource thrashing, server applications need some means of limiting how many requests are being processed at any given time. A thread pool offers a solution to both the problem of thread life-cycle overhead and the problem of resource thrashing.

Methods in org.apache.avalon.cornerstone.blocks.threads that return ThreadPool
 ThreadPool AbstractThreadManager.getThreadPool(java.lang.String name) :  Retrieve a thread pool by name.
 ThreadPool AbstractThreadManager.getDefaultThreadPool() :   Retrieve the default thread pool.

Date:2016-01-09 00:00:00

Post Your Answers

User Email:

User Name:

Related Java Subjective Links

Java Subjective interview questions and answers for experienced and fresher