Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Thread Pooling and its implementation  RSS feed

 
Yatish Sonkeshariya
Greenhorn
Posts: 16
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am new in Java-Thread. Can you explain what is Thread-Pooling and how we can implement this concept in java?

 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thread pool contains pre-instantiated worker threads which will execute job/task you pass to it. Thread pool minimizes the overhead of creating and destroying the threads.

Example like, web server, which takes and executes thread from thread pool for each request received.

In order to see how one can implement it, I suggest to go through JDK code for java.util.concurrent.ThreadPoolExecutor
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!