Answer the question
In order to leave comments, you need to log in
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
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 questionAsk a Question
731 491 924 answers to any question