M
M
MiAbo2021-07-14 17:07:20
Python
MiAbo, 2021-07-14 17:07:20

Whether to limit the running time of threads?

There is a thread pool that is instantiated at the time of application startup and a certain number of threads are created in it that read the queue (Producer-Consumer). The moment an application catches a SIGINT or SIGTERM signal, this thread pool gracefully stops the threads. If the application runs for a week, will there be any problems (with memory or something)? Is it necessary once in a while to delete old threads and create new Thread instances?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2021-07-14
@MiAbo

Threads share a common address space, so terminating a thread will not free up memory if it was running current code.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question