Because my program is a server, I need to constantly create new threads to handle client requests. If the waiting pressure is high, the handle will not be released and it will occupy system resources. Currently, thread pools have been used to solve this problem.
Remind:
Thread variables are best defined to run in another form or module, so in the event of closing that form:
osThread.Join();
osThread.Abort();
And release the resource form resource after the form is closed: frm.Dispose();
Normal threads will release resources accordingly.