Caveats to be aware of when using threading in Python?
        Posted  
        
            by knorv
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by knorv
        
        
        
        Published on 2010-05-30T11:29:14Z
        Indexed on 
            2010/05/30
            11:32 UTC
        
        
        Read the original article
        Hit count: 279
        
I'm quite new to threading in Python and have a couple of beginner questions.
When starting more than say fifty threads using the Python threading module I start getting MemoryError. The threads themselves are very slim and not very memory hungry, so it seems like it is the overhead of the threading that causes the memory issues.
- Is there something I can do to increase the memory capacity or otherwise make Python allow for a larger number of threads?
- What is the maximum number of threads you've been able to run in your Python code using the threadingmodule? Did you do any tricks to achieve that number?
- Are there any other caveats to be aware of when using the threadingmodule?
© Stack Overflow or respective owner