Hey guys, I’m writing a script to update status log, this involves frequently file operations. My way of doing this is to use a “big” method including all read/write operations on this file, and set a RLock to make sure only one thread operating the file at a time.
I’m sure there is far less than 1000 threads running when I got “can’t start new thread” error, so it can’t be threads reaching limit, then what could be the problem causing this error? Or is there a better structure to do this job?
Thanks
You are probably reaching memory limit for an application on your platform. Check how much is allocated for stack for each thread.
http://docs.python.org/library/resource.html