e**u 发帖数: 409 | 1 写程序时报错,
File "/usr/lib/python2.4/threading.py", line 416, in start
_start_new_thread(self.__bootstrap, ())
thread.error: can't start new thread
只能到300多个thread,
如果改了ulimit的上限到unlimited最多也只能到500个thread
报同样的错
怎么才能解决呢?
多谢 | i*****f 发帖数: 578 | 2 i found this artible here.
http://www.velocityreviews.com/forums/t347990-thread-limit-in-python.html
it seems not to be a language thing, since the author did the same thing in
pthread and reached the same limit as in python. he thought it might be an
os imposed limit.
it maybe simply that you are using too much system resources that it can't
support creating more threads. should you try a thread pool instead?
【在 e**u 的大作中提到】 : 写程序时报错, : File "/usr/lib/python2.4/threading.py", line 416, in start : _start_new_thread(self.__bootstrap, ()) : thread.error: can't start new thread : 只能到300多个thread, : 如果改了ulimit的上限到unlimited最多也只能到500个thread : 报同样的错 : 怎么才能解决呢? : 多谢
| m*****g 发帖数: 54 | 3 If you really really need that many threads, you need use 64 bit OS.
That said, using thread is not free, It is crazy for one process to try to
create more than 300 threads. using
thread pool sound like a better approach
【在 e**u 的大作中提到】 : 写程序时报错, : File "/usr/lib/python2.4/threading.py", line 416, in start : _start_new_thread(self.__bootstrap, ()) : thread.error: can't start new thread : 只能到300多个thread, : 如果改了ulimit的上限到unlimited最多也只能到500个thread : 报同样的错 : 怎么才能解决呢? : 多谢
|
|