Link to home
Start Free TrialLog in
Avatar of java_kevin
java_kevin

asked on

threads

if thru out my program, i start a thread, but later jus suspend it, will it use up resources? i mean, waste them.

for those who see this qn, if u want, b prepared to ans quite a few more questions regarding these simple applet stuffs.
ASKER CERTIFIED SOLUTION
Avatar of imladris
imladris
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of java_kevin
java_kevin

ASKER

if i stop it, but later may need again, do i need to .start() again? or i need to create a new thread?
Adjusted points to 50
my answer is that you can use both techiques with the same result - a real Thread from the underlying OS will be started.
Correct. If you stop() it, the way to fire it back up is to use start(). There is no major difference between using stop() - start() and suspend() - resume(). The choice I would make would depend on details of the frequency of the action, and the probable state of the thread at the time of suspension/stopping.
Thanks.

And 'cos I'm doing a project, I may need to get your details to acknowledge your help.

Hope you can give them in case I need.

Thanks again.