Possible Duplicate:
python - how to get the numebr of active threads started by specific class?
I'm new in python, i want to get count of running threads at any time...is there any built in support for this or i have to maintain it manually (e.g. count veriable...) ?
In Python, the method threading. active_co unt() from the threading module is used to count the currently active or running threads.
The java. lang. Thread. activeCount() method returns the number of active threads in the current thread's thread group.
Creating Thread Using Threading ModuleDefine a new subclass of the Thread class. Override the __init__(self [,args]) method to add additional arguments. Then, override the run(self [,args]) method to implement what the thread should do when started.
In the java console, hit Ctrl-Break. It will list all threads plus some information about the heap.
threading.active_count() seems to be what you're looking for :
Return the number of Thread objects currently alive
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With