aspose file tools*
The moose likes Performance and the fly likes execute vs submit ( threadPoolExecutor) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Performance
Reply locked New topic
Author

execute vs submit ( threadPoolExecutor)

Steven Rodeo
Ranch Hand

Joined: Mar 06, 2008
Posts: 72
Folks,

Sorry if this sound too basic... What is the difference between a submit and an execute of a Runnable task in a ThreadPoolExecutor.

A sample code fails with a RejectedExecutionException when we attempt to use execute ( Ofcourse Calling the shutdown on the ThreadPoolExecutor )

The same code 'Seems' to work with submit... Are we lucky ? or is it some race condition or a difference between execute and submit that eludes me ?

Thanks a bunch...
Nitesh Kant
Bartender

Joined: Feb 25, 2007
Posts: 1638

Please do not Cross-post the same question in multiple forums.
Let us continue the discussion here


apigee, a better way to API!
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29281
    
140

Thanks for pointing that out Nitesh!


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: execute vs submit ( threadPoolExecutor)
 
Similar Threads
Better than ThreadPoolExecutor
What is the difference between executeUpdate and execute?
execute vs submit ( ThreadPoolExecutor)
Difference between multithreading with and without Executor
Is there any difference between executeUpdate and execute?