Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

TaskExecutor.exucute(Runnable)

 
Rakesh Basani
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys..

I am stuck with one doubt. In general Threads concept, if we call Thread.start() two times continuously then the second Thread.start() will throw IllegalStateExeception.
In the same way when I call TaskExecutor.execute(Runnable) two times continuously, its not throwing any exception.. Please clarify me..


Thanks in advance.
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are comparing an Executor to a Thread. They are not the same.

When calling Thread.start() two times you are trying to start the same thread twice this is not what happens when you call TaskExecutor.execute(Runnable) twice.

Please read the relevant part of the documentation and if that does not clear it up, post back with any questions.

http://static.springsource.org/spring/docs/3.1.x/spring-framework-reference/html/scheduling.html#scheduling-task-executor
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic