python stop thread

Python doesn't provide a way to end a thread, send it a signal, adjust its schedule, or perform other advanced operations.

If you need to terminate a thread, you need to program the thread to poll at a certain point to exit. But if a thread keeps blocking on an I/O operation, it can never return and can't check whether it has been terminated. To properly handle these issues requires careful manipulation of threads with timeout loops.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325987048&siteId=291194637