aspose file tools*
The moose likes Threads and Synchronization and the fly likes Thread Pooling and its implementation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Thread Pooling and its implementation" Watch "Thread Pooling and its implementation" New topic
Author

Thread Pooling and its implementation

Yatish Sonkeshariya
Greenhorn

Joined: Sep 28, 2011
Posts: 16

Hi All,
I am new in Java-Thread. Can you explain what is Thread-Pooling and how we can implement this concept in java?


Thanks, Yatish Sonkeshariya
Pune(411001), India
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

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


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
 
Don't get me started about those stupid light bulbs.
 
subject: Thread Pooling and its implementation