Hi Varun,
You can run those threads in infinite loop. When application quits, those threads will stop anyway.
Or even better, if you have a way to stop application(say a
thread waiting for exit command etc.), then you can send message to those threads. The message can be as simple as a boolean variable. So once exit command is received, all threads (which are running in a loop
and checking if exit command is received) will finish current task, make cleanup (close log file descriptor, close sockets etc.) and break the loop. Join those threads in main and exit.
I hope this helps.
Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)