posted 7 years ago
How does one count the number of threads in a program? I want to modify the method below so that when a new socket connects (and a new thread is opened) the count increases by 1 and when the thread ends it decreases by 1. Alternatively, I would like to store all the active threads in an array. Is there a standard way of doing this?