[python-win32] 1MB Thread Stack Size

Hughes, Chad O chad.hughes at pnl.gov
Thu Jun 2 02:25:50 CEST 2005


I have a program that needs to create a great deal of threads.
Unfortunately, I cannot seem to find a way to lower the 1MB default
stack size per thread.  The threading module does not seem to support
setting the stack size explicitly.  I have 1GB of memory on my system so
I can only create about 1000 threads before I receive the following
error trace:

  File "C:\Python24\lib\threading.py", line 442, in __bootstrap
    self.run()
  File "C:\Python24\lib\threading.py", line 422, in run
    self.__target(*self.__args, **self.__kwargs)
  File "C:\tagent\globalModule.py", line 190, in shell
    self.target()
  File "C:\tagent\agent.py", line 132, in runLoop
    self.timeSliceEvent(currentTime,delta)
  File "C:\tagent\agent.py", line 397, in timeSliceEvent
    actorInstance.threadStart()
  File "C:\tagent\agent.py", line 117, in threadStart
    threading.Thread.start(self)
  File "C:\Python24\lib\threading.py", line 416, in start
    _start_new_thread(self.__bootstrap, ())
  error: can't start new thread

Any ideas on how to lower the stack size?

Chad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20050601/8029372d/attachment.htm


More information about the Python-win32 mailing list