The moose likes Threads and Synchronization and the fly likes Why can't a thread be restarted? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "Why can Watch "Why can New topic
Author

Why can't a thread be restarted?

Sasikanth Malladi
Ranch Hand

Joined: Nov 04, 2000
Posts: 175
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

Joined: Jan 09, 2008
Posts: 525
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 ... ...


BEE MBA PMP SCJP-6
 
 
subject: Why can't a thread be restarted?
 
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com