I have a main function which has generated two threads for updation of JDBC SQL results. The child threads exclusively work are in infinite loop and update the results after five minutes. I want before exiting the main thread, child tread should be killed.
What is the best procedure for that?
So I assume your code is like this:
What you can do is implement a flag:
then in the main thread: