N
N
noob2222020-04-15 20:25:25
Python
noob222, 2020-04-15 20:25:25

Is it possible to terminate another thread from the main thread?

Hello, I want to remake a bot that will create additional threads in which there will be an endless loop. And then the question arose whether I can delete this thread from the main thread and then re-create it? Otherwise, it’s not convenient to constantly log into the server and restart the bot so that something is added.
Tell me please =)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2020-04-15
@noob222

It is forbidden. A thread must manage its own life cycle. You can only send signals to it via a shared variable or some kind of synchronization primitive.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question