This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
    Bookmark Topic Watch Topic
  • New Topic

execute vs submit ( threadPoolExecutor)

 
Steven Rodeo
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not Cross-post the same question in multiple forums.
Let us continue the discussion here
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34084
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
Thanks for pointing that out Nitesh!
 
    Bookmark Topic Watch Topic
  • New Topic