Home > other > How to realize the thread in python3 timeout "suicide"?
How to realize the thread in python3 timeout "suicide"?
Time:11-25
Dear bosses, ask a question: python3 multithreaded development, how to realize the thread the longest running time, when the thread running overtime automatically 'suicide', release resources,
CodePudding user response:
Use the thread pool? Each thread created, go to somewhere to register, At the end of the thread, to end of the registration, Regularly traverse the registration centre, if overtime, exit method of thread of execution