• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

TaskExecutor.exucute(Runnable)

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic