I know that the proper way to kill a Thread subclass is to check periodically if some flag (like self.running) is set to a certain “kill” value, but I have a Thread that may hang waiting for input and I’d like to kill it anyway from an external process.
Any help?
If you are willing to switch from the threading module to the multiprocessing module for your thread interface, then this is possible. All that needs to be done, is to track the PID of each thread/process that is launched.