In a windows application, apart from main thread there is another thread which does a long run operation for every minute and updates the UI using Invoke method.
How can we terminate the another thread gracefully when it is in sleeping state?
Is it a right choice of using sleep here?
There is no such thing as graceful thread termination. Instead, your thread should be instructed to stop doing it’s job once it’s no longer needed. You could do this by creating class to hold worker thread parameters inside which you store information whether work should be stopped, and pass an object of that class to the thread.