I have a thread pool with threads doing specific tasks. After the task is done, I let the run() method of a worker to terminate.
After this, should I explicitly kill the thread with sys.exit() ? I noticed that the worker thread persists in the background, even after the task is done.
What’s the recommended way to purge old threads?
Executing
sys.exitwill quit the whole application. There is no need to do anything with a thread finished execution.Fur further reference about stopping/killing a thread see this question.