Answer the question
In order to leave comments, you need to log in
How to stop a thread in python by its name?
In general, the whole essence of the question lies in the title. I have the name of a specific thread that is already running. How can I stop him by name? Or how, in principle, to refer to a thread by its name? Help me please!
Answer the question
In order to leave comments, you need to log in
A thread must manage its own lifecycle on its own. Another thread can only send signals to it, changing the general state - a variable, a queue, or some of the synchronization primitives.
There is no standard mechanism. You will have to implement some sort of mechanism to control your flow.
As a variant - to transfer to a flow its individual Boolean variable. Continuously check a variable in a stream. As soon as its state changes, terminate the thread.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question