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: 34225
341
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