I was wondering if it is possible to resume execution or re-execute a thread after it is terminated. I have used Suspend and Resume which work but they cause the program to sometimes hang unpredictably preventing my program from closing therefore I decided not to use them. I am using the thread for reading over an indy connection.
The thread object is created during application start (FormCreate) and terminated when the connection is disconnected. The thread object is not freed on termination (my choice FreeOnTerminate := False) so I guess the reference to the thread object is still valid. I would like to have just one thread on the client and I am avoiding creating the thread on each connect. I have read that the overhead in managing multiple threads can impact performance. I have also noticed I cannot free the thread object when my application is closing down (FormClose) coz it hangs on calling Free even though the thread is terminated before freeing it.