| Author |
regarding thread run method
|
rajareddy annavaarm
Ranch Hand
Joined: Mar 15, 2007
Posts: 96
|
|
|
Why cant we call run method in thread class directly?why we are calling it indirectly by start method?
|
 |
rajaraman navaneethan
Ranch Hand
Joined: Feb 26, 2005
Posts: 86
|
|
Hi Rajareddy, When you call the run method directly a separate call stack is not created and it runs as a part of the same call stack from the method which it is called.Eventually it doesnt run concurrently with other threads. regards, Raja
|
 |
Peter Chase
Ranch Hand
Joined: Oct 30, 2001
Posts: 1970
|
|
|
Yes, the answer is that you can call run() method, just like any other method. But that runs it in the current thread. If you want to run it in another thread, you must use the API of Thread class to start a new thread, which will then call run() in the new thread.
|
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.<br /> <br />#:^P
|
 |
 |
|
|
subject: regarding thread run method
|
|
|