I have a question about the lifetime of a
thread and the Garbage Collector.
If I have something like the following:
And then somewhere else in my code I have:
MyThread thread = new MyThread();
thread.start();
So the thread runs, but it is not a infinite loop so when the execution ends inside the thread, does the thread die? And then is the thread object available for the Garbage Collector?
In case you are wondering why I am running a thread that does not have an infiniate loop of any kind like most threads probably will, I am using the SwingUtilities.invokeLater() from a JButton actionEvent in quering a Database that takes a little time, I don't want the ActionEvent to be hung up on waiting for that process to finish, but it does finish. So the thread should end.
Anyway, that is my question.
Thanks
[ July 31, 2002: Message edited by: Gregg Bolinger ]