Find number of active threads

Joined
Oct 16, 2008
Messages
1
Reaction score
0
Hello all,

I've been working with Python for about 6 months so I'm still pretty green. I'm working on a tool that spawns multiple (read: tons of) threads using the threading module to transmit network data. (It's quite a bit more complicated than that, but this is what it does in a nutshell.)

The trouble is, occasionally the program crashes with a "can't start new thread" error. The point at which this occurs is unpredictable. I don't know exactly why this occurs but my hunch is possibly that I'm running out available threads (I read somewhere that Python's active thread max is something like 1024, though I don't know if that's true).

Given that hunch...
Question: Is there a way to report the number of current threads?

Thanks,
-Lars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top