Meaningless Drivel is fun!*
The moose likes Threads and Synchronization and the fly likes Thread vs Executor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Thread vs Executor" Watch "Thread vs Executor" New topic
Author

Thread vs Executor

rakesh sugirtharaj
Ranch Hand

Joined: Dec 16, 2007
Posts: 151
What is the advantage of using Executors over conventional threading? Can anyone explain with a simple example?


Cheers!
RSR
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38057
    
  22
Find a copy of Java Concurrency in Practice by Brian Goetz, Tim Peierls, Joseph Bowbeer, David Holmes, Joshua Bloch, Doug Lea.

I think this thread would sit better in the threads forum, so I shall move it.
Nitesh Kant
Bartender

Joined: Feb 25, 2007
Posts: 1638

Executors is a threadpool.
Its costly to create a new thread everytime to process a task.
Its effective and recommended to reuse threads if possible.
Executors do just that for you.

This is the basic benefit of using Executors over thread creation per task.

For detailed discussions do read the book that Campbell has pointed out!


apigee, a better way to API!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Thread vs Executor
 
Similar Threads
Process the multiple records in a file by Producer/consumer concept using Multithreading
Parallel processing
Thread and Web Applications
Executors
Multi threaded programs in Java