• Post Reply Bookmark Topic Watch Topic
  • New Topic

Why can't a thread be restarted?  RSS feed

 
Sasikanth Malladi
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all, I'm not sure if this an FAQ. I did google around but couldn't find anything.
What is the rationale behind not letting a thread be rerun?
Let's say I have a thread t1 that does a job.
I do the job with t1.start();
Assuming that all is well and that the job is finished and I need the same job to be done again.
Why can't I say t1.start(); again?
What is the design decision that precluded this behavior from being implemented?
Thanks,
SM
 
Jim Hoglund
Ranch Hand
Posts: 525
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I recommend that you launch a new thread when the process needs to run again.
Second guessing the Java designers is generally not a productive strategy, unless
of course, your real interest is in designing multi-threading languages.

Jim ... ...
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!