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
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