File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Who clean up finished Timer's threads?

 
tom chansky
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If a Timer class is scheduled to perform a certain task repeatedly, and when a scheduled task is finished, who will clean up or terminate or stop that thread? Is there anything that I can do to make sure those finished threads are cleaned up so that they will not occupy resources.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you try the JavaDoc for Timer? It talks about how Timers end, good or bad. You might make the Timer a daemon or cancel it at shutdown. I'm thinking I've never done that but never had any problems either. But I'm not so sure about the no problems.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic